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: ' 2.1.2',
		versions: ['95', '97', '99', '93', '98', '101', '102'],
		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" loading="lazy"><br><br><b>After installing/selecting smiley pack you need to organisme them <br>Display 1 row and hide the rest (SHOW MORE button)</b>',
		file: 'smilehyves.zip'
	},
	4233: {
		name: ' 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" loading="lazy"><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" loading="lazy"><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" loading="lazy"><br /><br /><a href="https://www.dailyinternetlife.com/2019/05/unicode-emoji-smilies-for-simple.html" class="bbc_link" target="_blank" rel="noopener">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">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">https://creativecommons.org/licenses/by/4.0/</a><br />&gt;&gt;<a href="https://twemoji.twitter.com/" class="bbc_link" target="_blank" rel="noopener">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: ' 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 /><b>License</b><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'
	},
	1184: {
		name: ' v1.0',
		versions: ['35'],
		desc: '<div class="centertext"><span style="color: green;" class="bbc_color"><span style="font-size: 2em;" class="bbc_size"><b>Perfect Smiley Collection</b></span></span><br /><hr><br /><a href="http://custom.simplemachines.org/mods/index.php?mod=1184" class="bbc_link" target="_blank" rel="noopener"><b>Link to this Modification</b></a> | <a href="http://www.javanation.ultimatehoster.com/forums/index.php?topic=1.msg2" class="bbc_link" target="_blank" rel="noopener"><b>Live Preview/Demo</b></a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /><hr></div><u><b>Description:</b></u> This modification will give you a great new pack of extra <br />smileys, in which you can use for your forum.<br /><br /><u><b>Type:</b></u> Smiley Pack<br /><br /><u><b>Version:</b></u> 1.0<br /><br /><u><b>Images of Modification:</b></u> <br /><br /><img src="https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg255.imageshack.us%2Fimg255%2F4544%2Findexbj2.png&hash=a3045dbb14b5ad1afa20b19094fc8055b7e59781" alt="" class="bbc_img" loading="lazy"><br /><br /><hr><br /><div class="centertext"><br /><i><u><b>Other Information:</b></u></i><br />For more classified information, please view the information text file inside the Compacted ZIP.<br /><br />I did not create them all. I don&#039;t take all the credits. Around 90% of all credits go to the great people <br />who found/created them at: <br /><br /><a href="http://www.bigboards.com" class="bbc_link" target="_blank" rel="noopener">http://www.bigboards.com</a><br /><br /><b>Official Site:</b> <a href="http://www.runejava.net" class="bbc_link" target="_blank" rel="noopener">http://www.runejava.net</a> <br /><br /><b>Email:</b> <a href="mailto:insidesin@runejava.net" class="bbc_email">insidesin@runejava.net</a><br /><br />Thanks, Inside Sin</div>',
		file: 'Perfect Smileys v1.0.zip'
	}};
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(1184);void(0);"> v1.0</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;
}