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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&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=dj17kusrar8q5e58mn6eo383f2&amp;">forum</a> if you need more help.';
			break;
		case "SMF 2.0.17":
		window.smfLatestPackages = 'SMF 2.0.18 adds compatibility for 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=dj17kusrar8q5e58mn6eo383f2&amp;">forum</a> if you need more help.';
		break;
		case "SMF 2.0.18":
		window.smfLatestPackages = 'SMF 2.0.19 includes security updates and several bug fixes. You can install <a href="' + window.smfForum_scripturl + actionurl + 'http://custom.simplemachines.org/mods/downloads/smf_patch_2.0.19.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.19.<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=dj17kusrar8q5e58mn6eo383f2&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 = {
	
		4346: {
			name: 'Info Center Manager 1.0b3',
			versions: ['102'],
			desc: '<span style="font-size: 1.45em;" class="bbc_size">Info Center Manager</span><br><br>This modification allows you to configure the following aspects of the &quot;Info Center&quot; display:<br><ul class="bbc_list"><li>The &quot;Users Online&quot; section can now be hidden, while still showing the &quot;Recent Posts&quot; section</li><li>In the &quot;Recent Posts&quot; section, the display can now be restricted to the latest post per topic only. This prevents posts in very active topics from &quot;flooding&quot; the &quot;Recent Posts&quot; section and permits recent posts from other topics to be shown as well.</li></ul><br>The mod has its own configuration page in the mod settings section of the admin panel.<br><br>Current localizations:<br><ul class="bbc_list"><li>English</li><li>German</li><li>Spanish (thanks to -Rock Lee-)</li></ul><br><b>Version history:</b><br><ul class="bbc_list"><li>2022-10-24: 1.0b3 (translation to Spanish)</li><li>2022-10-24: 1.0b2 (for SMF 2.1.2)</li></ul><hr>Released under GPL-3.0-or-later.',
			file: 'InfoCenterMgr-1.0b3.zip'
		},
		4345: {
			name: 'NotifyBoardReply 1.0b6',
			versions: ['102'],
			desc: '<span style="font-size: 1.45em;" class="bbc_size">Notify Board Subscribers Of New Replies</span><br><br>This modification enhances topic and reply notifications as follows:<br><br><b>Members who have subscribed to a board will not only be notified if a new topic has been created (the standard behavior), but will automatically receive notifications of new replies in the topic as well.</b><br><br>This means that members no longer need to actively opt-in to follow each new topic. Of course, they can still opt-out of replies at any time via the usual methods (i.e. unfollow the topic in the forum or via the link in the notification email).<br><br>This adds convenience for casual or new members who might be interested in a topic but forget to enable notifications for new replies (or are not aware of the need to do so).<br><br>The modification can be configured to operate on selected boards only. Please visit the mod&#39;s configuration panel in the admin interface to review and change the currently enabled boards.<br><br>Current localizations: English, German, Spanish (thanks to -Rock Lee-)<br><br><b>Version history:</b><br><ul class="bbc_list"><li>21-Oct-2022: 1.0b6 (added Spanish translations by -Rock Lee-)</li><li>16-Oct-2022: 1.0b5 (for SMF 2.1.2)</li></ul><hr>Released under GPL-3.0-or-later.',
			file: 'NotifyBoardReply-1.0b6.zip'
		},
		4344: {
			name: 'Remixed Breadcrumbs 2.0',
			versions: ['102'],
			desc: '<span style="font-size: x-large;" class="bbc_size"><b>Remixed Breadcrumbs</b></span><br><br>A modification for Simple Machines Forum 2.1 that changes the layout of the Breadcrumbs (linktree) in Curve2 to a fancier display.<br><br>This modification is created from the &quot;Remixed Breadcrumbs&quot; Tips&amp;Tricks topic: <a href="https://www.simplemachines.org/community/index.php?P=dj17kusrar8q5e58mn6eo383f2&amp;topic=580159.0" class="bbc_link" target="_blank" rel="noopener">https://www.simplemachines.org/community/index.php?topic=580159.0</a> by TwitchisMental<br><br><span style="font-size: large;" class="bbc_size"><b>Settings</b></span><br><br>There are no settings for this mod. <br><br>The layout and colors are based on the Curve2 theme and is using the new css file: RemixedBreadcrumbs.css: the mod can also update other themes if these are curve2 variations. If needed a copy of the RemixedBreadcrumbs.css can be placed in the other theme css folder and adapted to suit the specific theme color requirements.<br><br><span style="font-size: large;" class="bbc_size"><b>License</b></span><br><br>Remixed Breadcrumbs is released under the MIT License. A full copy of this license is included in the package file.<br><br><br><span style="font-size: large;" class="bbc_size"><b>Changelog</b></span><br><br>Version 1.0:<br><ul class="bbc_list"><li>Initial release</li></ul>',
			file: 'RemixedBreadcrumbs v2.0.zip'
		},
		1137: {
			name: 'Contact Form 1.1',
			versions: ['33', '36'],
			desc: 'Adds a contact form to your forum. Places a contact menu item after register shown only to guests.<br /><br />Visual verification is used if &quot;Require verification on registration page&quot; is checked on the Anti-Spam admin page.',
			file: 'contactform_1.1.zip'
		}	};
	var smf_latestModifications = [4346, 4345, 4344];
	
	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(1137);void(0);">Contact Form 1.1</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);
}
