var actionurl = '?action=admin;area=smileys;sa=install;set_gz=';
if (typeof(window.smfForum_sessionvar) == "undefined")
	window.smfForum_sessionvar = 'sesc';

var smf_smileysInfo = {

	4267: {
		name: 'Hyves Smileys 1.0',
		versions: ['95', '93'],
		desc: '<img src="https://i2.wp.com/www.bregblogt.nl/wp-content/uploads/2015/10/hyves_kwekker_icons_2_11221_4168_image_5597.gif" alt="" width="600" height="450" class="bbc_img resized" />',
		file: 'smilehyves.zip'
	},
	4233: {
		name: 'unicode emoji for smf 1.1',
		versions: ['91', '93'],
		desc: 'unicode emoji Smilies by ~ibtisam midlet<br /><br />how to install:<br />firstly to active the Smilies after installation go to [your forum name]/admin/?area=smileys;sa=modifyset<br /><br /><img src="https://github.com/ibtisammidlet/unicode-emoji-for-smf/raw/master/1.PNG" alt="" width="600" height="92" class="bbc_img resized" /><br />save then that go to [your forum name]/admin/?area=smileys;sa=settings;<br /><img src="https://github.com/ibtisammidlet/unicode-emoji-for-smf/raw/master/2.PNG" alt="" width="600" height="195" class="bbc_img resized" /><br />save then then it will works <img src="https://static.simplemachinesweb.com/smf/smileys/default/smiley.gif" alt="&#58;&#41;" title="Smiley" class="smiley" /><br /><img src="https://github.com/ibtisammidlet/unicode-emoji-for-smf/raw/master/3.PNG" alt="" width="600" height="301" class="bbc_img resized" /><br /><br /><a href="https://www.dailyinternetlife.com/2019/05/unicode-emoji-smilies-for-simple.html" class="bbc_link" target="_blank" rel="noopener noreferrer">unicode emoji v1.0 mod for SMF</a> is licensed under MIT and CC-BY 4.0<br /><br />emoji icons are licensed to:<br />Copyright 2019 Twitter, Inc and other contributors<br />Code licensed under the MIT License: <a href="http://opensource.org/licenses/MIT" class="bbc_link" target="_blank" rel="noopener noreferrer">http://opensource.org/licenses/MIT</a><br />Graphics licensed under CC-BY 4.0: <a href="https://creativecommons.org/licenses/by/4.0/" class="bbc_link" target="_blank" rel="noopener noreferrer">https://creativecommons.org/licenses/by/4.0/</a><br />&gt;&gt;<a href="https://twemoji.twitter.com/" class="bbc_link" target="_blank" rel="noopener noreferrer">https://twemoji.twitter.com/</a><br /><br /><br />Enjoy the Smilies :&quot;)<br /><br />change log:<br />1.1 - fixed the big size of the icon compared to the text<br />&nbsp; &nbsp; - fixed bug the previous version not working like it should do<br />&nbsp;&nbsp;&nbsp;<br />1.0 - first version',
		file: 'unicode emoji v1.1.zip'
	},
	4099: {
		name: 'EmojiOne 0.3.2',
		versions: ['84'],
		desc: 'EmojiOne is not BBC but functions in the same space as BBC.<br /><br />This mod add some support for converting emoji decimal input into their hexadecimal counterpart. With the hexadecimal data this mod replaces the decimal data with the appropriate emoji from the EmojiOne CDN server.<br /><br /><strong>License</strong><br />Copyright (c) 2016, Russell Najar<br />All rights reserved.<br /><br />Redistribution and use in source and binary forms, with or without<br />modification, are permitted provided that the following conditions are met:<br /><br />* Redistributions of source code must retain the above copyright notice, this<br />&nbsp; list of conditions and the following disclaimer.<br /><br />* Redistributions in binary form must reproduce the above copyright notice,<br />&nbsp; this list of conditions and the following disclaimer in the documentation<br />&nbsp; and/or other materials provided with the distribution.<br /><br />THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;<br />AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br />IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<br />DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE<br />FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL<br />DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR<br />SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER<br />CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,<br />OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE<br />OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.',
		file: 'SMF-EmojiOne.tar.gz'
	},
	1844: {
		name: 'Shiny Smiley Icons ',
		versions: ['70', '79', '68', '71', '80'],
		desc: '<br /><span style="color: orange;" class="bbc_color"><span style="font-size: 13pt;" class="bbc_size">Shiny Smiley Icons For SMF<br />&nbsp;</span></span> <br /><span style="color: orange;" class="bbc_color">By : islam2hamy</span> <br /><hr /><span style="color: blue;" class="bbc_color">Description:</span><br />&nbsp;<br />Nice 18 Smiley Icons For SMF . <img src="http://www.simplemachines.org/community/Smileys/simple/grin.gif" alt=";D" class="bbc_img resized" /> <br />&nbsp;<br /><a href="http://www.iconarchive.com/category/funny/shiny-smiley-icons-by-iconicon.html" class="bbc_link" target="_blank" rel="noopener noreferrer">Shiny Smiley Icons</a> By <a href="http://www.iconicon.net/" class="bbc_link" target="_blank" rel="noopener noreferrer">icon icon</a><br /><br /><hr /><span style="color: blue;" class="bbc_color">Compatibility With :</span><br />&nbsp;<br />&nbsp;smf 1.1.X &amp; smf 2.0<br /><br /><hr /><span style="color: blue;" class="bbc_color">Last Update:</span><br /><br />1/11/2009 - fix (undecided.gif &amp; rolleyes.gif)<br />&nbsp;<br /><hr /> <br /><a href="http://custom.simplemachines.org/mods/index.php?action=search;author=126024" class="bbc_link" target="_blank" rel="noopener noreferrer"><span style="color: red;" class="bbc_color"><span style="font-size: 13pt;" class="bbc_size">My Moods</span></span></a> / <strong><a href="http://custom.simplemachines.org/themes/index.php?action=profile;u=126024" class="bbc_link" target="_blank" rel="noopener noreferrer"><span style="color: red;" class="bbc_color">My Themes</span></a></strong><br /><br /><hr /><a href="http://www.smfarabic.com/" class="bbc_link" target="_blank" rel="noopener noreferrer"><img src="http://www.smfarabic.com/images/smfarabicbanner3_468x60.png" alt="" class="bbc_img" /></a> ',
		file: ''
	},};
var smf_latestSmileys = [4267, 4233, 4099];

function smf_packagesMoreInfo(id)
{
	window.smfLatestSmileys_temp = document.getElementById("smfLatestSmileysWindow").innerHTML;

	setInnerHTML(document.getElementById("smfLatestSmileysWindow"),
	'\
		<h3 style="margin: 0; padding: 4px;">' + smf_smileysInfo[id].name + '</h3>\
		<h4 style="padding: 4px; margin: 0;"><a href="' + window.smfForum_scripturl + actionurl + 'https://custom.simplemachines.org/mods/downloads/' + id + '/' + smf_smileysInfo[id].file + ';' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">Install Now!</a></h4>\
		<div style="margin: 4px;">' + smf_smileysInfo[id].desc.replace(/<a href/g, '<a href') + '</div>\
		<div class="titlebg" style="padding: 4px; margin: 0;"><a href="javascript:smf_packagesBack();void(0);">(go back)</a></div>');
}

function smf_packagesBack()
{
	setInnerHTML(document.getElementById("smfLatestSmileysWindow"), window.smfLatestSmileys_temp);
	window.scrollTo(0, findTop(document.getElementById("smfLatestSmileysWindow")) - 10);
}

window.smfLatestSmileys = '\
	<div id="smfLatestSmileysWindow" style="overflow: auto;">\
		<img src="https://www.simplemachines.org/smf/images/smileys.png" width="102" height="98" style="float: right; margin: 4px;" alt="(package)" />\
		<h3 style="margin: 0; padding: 4px;">Smiley of the Moment:</h3>\
		<div style="padding: 0 4px;">\
			<a href="javascript:smf_packagesMoreInfo(1844);void(0);">Shiny Smiley Icons </a>\
		</div>';

window.smfLatestSmileys += '\
		<h3 style="margin: 0; padding: 4px;">New Smileys:</h3>\
		<ul style="list-style: none; margin-top: 3px; padding: 0 4px;">';

for (var i = 0; i < smf_latestSmileys.length; i++)
{
	var id_mod = smf_latestSmileys[i];

	window.smfLatestSmileys += '<li><a href="javascript:smf_packagesMoreInfo(' + id_mod + ');void(0);">' + smf_smileysInfo[id_mod].name + '</a></li>';
}

window.smfLatestSmileys += '\
		</ul>';

window.smfLatestSmileys += '\
	</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;
}