// First we will define our messages we want displayed for our different types of license popups
var popUpIPBanning = 'Your current Grupthink plan does not include IP banning, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpThresholdEditing = 'Your current Grupthink plan does not include this functionality. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpVotingReports = 'Your current Grupthink plan does not include voting reports, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpCommentReports = 'Your current Grupthink plan does not include comment reports, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpCustomCSS = 'Your current Grupthink plan does not support custom CSS, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpAnalytics = 'Your current Grupthink plan does not include this functionality, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpGrups = 'Your current Grupthink plan does not include this functionality, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpAdvancedInvitations = 'Your current Grupthink plan does not include this functionality, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpOurAdvertisements = 'Your current Grupthink plan does not include this functionality, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpClassEditing = 'Your current Grupthink plan does not include this functionality, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpCustomContent = 'Your current Grupthink plan does not support Page Add-ins, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpCustomPages = 'Your current Grupthink plan does not support custom pages, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpRemoteAuthentication = 'Your current Grupthink plan does not support Remote Authentication, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpTopicLimit = 'Your curent Grupthink plan has reached its maximum number of topics. To increase the limit, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>, or remove unwanted topics to make space for new topics.';

var popUpGrupLimit = 'Your current Grupthink plan has reached the maximum number of allowed member groups. To increase the limit now, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpMassAnnouncement = 'Your current Grupthink plan does not support the mass announcement tool, but it may be available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>';

var popUpGrupCreationDisabled = 'Sorry, your user account does not allow you to create Grups.  Please contact your site administrator for additional information.';

var popUpDefault = 'This feature is available to you as an upgrade. To enable this feature today, you can <a href="http://grupthinkpowered.com/pricing/">upgrade your current Grupthink plan</a>.';

var popUpHeader = '<h3>Upgrade your account</h3>';

var popUpFooter = '<div style="width:100%; text-align:center;">' +
                  '<h3><a href="http://grupthinkpowered.com/pricing/">Learn more...</a></h3><br />' +
                  '<span class=small><a href="#" onclick="closefull(); return false">[X] Close this window</a></span>' +
				  '</div>';

// Here is our function that will pop up our license notification
function toggleLicense(licenseName)
{
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();

	fullBoxID = 'fulllicensebox'
	
	licenseBox = document.getElementById(fullBoxID);
	licenseBox.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 500) / 2) + 'px');
	licenseBox.left = (((arrayPageSize[0] - 600) / 2) + 'px');

	// Bug in IE6 where dropdown boxes show through
	var dropDowns = document.getElementsByTagName('select');
	for (var ii = 0; ii < dropDowns.length; ii++)
	{
		if (dropDowns[ii].style.display == 'none')
		{
			dropDowns[ii].style.display = '';
		}
		else
		{
			dropDowns[ii].style.display = 'none';
		}
	}

	switch (licenseName)
	{
		case 'ipBanning':
			var fullBoxInnerHTML = popUpIPBanning;
		break;

		case 'thresholdEditing':
			var fullBoxInnerHTML = popUpThresholdEditing;
		break;

		case 'votingReports':
			var fullBoxInnerHTML = popUpVotingReports;
		break;

		case 'commentReports':
			var fullBoxInnerHTML = popUpCommentReports;
		break;

		case 'customCSS':
			var fullBoxInnerHTML = popUpCustomCSS;
		break;

		case 'analytics':
			var fullBoxInnerHTML = popUpAnalytics;
		break;

		case 'grups':
			var fullBoxInnerHTML = popUpGrups;
		break;

		case 'advancedInvitations':
			var fullBoxInnerHTML = popUpAdvancedInvitations;
		break;

		case 'ourAdvertisements':
			var fullBoxInnerHTML = popUpOurAdvertisements;
		break;

		case 'classEditing':
			var fullBoxInnerHTML = popUpClassEditing;
		break;

		case 'customContent':
			var fullBoxInnerHTML = popUpCustomContent;
		break;

		case 'customPages':
			var fullBoxInnerHTML = popUpCustomPages;
		break;

		case 'remoteAuthentication':
			var fullBoxInnerHTML = popUpRemoteAuthentication;
		break;

		case 'grupLimit':
			var fullBoxInnerHTML = popUpGrupLimit;
		break;

		case 'topicLimit':
			var fullBoxInnerHTML = popUpTopicLimit;
		break;

		case 'massAnnouncement':
			var fullBoxInnerHTML = popUpMassAnnouncement;
		break;
		
		case 'grupCreationDisabled':
			popUpHeader = '<h3>Grup Creation Disabled</h3>';
			popUpFooter = '<div style="width:100%; text-align:center;"><br />' +
                          '<span class=small><a href="#" onclick="closefull(); return false">[X] Close this window</a></span>' +
			 			  '</div>';
			var fullBoxInnerHTML = popUpGrupCreationDisabled;
		break;

		default:
			var fullBoxInnerHTML = popUpDefault;
	}

	var fullBoxInnerHTML = popUpHeader+fullBoxInnerHTML+popUpFooter;
	
	licenseBox.innerHTML = fullBoxInnerHTML;

	toggleme(fullBoxID);

}

