var actionurl = '?action=admin;area=packages;sa=download;get;package=';if (typeof(window.smfForum_sessionvar) == "undefined")
	window.smfForum_sessionvar = 'sesc';

if (typeof(window.smfVersion) != "undefined")
{
	var version = window.smfVersion;

	// We might need this...
	var smf_modificationInfo = {};
	
	switch (version)
	{
		case "SMF 2.0 Beta 1":
			window.smfLatestPackages = 'A few security vulnerabilities have been identified in SMF 2.0 beta 1 as well as a few small bugs. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.0.12_1.1.4_2.0.b1.1.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to update your version of SMF to 2.0 beta 1.1.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0 Beta 3 Public":
			window.smfLatestPackages = 'A few security vulnerabilities have been identified in SMF 2.0 beta 3 as well as a few small bugs. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.0.13_1.1.5_2.0-b3.1.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to update your version of SMF to 2.0 beta 3.1.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0 RC1":
			window.smfLatestPackages = 'A few security vulnerabilities have been identified in SMF 2.0 RC1. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.0.17_1.1.9_2.0-RC1-1.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to update your version of SMF to 2.0-RC1-1.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0 RC1-1":
			window.smfLatestPackages = 'A few security vulnerabilities have been identified in SMF 2.0 RC1-1. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.0.18_1.1.10-2.0-RC1.2.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to update your version of SMF to 2.0-RC1.2 .<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0 RC4":
			if (typeof(window.smfRC4patch) == "undefined")
				window.smfLatestPackages = 'A few security vulnerabilities have been identified in SMF 2.0 RC4. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0-RC4_security.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to install the security patch for SMF 2.0 RC4.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			else
				showLatestPackages();
			break;
		case "SMF 2.0":
			window.smfLatestPackages = 'A few security vulnerabilities have been identified in SMF 2.0. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.1.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to update your forum.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.1":
			window.smfLatestPackages = 'A few security vulnerabilities and bugs in SMF 2.0.1 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.2.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.2":
			window.smfLatestPackages = 'A security vulnerability and few bugs in SMF 2.0.2 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.3.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.3":
			window.smfLatestPackages = 'A few security vulnerabilities in SMF 2.0.3 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.4.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.4":
			window.smfLatestPackages = 'A few security vulnerabilities in SMF 2.0.4 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.5.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.5":
			window.smfLatestPackages = 'A few security vulnerabilities and bugs in SMF 2.0.5 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.1.19_2.0.6.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.6":
			window.smfLatestPackages = 'PHP 5.5 compatibility issues and several other bugs have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.7.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.7.<br /><br />If you have any problems applying it, you can try to use the upgrade file posted on the downloads page - although, any modifications you have installed will need to be uninstalled when you use that method.<br />Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.7":
			window.smfLatestPackages = 'Memory issues encountered with SMF 2.0.7, some MySQL 5.6 compatibility issues and a rare bug with the memberlist search feature have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.8.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.8.<br /><br />If you have any problems applying it, you can try to use the upgrade file posted on the downloads page - although, any modifications you have installed will need to be uninstalled when you use that method.<br />Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.8":
			window.smfLatestPackages = 'A few security vulnerabilities and bugs in SMF 2.0.8 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.1.20_2.0.9.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.9.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.9":
			window.smfLatestPackages = 'A few bugs in SMF 2.0.9 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.1.21_2.0.10.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.10.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled.  Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.10":
			window.smfLatestPackages = 'A security vulnerability has been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.11.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.11.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled. Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.11":
			window.smfLatestPackages = 'A few security vulnerabilities and bugs in SMF 2.0.11 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.12.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.12.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled. Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.12":
			window.smfLatestPackages = 'A few security vulnerabilities and bugs in SMF 2.0.12 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.13.zip;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.13.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled. Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.13":
			window.smfLatestPackages = 'A few security vulnerabilities and bugs in SMF 2.0.13 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.14.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.14.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled. Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
		case "SMF 2.0.14":
			window.smfLatestPackages = 'A few security vulnerabilities and bugs in SMF 2.0.14 have been fixed. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.15.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">this patch (click here to install)</a> to fix your forum and update it to 2.0.15.<br /><br />If you have any problems applying it, you can use the version posted on the downloads page - although, any modifications you have installed will need to be uninstalled. Please post on the <a href="https://www.simplemachines.org/community/index.php">forum</a> if you need more help.';
			break;
        default:
			showLatestPackages();
			break;
	}
}
else
{
	window.smfLatestPackages = 'For the package manager to function properly, please upgrade to the latest version of SMF.';
}

// This function shows latest mods when there isn't anything else to display
function showLatestPackages()
{
	smf_modificationInfo = {
	
		4197: {
			name: 'Button to share Whatsapp and Telegram 1.1',
			versions: ['91', '90'],
			desc: '<div align="center"><span style="color: brown;" class="bbc_color"><span style="font-size: 20pt;" class="bbc_size"><strong>Whatsapp and Telegram</strong></span></span><br /><span style="color: brown;" class="bbc_color">Button to share | Version 1.1</span><br />Developer: <a href="https://www.bombercode.net/foro/index.php?action=profile;u=1" class="bbc_link" target="_blank">Rock Lee</a><br /><br /><img src="https://www.bombercode.net/img/CompartirSocial.jpg" alt="" width="600" height="295" class="bbc_img resized" /></div><br /><span id="post_introduccion"><span style="color: teal;" class="bbc_color"><span style="font-size: 14pt;" class="bbc_size"><strong>Introduction</strong></span></span></span><br /><hr />It is a simple modification that adds 2 buttons to share via whatsapp and telegram. It takes the link of the subject you are looking at and when the application is detected it allows you to select who you can send it to.<br /><br /><span id="post_idioma"><span style="color: teal;" class="bbc_color"><span style="font-size: 14pt;" class="bbc_size"><strong>Language</strong></span></span></span><br /><hr />Is available in:<br /><ul class="bbc_list"><li>English</li><li>Latin Spanish</li></ul><br /><span id="post_compatibilidad"><span style="color: teal;" class="bbc_color"><span style="font-size: 14pt;" class="bbc_size"><strong>Compatibility</strong></span></span></span><br /><hr />Prepared to work with the branch 2.0.x of SMF, it is tested only with the default theme. if you have a custom theme, you should adapt by looking for a similar line.<br />+Now also works with SMF 2.1 with the default theme!<br /><br /><span id="post_compatibilidad"><span style="color: teal;" class="bbc_color"><span style="font-size: 14pt;" class="bbc_size"><strong>Support</strong></span></span></span><br /><hr />Support topic in English: <a href="https://www.simplemachines.org/community/index.php?topic=563207.0" class="bbc_link" target="_blank">Button to share Whatsapp and Telegram</a><br />Tema de soporte en Español: <a href="https://www.bombercode.net/foro/soporte-smf-en-espanol/boton-para-compartir-en-whatsapp-y-telegram/msg1681/#msg1681" class="bbc_link" target="_blank">Botón para compartir en Whatsapp y Telegram</a><br />GitHub Repository: <a href="https://github.com/RockLee-BC/Button_to_share_Whatsapp_and_Telegram/" class="bbc_link" target="_blank">Button_to_share_Whatsapp_and_Telegram</a><br /><br /><span id="post_ofertas"><span style="color: teal;" class="bbc_color"><span style="font-size: 14pt;" class="bbc_size"><strong>License</strong></span></span></span><br /><hr />Copyright 2014-2018 (c) Bomber Code<br /><br />Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:<br /><br />1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.<br /><br />2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.<br /><br />3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.<br /><br />THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.',
			file: 'Button to share.zip'
		},
		4196: {
			name: 'Mark All Topics Read on Logout 1.0',
			versions: ['91'],
			desc: 'This modification allows a member to select/deselect an option via &#039;Profile -&gt; Look and Layout&#039; to have all &#039;unread&#039; topics automatically marked as &#039;read&#039; when they logout.<br /><br /><span style="color: blue;" class="bbc_color"><strong><span style="font-size: 12pt;" class="bbc_size"><span class="bbc_u">License</span></span></strong></span><br />Copyright 2018 Kathy Leslie<br /><br />Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:<br /><br />1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.<br /><br />2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.<br /><br />THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.',
			file: 'Mark_All_Topics_Read_On_Logout_1.0.zip'
		},
		4195: {
			name: 'Embed DailyMotion Video 1.1',
			versions: ['91', '90'],
			desc: '<hr /><div align="center"><span style="color: red;" class="bbc_color"><span style="font-size: 16pt;" class="bbc_size"><strong>EMBED DAILYMOTION VIDEO BBCODE v1.1</strong></span></span><br /><a href="http://www.simplemachines.org/community/index.php?action=profile;u=253913" class="bbc_link" target="_blank"><strong>By Dougiefresh</strong></a> -&gt; <a href="http://custom.simplemachines.org/mods/index.php?mod=4151" class="bbc_link" target="_blank">Link to Mod</a><br /></div><hr /><br /><span style="color: blue;" class="bbc_color"><strong><span style="font-size: 12pt;" class="bbc_size"><span class="bbc_u">Introduction</span></span></strong></span><br />This modification adds a BBCode to view DailyMotion videos.<br /><br />The BBCode takes this form:<br /><div class="codeheader">Kod: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Zaznacz]</a></div><pre style="margin: 0; padding: 0;"><code class="bbc_code">[dailymotion width=x]{DailyMotion URL}[/dailymotion]<br /></code></pre><br /><span style="color: blue;" class="bbc_color"><strong><span style="font-size: 12pt;" class="bbc_size"><span class="bbc_u">Admin Settings</span></span></strong></span><br />There are a new setting on the <strong>Modifications Settings</strong> page:<br />o DailyMotion default width<br /><br /><span style="color: blue;" class="bbc_color"><strong><span style="font-size: 12pt;" class="bbc_size"><span class="bbc_u">Related Discussion</span></span></strong></span><br />o <a href="https://www.simplemachines.org/community/index.php?topic=531060.msg3935225#msg3935225" class="bbc_link" target="_blank">Request made in Yet Another YouTube BBCode Tag mod</a><br /><br /><span style="color: blue;" class="bbc_color"><strong><span style="font-size: 12pt;" class="bbc_size"><span class="bbc_u">Compatibility Notes</span></span></strong></span><br />This mod was tested on SMF 2.0.14, but should work on SMF 2.1 Beta 3, as well as SMF 2.0 and up.&nbsp; SMF 2.1 Beta 1 &amp; 2, as well as SMF 1.x, is not and will not be supported.<br /><br />This mod should be installed after <a href="https://www.tapatalk.com/download_SimpleMachines.php" class="bbc_link" target="_blank">Tapatalk mod</a>, if you want to use it with Tapatalk.<br /><br /><span style="color: blue;" class="bbc_color"><strong><span style="font-size: 12pt;" class="bbc_size"><span class="bbc_u">Changelog</span></span></strong></span><br />The changelog can be viewed at <a href="http://www.xptsp.com/board/free-modifications/embed-DailyMotion-bbcode/?tab=1" class="bbc_link" target="_blank">XPtsp.com</a>.<br /><br /><span style="color: blue;" class="bbc_color"><strong><span style="font-size: 12pt;" class="bbc_size"><span class="bbc_u">License</span></span></strong></span><br />Copyright (c) 2017 - 2018, Douglas Orend<br />All rights reserved.<br /><br />Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:<br /><br />1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.<br /><br />2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.<br /><br />THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br />',
			file: 'Embed_DailyMotion_BBCode_v1.1.zip'
		},
		2388: {
			name: 'SVG 1.0.0',
			versions: ['51'],
			desc: 'SVG<br />mod for SMF forums<br />by Xay Voong<br />v1.0.0<br /><br />PURPOSE: Allows BBC tags that create &lt;object&gt; elements around SVG URLs so that they can be interacted with.<br /><br />INSTRUCTIONS:<br />[svg]http://URL/to/image.svg[/svg]<br /><br />Changelog<br />v1.0.0<br />2010-01-17<br />$sourcesdir/Subs.php: modified to contain SVG tags<br />',
			file: 'SVG.zip'
		}	};
	var smf_latestModifications = [4197, 4196, 4195];
	
	window.smfLatestPackages = '\
		<div id="smfLatestPackagesWindow"style="overflow: auto;">\
			<h3 style="margin: 0; padding: 4px;">New Packages:</h3>\
			<img src="https://www.simplemachines.org/smf/images/package.png" width="102" height="98" style="float: right; margin: 4px;" alt="(package)" />\
			<ul style="list-style: none; margin-top: 3px; padding: 0 4px;">';
	
	for (var i = 0; i < smf_latestModifications.length; i++)
	{
		var id_mod = smf_latestModifications[i];
	
		window.smfLatestPackages += '<li><a href="javascript:smf_packagesMoreInfo(' + id_mod + ');void(0);">' + smf_modificationInfo[id_mod].name + '</a></li>';
	}
	
	window.smfLatestPackages += '\
			</ul>';
	
	if (typeof(window.smfVersion) != "undefined" && (window.smfVersion < "SMF 1.0.6" || (window.smfVersion == "SMF 1.1 RC2" && !in_array('smf:smf-1.0.7', window.smfInstalledPackages))))
		window.smfLatestPackages += '\
			<h3 class="error" style="margin: 0; padding: 4px;">Updates for SMF:</h3>\
			<div style="padding: 0 4px;">\
				<a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_1.0.7_1.1-RC2-1.tar.gz;' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">Security update (X-Forwarded-For header vulnerability)</a>\
			</div>';
	else
		window.smfLatestPackages += '\
			<h3 style="margin: 0; padding: 4px;">Package of the Moment:</h3>\
			<div style="padding: 0 4px;">\
				<a href="javascript:smf_packagesMoreInfo(2388);void(0);">SVG 1.0.0</a>\
			</div>';
	
	window.smfLatestPackages += '\
		</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;
}

function smf_packagesMoreInfo(id)
{
	window.smfLatestPackages_temp = document.getElementById("smfLatestPackagesWindow").innerHTML;

	setInnerHTML(document.getElementById("smfLatestPackagesWindow"),
	'\
		<h3 style="margin: 0; padding: 4px;">' + smf_modificationInfo[id].name + '</h3>\
		<h4 style="padding: 4px; margin: 0;"><a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/' + id + '/' + smf_modificationInfo[id].file + ';' + window.smfForum_sessionvar + '=' + window.smfForum_sessionid + '">Install Now!</a></h4>\
		<div style="margin: 4px;">' + smf_modificationInfo[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("smfLatestPackagesWindow"), window.smfLatestPackages_temp);
	window.scrollTo(0, findTop(document.getElementById("smfLatestPackagesWindow")) - 10);
}
