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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">forum</a> if you need more help.';
			break;
		case "SMF 2.0.15":
			window.smfLatestPackages = 'SMF 2.0.16 fixes some important security issues and adds support for the EU\'s General Data Protection Regulation (GDPR) requirements. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.16.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.16.<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?P=i5cf3p2pg7demvcub3rkconl2j&amp;">forum</a> if you need more help.';
			break;
		case "SMF 2.0.16":
			window.smfLatestPackages = 'SMF 2.0.17 fixes a bug introduced in 2.0.16 that could cause significant performance issues when retrieving RSS feeds, and fixes some annoying warning messages that could appear when using SSI.php. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.17.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.17.<br /><br />If you have any problems applying it, you can use the "Large upgrade" posted on the <a href="https://download.simplemachines.org/">Download</a> page - although, any modifications you have installed will need to be reinstalled. Please post on the <a href="https://www.simplemachines.org/community/index.php?P=i5cf3p2pg7demvcub3rkconl2j&amp;">forum</a> if you need more help.';
			break;
		case "SMF 2.0.17":
		window.smfLatestPackages = 'SMF 2.0.18 adds compatibility to PHP 7.4 version as well as fixes a few bugs in 2.0.17. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.18.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.18.<br /><br />If you have any problems applying it, you can use the "Large upgrade" posted on the <a href="https://download.simplemachines.org/">Download</a> page - although, any modifications you have installed will need to be reinstalled. Please post on the <a href="https://www.simplemachines.org/community/index.php?P=i5cf3p2pg7demvcub3rkconl2j&amp;">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 = {
	
		4284: {
			name: 'Disable Google FLoC Tracking 1.0',
			versions: ['97', '96'],
			desc: 'Mod Information:<br />For SMF 2.1.x and SMF 2.0.x <br /><br />Disables Google&#039;s new cookieless ad tracking system called FloC.<br /><br /><br />License: BSD',
			file: 'DisableFLoCTracking.zip'
		},
		4283: {
			name: 'Better Blink BBC v1.24 (2.0), v1.32 (2.1)',
			versions: ['97', '96'],
			desc: '<div align="center"><span style="font-size: 12pt;" class="bbc_size"><span style="color: red;" class="bbc_color"><strong>Better Blink BBC</strong></span></span><br />by <strong>aegersz</strong></div><hr /><br /><span style="color: navy;" class="bbc_color"><strong>Introduction</strong></span><br /><br />This version uses hooks, inline css and allows you to control the blink rate (per second(s)); it should work on all browsers.<br /><br />It has been tested and works for on 2.0.18 and 2.1 RC3.<br /><br /><span style="color: blue;" class="bbc_color">The SMF 2.1 version is v1.32</span><br /><br />It fades and blinks at a 2 second rate by default.<br /><span style="color: navy;" class="bbc_color"><strong><br />Usage</strong></span><br /><br />[blink]Text to blink[/blink] or [blink=5]Text to blink every 5 seconds[/blink] <br /><br /><span style="color: navy;" class="bbc_color"><strong>Installation</strong></span><br /><br />Remember to uninstall any other blink BBC mods or disable any added via the Custom BBCodes Manager mod if you use it.<br /><br /><span style="color: navy;" class="bbc_color"><strong>Credits</strong></span><br /><br />Note: the &quot;blink.gif&quot; button image is borrowed from the defunct blinkbbc_1-0 mod<br />and is renamed to &quot;blink.png&quot; for SMF 2.1 compatibility (it won&#039;t blink). However, the gif image is still valid for SMF 2.0.* and will blink.<br /><br /><span style="color: navy;" class="bbc_color"><strong>Changelog</strong></span><br /><br />v1.32 (2014-04-28)<br />Change blink rate to &quot;n&quot; via &quot;Blink=n&quot; option<br /><br />v1.31 (2021-05-03)<br />Use span instead of div to allow mixed usage on a single line and restructure the install/uninstall<br /><br />v1.30 (2021-04-27)<br /><strong>For SMF 2.1 only</strong> (use the alternate zip file)<br /><br /><hr /><br />v1.24 (2014-04-28)<br />Change blink rate to &quot;n&quot; via &quot;Blink=n&quot; option<br /><br />v1.23 (2021-05-03)<br />Use span instead of div to allow mixed usage on a single line<br /><br />v1.22 (2021-04-27)<br />Implemented more of the customization&#039;s team&#039;s advice. <strong>For SMF 2.0.*</strong> but can be installed<br />in <span style="color: navy;" class="bbc_color">SMF 2.1&#039;s 2.0.14 Emulation mode</span><br /><br />v1.21 (2021-04-27)<br />Prevent errors in validation as per customization&#039;s team&#039;s advice<br /><br />v1.2 (2021-04-20<br />Use hooks instead<br /><br />v1.0 (2021-04-20)<br />* Initial release<br />',
			file: 'Blink_v1.32.zip'
		},
		4282: {
			name: 'Staff and User Menus 1.0',
			versions: ['97'],
			desc: 'This will add 2 new menu items<br />Staff Menu<br />User Menu<br /><br />it will move the admin and moderator menus into the new Staff Menu<br />it will move the profile and my messages menus into the new User Menu<br /><br />this only modifies subs.php, so backup Sources/Subs.php before installing just in case <img src="https://static.simplemachinesweb.com/smf/smileys/default/smiley.gif" alt="&#58;&#41;" title="Smiley" class="smiley" /><br />and adds 2 lines to Modifications.english.php and Modifications.english-utf8.php (if you have them)<br /><br />to translate<br /><div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><pre style="margin: 0; padding: 0;"><code class="bbc_code">$txt&#91;&#039;staff_menu&#039;] = &#039;Staff Menu&#039;;<br />$txt&#91;&#039;user_menu&#039;] = &#039;User Menu&#039;;</code></pre><br />The staff menu will only show to those who have permission to view the moderation center<br />The user menu will only show to those who have permission to edit their profiles<br /><br />thanks to vbgamer for bring up a point about the user menu<br />I had just used if allowed to edit profile then show the menu but should also add if allowed pm to show the menu<br /><br />so changed the show in to an array<br /><div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><pre style="margin: 0; padding: 0;"><code class="bbc_code">&#039;show&#039; =&gt; allowedTo(array(&#039;allow_edit_profile&#039;, &#039;allow_pm&#039;)),</code></pre>this way also if you add other menus into the the user menu you can add it&#039;s show setting into the array',
			file: 'Staff_and_User_Menus.zip'
		},
		127: {
			name: 'KarmaLog 1.0.2',
			versions: ['12', '13', '14', '15'],
			desc: 'The mod will add a log of all Karma actions (applaud and smite) and KEEP that log (unlike the standard SMF karma log, which is erased and replaced)<br />It adds an admin function &quot;View Karma Log&quot; down in the maintainence menu of the admin section.<br /><br />This is version 1.0.1 of the mod. <br />Basic display of the log in the admin section.<br /><br />v1.0.1 should install under SMF 1.03, 1.04 and 1.1...<br />v1.0.2 is updated to install with SMF 1.0.5 (no changes to the mod itself)',
			file: 'KarmaLogv1.0.2.zip'
		}	};
	var smf_latestModifications = [4284, 4283, 4282];
	
	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 + 'https://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(127);void(0);">KarmaLog 1.0.2</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 + 'https://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);
}
