
var smf_themeInfo = {
	3005: {
		name: 'Dark Caramel',
		desc: '<span style="font-size: 2em;" class="bbc_size"><b><span style="color: brown;" class="bbc_color">D<span style="color: black;" class="bbc_color">ark</span></span> <span style="color: brown;" class="bbc_color">C<span style="color: black;" class="bbc_color">aramel</span></span></b></span><br><span style="color: black;" class="bbc_color"><span style="font-size: 1.35em;" class="bbc_size"><b>A warm responsive Dark Caramel Latte feeling theme.</b></span></span><br><br><span style="color: black;" class="bbc_color"><span style="font-size: 1.35em;" class="bbc_size"><b>Features :</b></span></span><br><span style="color: black;" class="bbc_color"><span style="font-size: 1.35em;" class="bbc_size">Responsive Design</span></span><br><span style="color: black;" class="bbc_color"><span style="font-size: 1.35em;" class="bbc_size">Info Center Remixed</span></span><br><span style="color: black;" class="bbc_color"><span style="font-size: 1.35em;" class="bbc_size">Social Media Section ( Add links to your favorite social networks right to the sidebar)</span></span><br><span style="color: black;" class="bbc_color"><span style="font-size: 1.35em;" class="bbc_size">Font Awesome Icons</span></span><br><span style="color: black;" class="bbc_color"><span style="font-size: 1.35em;" class="bbc_size">Remixed Breadcrumb</span></span><br><br><br><span style="font-size: 1.35em;" class="bbc_size"><b>License :</b></span><br><br><span style="font-size: 1.35em;" class="bbc_size"><b><img src="https://img.shields.io/badge/license-MIT-blue" alt="" class="bbc_img" loading="lazy"> </b></span><br><span style="font-size: 1.35em;" class="bbc_size">Font Awesome License<b> - </b><a href="https://fontawesome.com/license/free" class="bbc_link" target="_blank" rel="noopener">https://fontawesome.com/license/free</a></span><br><br><span style="font-size: 1.35em;" class="bbc_size"><b>SMF Version :</b></span><br><br><span style="font-size: 1.35em;" class="bbc_size"><b><img src="https://img.shields.io/badge/SMF-2.1-blue" alt="" class="bbc_img" loading="lazy"></b> </span><br><br><br><span style="font-size: 1.35em;" class="bbc_size"><b>Patch Notes :</b></span><br><div class="codeheader"><span class="code floatleft">Code</span> <a class="codeoperation smf_select_text">Select</a> <a class="codeoperation smf_expand_code hidden" data-shrink-txt="Shrink" data-expand-txt="Expand">Expand</a></div><code class="bbc_code">1.0 : Initial Release</code><br><div class="codeheader"><span class="code floatleft">Code</span> <a class="codeoperation smf_select_text">Select</a> <a class="codeoperation smf_expand_code hidden" data-shrink-txt="Shrink" data-expand-txt="Expand">Expand</a></div><code class="bbc_code">1.0.1 : Fixed display issues with the sidebar.</code>',
		file: 'DarkCaramel.zip',
		author: 'TwitchisMental'
	},
	3019: {
		name: 'Christmas',
		desc: '<span style="color: green;" class="bbc_color"><span style="font-size: 1.45em;" class="bbc_size"><b>Christmas Theme</b></span></span><br><span style="color: green;" class="bbc_color"><span style="font-size: 1.45em;" class="bbc_size"><b><span style="color: black;" class="bbc_color"><span style="font-size: 1em;" class="bbc_size">A Christmas Theme for SMF 2.1</span></span></b></span></span><br><br><span style="color: black;" class="bbc_color"><span style="font-size: 1em;" class="bbc_size">This is a simple responsive Christmas Theme that only makes CSS changes. </span></span><br><br><span style="color: black;" class="bbc_color"><span style="font-size: 1em;" class="bbc_size"><b>Credits :</b></span></span><br><span style="color: black;" class="bbc_color"><span style="font-size: 1em;" class="bbc_size">Shout out to Antechinus for the Alternative Admin CP Layout that is used in this theme.</span></span><br>Tutorial found here - <a href="https://www.simplemachines.org/community/index.php?P=56aco6j31hidurshn91ac1jmdq&amp;topic=582354" class="bbc_link" target="_blank" rel="noopener">https://www.simplemachines.org/community/index.php?topic=582354</a>.<br><br><span style="font-size: 1em;" class="bbc_size"><b><span style="color: orange;" class="bbc_color"><span style="color: black;" class="bbc_color">License:</span></span></b></span><br><span style="font-size: 1em;" class="bbc_size"><b><span style="color: orange;" class="bbc_color"><span style="color: black;" class="bbc_color"><img src="https://img.shields.io/badge/license-MIT-blue" alt="" class="bbc_img" loading="lazy"></span></span></b></span><br><br><span style="font-size: 1em;" class="bbc_size"><b><span style="color: orange;" class="bbc_color"><span style="color: black;" class="bbc_color">SMF Version:</span></span></b></span><br><span style="font-size: 1em;" class="bbc_size"><b><span style="color: orange;" class="bbc_color"><span style="color: black;" class="bbc_color"><img src="https://img.shields.io/badge/SMF-2.1-blue" alt="" class="bbc_img" loading="lazy"></span></span></b></span><br><br><span style="font-size: 1em;" class="bbc_size"><b><span style="color: black;" class="bbc_color">Patch Notes:</span></b></span><br><div class="codeheader"><span class="code floatleft">Code</span> <a class="codeoperation smf_select_text">Select</a> <a class="codeoperation smf_expand_code hidden" data-shrink-txt="Shrink" data-expand-txt="Expand">Expand</a></div><code class="bbc_code">1.0 : Initial Release</code><br><div class="codeheader"><span class="code floatleft">Code</span> <a class="codeoperation smf_select_text">Select</a> <a class="codeoperation smf_expand_code hidden" data-shrink-txt="Shrink" data-expand-txt="Expand">Expand</a></div><code class="bbc_code">1.0.1 : <br>Bug Fix : Fixed an issue where the breadcrumb arrows were not always the same size.<br>Bug Fix : Fixed a script error related to missing scripts folder.</code>',
		file: 'Christmas.zip',
		author: 'TwitchisMental'
	},
	3018: {
		name: 'Roxed',
		desc: 'More experimenting.&nbsp; Built on my Boxit Theme, I took it step further with a different gradient background, some colour added.&nbsp; Also broke the theme up a small bit.',
		file: 'Roxed.zip',
		author: 'DevH'
	},
	3017: {
		name: 'Brown Shades',
		desc: 'Version 2.1.2b<br>Compatible with: SMF 2.1.2<br><br>Description: Shades of brown default curve theme variation.<br><br>Credits and shout outs to:<br><br><ul class="bbc_list" style="list-style-type: decimal;"><li>@Antechinus for <a href="https://www.simplemachines.org/community/index.php?P=56aco6j31hidurshn91ac1jmdq&amp;topic=578649.msg4096820#msg4096820" class="bbc_link" target="_blank" rel="noopener">The Custom Top Menu Bar</a>.</li><li>@pulgoki &amp; @Diego Andrés for the <a href="https://www.simplemachines.org/community/index.php?P=56aco6j31hidurshn91ac1jmdq&amp;topic=580500.0" class="bbc_link" target="_blank" rel="noopener">User Info Box trick.</a></li><li>@shadav for helping rearrange the <a href="https://www.simplemachines.org/community/index.php?P=56aco6j31hidurshn91ac1jmdq&amp;topic=579061.msg4098665#msg4098665" class="bbc_link" target="_blank" rel="noopener">footer</a></li></ul><br>Thanks! <img src="https://static.simplemachinesweb.com/smf/smileys/default/cool.gif" alt="8&#41;" title="Cool" class="smiley"><br><br>Custom Top Menu:<br>If you want the Custom Top Menu that works with this theme, <a href="https://www.simplemachines.org/community/index.php?P=56aco6j31hidurshn91ac1jmdq&amp;topic=578649.msg4096800#msg4096800" class="bbc_link" target="_blank" rel="noopener">get it here</a>.<br><br><b><a href="https://shadesweb.com/?theme=7" class="bbc_link" target="_blank" rel="noopener">Demo Theme</a></b><br><br><img src="https://img.shields.io/badge/License-MIT-blue" alt="" class="bbc_img" loading="lazy"><br><img src="https://img.shields.io/badge/SMF-2.1.2-blue" alt="" class="bbc_img" loading="lazy"><br><img src="https://img.shields.io/badge/Current%20Version-2.1.2b-yellow" alt="" class="bbc_img" loading="lazy"><br><br>Change log:<br><br><div class="codeheader"><span class="code floatleft">Code</span> <a class="codeoperation smf_select_text">Select</a> <a class="codeoperation smf_expand_code hidden" data-shrink-txt="Shrink" data-expand-txt="Expand">Expand</a></div><code class="bbc_code">1. Version 2.1.2b : 10/09/2022<br>Fixed color issues where text could not be seen in dark background of calendar and quick reply areas.</code>',
		file: 'Brown_Shades2.1.2b.zip',
		author: 'Shades.'
	},
	1179: {
		name: 'BlueHead',
		desc: 'BlueHead theme<br />-----------------------------------------------------------------------------------------------------------<br />Modern SMF Themes<br /><a href="http://mtlserver.com/smf/index.php?theme=53;language=english" class="bbc_link" target="_blank" rel="noopener">English Demo</a><br />user:demo pass:101010<br />Support Theme : <a href="http://www.smfgrup.com/" class="bbc_link" target="_blank" rel="noopener">http://www.smfgrup.com/</a><br /><br />------------------------------------------------------------------<br />Modern SMF Teması<br /><a href="http://mtlserver.com/smf/index.php?theme=53;language=turkish" class="bbc_link" target="_blank" rel="noopener">Türkçe Demo</a><br />kullanıcı:demo şifre:101010<br />tema destek :&nbsp; <a href="http://www.smfgrup.com/" class="bbc_link" target="_blank" rel="noopener">http://www.smfgrup.com/</a><br />-------------------------------------------<br /><br />BlueHead&nbsp; Theme By FriedeKind And Cadosoas&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <br /><br /><br /><br /><span style="color: green;" class="bbc_color">special thanks to&nbsp; &nbsp;MTLServer&nbsp; for hosting</span>',
		file: 'BlueHead117.zip',
		author: '•● FяiєdєKiηd™ ●•'
	}
};
var smf_featured = 3005;
var smf_random = 1179;
var smf_latestThemes = [3019, 3018, 3017];
function smf_themesMoreInfo(id)
{
	window.smfLatestThemes_temp = document.getElementById("smfLatestThemesWindow").innerHTML;

	// !!! Why not just always auto?
	document.getElementById("smfLatestThemesWindow").style.overflow = "auto";
	setInnerHTML(document.getElementById("smfLatestThemesWindow"),
	'\
		<h3 style="margin: 0; padding: 4px;">' + smf_themeInfo[id].name + '</h3>\
		<h4 style="margin: 0;padding: 4px;"><a href="https://custom.simplemachines.org/themes/index.php?lemma=' + id + '">View Theme Now!</a></h4>\
		<div style="overflow: auto;">\
			<img src="https://custom.simplemachines.org/themes/index.php?action=download;lemma='+id+';image=thumb" alt="" style="float: right; margin: 10px;" />\
			<div style="padding:8px;">' + smf_themeInfo[id].desc.replace(/<a href/g, '<a href') + '</div>\
		</div>\
		<div style="padding: 4px;" class="smalltext"><a href="javascript:smf_themesBack();void(0);">(go back)</a></div>');
}

function smf_themesBack()
{
	document.getElementById("smfLatestThemesWindow").style.overflow = "";
	setInnerHTML(document.getElementById("smfLatestThemesWindow"), window.smfLatestThemes_temp);
	window.scrollTo(0, findTop(document.getElementById("smfLatestThemesWindow")) - 10);
}

window.smfLatestThemes = '\
	<div id="smfLatestThemesWindow">\
		<div>\
			<img src="https://www.simplemachines.org/smf/images/themes.png" width="102" height="98" style="float: right; margin: 0 0 10px 10px;" alt="(package)" />\
			<ul style="list-style: none; padding: 0; margin: 0 0 0 5px;">';
for(var i=0; i < smf_latestThemes.length; i++)
{
	var id_theme = smf_latestThemes[i];
	window.smfLatestThemes += '\
				<li style="list-style: none;"><a href="javascript:smf_themesMoreInfo(' + id_theme + ');void(0);">' + smf_themeInfo[id_theme].name + ' by ' + smf_themeInfo[id_theme].author + '</a></li>';
}

window.smfLatestThemes += '\
			</ul>';
if ( smf_featured !=0 || smf_random != 0 )
{

	if ( smf_featured != 0 )
		window.smfLatestThemes += '\
				<h4 style="padding: 4px 4px 0 4px; margin: 0;">Featured Theme</h4>\
				<p style="padding: 0 4px; margin: 0;">\
					<a href="javascript:smf_themesMoreInfo('+smf_featured+');void(0);">'+smf_themeInfo[smf_featured].name + ' by ' + smf_themeInfo[smf_featured].author+'</a>\
				</p>';
	if ( smf_random != 0 )
		window.smfLatestThemes += '\
				<h4 style="padding: 4px 4px 0 4px;margin: 0;">Theme of the Moment</h4>\
				<p style="padding: 0 4px; margin: 0;">\
					<a href="javascript:smf_themesMoreInfo('+smf_random+');void(0);">'+smf_themeInfo[smf_random].name + ' by ' + smf_themeInfo[smf_random].author+'</a>\
				</p>';
}
window.smfLatestThemes += '\
		</div>\
	</div>';

function findTop(el)
{
	if (typeof(el.tagName) == "undefined")
		return 0;

	var skipMe = in_array(el.tagName.toLowerCase(), el.parentNode ? ["tr", "tbody", "form"] : []);
	var coordsParent = el.parentNode ? "parentNode" : "offsetParent";

	if (el[coordsParent] == null || typeof(el[coordsParent].offsetTop) == "undefined")
		return skipMe ? 0 : el.offsetTop;
	else
		return (skipMe ? 0 : el.offsetTop) + findTop(el[coordsParent]);
}

function in_array(item, array)
{
	for (var i in array)
	{
		if (array[i] == item)
			return true;
	}

	return false;
}