function setAvailabilitySpecial(which)
{
	if(!document.getElementById('div_linux') || ! document.getElementById('div_windows2003') || !document.getElementById('div_windows2008')) return;
	switch(which)
	{
		case 1:
			document.getElementById('div_linux').style.visibility = 'visible';
			document.getElementById('div_linux').style.display = '';
			document.getElementById('div_windows2003').style.visibility = 'hidden';
			document.getElementById('div_windows2003').style.display = 'none';
			document.getElementById('div_windows2008').style.visibility = 'hidden';
			document.getElementById('div_windows2008').style.display = 'none';
			
			document.getElementById('TAG_Windows_Span').innerHTML= 'Linux';
			break;
		case 2:
			document.getElementById('div_linux').style.visibility = 'hidden';
			document.getElementById('div_linux').style.display = 'none';
			document.getElementById('div_windows2003').style.visibility = 'visible';
			document.getElementById('div_windows2003').style.display = '';
			document.getElementById('div_windows2008').style.visibility = 'hidden';
			document.getElementById('div_windows2008').style.display = 'none';
			
			document.getElementById('TAG_Windows_Span').innerHTML= 'Windows 2003';
			break;
		case 3:
			document.getElementById('div_linux').style.visibility = 'hidden';
			document.getElementById('div_linux').style.display = 'none';
			document.getElementById('div_windows2003').style.visibility = 'hidden';
			document.getElementById('div_windows2003').style.display = 'none';
			document.getElementById('div_windows2008').style.visibility = 'visible';
			document.getElementById('div_windows2008').style.display = '';
			
			document.getElementById('TAG_Windows_Span').innerHTML= 'Windows 2008';
			break;
	}
}
/* Order is:
 * from left to right
 * NJ, LA, DA, MI, UK
 * for all plans.
 * 1 - Available
 * 2 - Not available
 */
var Availability2003 = new Array(1, 1, 0, 0, 0);
var Availability2008 = new Array(1, 1, 0, 0, 0);
var AvailabilityLinux = new Array(1, 1, 0, 0, 0);

function getPriceWinVPS()
{
	var StoreLink = 'https://control.solarvps.com/hspc/plans.php?series_key=';
	var StoreLinkPA = 'https://store.solarvps.com/index.php?redirect=';
	var Prices = new Array('$40.00', '$40.00', '$40.00', '$40.00', '$48.00', '$48.00', '$48.00', '$48.00', '$56.00', '$56.00', '$56.00', '$56.00');
	var Promo = new Array('$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00');
	var Links = new Array(
			//New Jersey, 		Los Angeles, 		Dallas, 			Miami, 				UK
			//1					2					3					4					5
			'', '', '', '', '',
			'', '', '', '', '',
			StoreLink + '8314', StoreLink + '8306', StoreLink + '8296', StoreLink + '8320', StoreLink + '8320',	//Windows 2003, No Plesk
			StoreLink + '8646', StoreLink + '8606', StoreLink + '8587', StoreLink + '8625', StoreLink + '8625',	//Windows 2003, Plesk
			
			StoreLink + '7934', StoreLink + '7935', StoreLink + '7930', '', StoreLink + '7936',	//Windows 2008, No Plesk
			StoreLink + '7974', StoreLink + '7971', StoreLink + '7964', '', StoreLink + '7977',	//Windows 2008, Plesk
			StoreLink + '8328', StoreLink + '8356', StoreLink + '8354', StoreLink + '8352', StoreLink + '8352',	//Windows 2003, No Plesk
			StoreLink + '8644', StoreLink + '8604', StoreLink + '8349', StoreLink + '8624', StoreLink + '8624',	//Windows 2003, Plesk
			
			StoreLink + '7940', StoreLink + '7941', StoreLink + '7937', '', StoreLink + '7943',	//Windows 2008, No Plesk
			'#', 				StoreLink + '8031', StoreLink + '8027', '', StoreLink + '8033',	//Windows 2008, Plesk
			StoreLink + '8376', StoreLink + '8374', StoreLink + '8363', StoreLink + '8372', StoreLink + '8372',	//Windows 2003, No Plesk
			StoreLink + '8647', StoreLink + '8607', StoreLink + '8591', StoreLink + '8626', StoreLink + '8626'	//Windows 2003, Plesk
			);
	//Os 1 - 2008; 2 - 2003
	//Plesk 1 - no; 2 - yes
	switch(Product)
	{
		case '1':
			if((Os == 1) && (CPanel == 1))
			{
				document.getElementById('Price_Span').innerHTML = Prices[0];
				document.getElementById('Promo_Span').innerHTML = Promo[0];
				if (Location == 1) document.getElementById('Price_a').href = Links[0];
				if (Location == 2) document.getElementById('Price_a').href = Links[1];
				if (Location == 3) document.getElementById('Price_a').href = Links[2];
				if (Location == 4) document.getElementById('Price_a').href = Links[3];
				if (Location == 5) document.getElementById('Price_a').href = Links[4];
			}
			if((Os == 1) && (CPanel == 2))
			{
				document.getElementById('Price_Span').innerHTML = Prices[1];
				document.getElementById('Promo_Span').innerHTML = Promo[1];
				if (Location == 1) document.getElementById('Price_a').href = Links[5];
				if (Location == 2) document.getElementById('Price_a').href = Links[6];
				if (Location == 3) document.getElementById('Price_a').href = Links[7];
				if (Location == 4) document.getElementById('Price_a').href = Links[8];
				if (Location == 5) document.getElementById('Price_a').href = Links[9];
			}
			if((Os == 2) && (CPanel == 1))
			{
				document.getElementById('Price_Span').innerHTML = Prices[2];
				document.getElementById('Promo_Span').innerHTML = Promo[2];
				if (Location == 1) document.getElementById('Price_a').href = Links[10];
				if (Location == 2) document.getElementById('Price_a').href = Links[11];
				if (Location == 3) document.getElementById('Price_a').href = Links[12];
				if (Location == 4) document.getElementById('Price_a').href = Links[13];
				if (Location == 5) document.getElementById('Price_a').href = Links[14];
			}
			if((Os == 2) && (CPanel == 2))
			{
				document.getElementById('Price_Span').innerHTML = Prices[3];
				document.getElementById('Promo_Span').innerHTML = Promo[3];
				if (Location == 1) document.getElementById('Price_a').href = Links[15];
				if (Location == 2) document.getElementById('Price_a').href = Links[16];
				if (Location == 3) document.getElementById('Price_a').href = Links[17];
				if (Location == 4) document.getElementById('Price_a').href = Links[18];
				if (Location == 5) document.getElementById('Price_a').href = Links[19];
			}
			break;
		case '2':
			if((Os == 1) && (CPanel == 1))
			{
				document.getElementById('Price_Span').innerHTML = Prices[4];
				document.getElementById('Promo_Span').innerHTML = Promo[4];
				if (Location == 1) document.getElementById('Price_a').href = Links[20];
				if (Location == 2) document.getElementById('Price_a').href = Links[21];
				if (Location == 3) document.getElementById('Price_a').href = Links[22];
				if (Location == 4) document.getElementById('Price_a').href = Links[23];
				if (Location == 5) document.getElementById('Price_a').href = Links[24];
			}
			if((Os == 1) && (CPanel == 2))
			{
				document.getElementById('Price_Span').innerHTML = Prices[5];
				document.getElementById('Promo_Span').innerHTML = Promo[5];
				if (Location == 1) document.getElementById('Price_a').href = Links[25];
				if (Location == 2) document.getElementById('Price_a').href = Links[26];
				if (Location == 3) document.getElementById('Price_a').href = Links[27];
				if (Location == 4) document.getElementById('Price_a').href = Links[28];
				if (Location == 5) document.getElementById('Price_a').href = Links[29];
			}
			if((Os == 2) && (CPanel == 1))
			{
				document.getElementById('Price_Span').innerHTML = Prices[6];
				document.getElementById('Promo_Span').innerHTML = Promo[6];
				if (Location == 1) document.getElementById('Price_a').href = Links[30];
				if (Location == 2) document.getElementById('Price_a').href = Links[31];
				if (Location == 3) document.getElementById('Price_a').href = Links[32];
				if (Location == 4) document.getElementById('Price_a').href = Links[33];
				if (Location == 5) document.getElementById('Price_a').href = Links[34];
			}
			if((Os == 2) && (CPanel == 2))
			{
				document.getElementById('Price_Span').innerHTML = Prices[7];
				document.getElementById('Promo_Span').innerHTML = Promo[7];
				if (Location == 1) document.getElementById('Price_a').href = Links[35];
				if (Location == 2) document.getElementById('Price_a').href = Links[36];
				if (Location == 3) document.getElementById('Price_a').href = Links[37];
				if (Location == 4) document.getElementById('Price_a').href = Links[38];
				if (Location == 5) document.getElementById('Price_a').href = Links[39];
			}
			break;
		case '3':
			if((Os == 1) && (CPanel == 1))
			{
				document.getElementById('Price_Span').innerHTML = Prices[8];
				document.getElementById('Promo_Span').innerHTML = Promo[8];
				if (Location == 1) document.getElementById('Price_a').href = Links[40];
				if (Location == 2) document.getElementById('Price_a').href = Links[41];
				if (Location == 3) document.getElementById('Price_a').href = Links[42];
				if (Location == 4) document.getElementById('Price_a').href = Links[43];
				if (Location == 5) document.getElementById('Price_a').href = Links[44];
			}
			if((Os == 1) && (CPanel == 2))
			{
				document.getElementById('Price_Span').innerHTML = Prices[9];
				document.getElementById('Promo_Span').innerHTML = Promo[9];
				if (Location == 1) document.getElementById('Price_a').href = Links[45];
				if (Location == 2) document.getElementById('Price_a').href = Links[46];
				if (Location == 3) document.getElementById('Price_a').href = Links[47];
				if (Location == 4) document.getElementById('Price_a').href = Links[48];
				if (Location == 5) document.getElementById('Price_a').href = Links[49];
			}
			if((Os == 2) && (CPanel == 1))
			{
				document.getElementById('Price_Span').innerHTML = Prices[10];
				document.getElementById('Promo_Span').innerHTML = Promo[10];
				if (Location == 1) document.getElementById('Price_a').href = Links[50];
				if (Location == 2) document.getElementById('Price_a').href = Links[51];
				if (Location == 3) document.getElementById('Price_a').href = Links[52];
				if (Location == 4) document.getElementById('Price_a').href = Links[53];
				if (Location == 5) document.getElementById('Price_a').href = Links[54];
			}
			if((Os == 2) && (CPanel == 2))
			{
				document.getElementById('Price_Span').innerHTML = Prices[11];
				document.getElementById('Promo_Span').innerHTML = Promo[11];
				if (Location == 1) document.getElementById('Price_a').href = Links[55];
				if (Location == 2) document.getElementById('Price_a').href = Links[56];
				if (Location == 3) document.getElementById('Price_a').href = Links[57];
				if (Location == 4) document.getElementById('Price_a').href = Links[58];
				if (Location == 5) document.getElementById('Price_a').href = Links[59];
			}
			break;
		default:
			break;
	}
}

function getPriceLinVPS()
{
	var StoreLink = 'https://store.solarvps.com/index.php?redirect=';
	var StoreLinkHSPc = 'https://control.solarvps.com/hspc/plans.php?series_key=';
	var Prices = new Array('$34.00', '$34.00', '0', '0', '$42.00', '$42.00', '0', '0', '$50.00', '$50.00', '0', '0');
	var Promo = new Array('$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '$1.00', '0', '0', '$1.00', '$1.00', '0', '0');
	var Links = new Array(
			//1	2			3						4				5
			StoreLinkHSPc + '8699', StoreLinkHSPc + '8743', StoreLink + 'SOLAR_MICRO_CPANEL_TX_MO', StoreLink + 'SOLAR_MICRO_CPANEL_MIA_MO', 'a',
			StoreLinkHSPc + '8664', StoreLinkHSPc + '8729', StoreLink + 'SOLAR_MICRO_PLESK_TX_MO', StoreLink + 'SOLAR_MICRO_PLESK_MIA_MO', 'a',
			'a', StoreLink + '', StoreLink + '', StoreLink + '', 'a',
			'a', StoreLink + '', StoreLink + '', StoreLink + '', 'a',
			
			StoreLinkHSPc + '8696', StoreLinkHSPc + '8744', StoreLink + 'SOLAR_NANO_CPANEL_TX_MO', StoreLink + 'SOLAR_NANO_CPANEL_MIA_MO', 'a',
			StoreLinkHSPc + '8680', StoreLinkHSPc + '8731', StoreLink + 'SOLAR_NANO_PLESK_TX_MO', StoreLink + 'SOLAR_NANO_PLESK_MIA_MO', 'a',
			'a', StoreLink + '', StoreLink + '', StoreLink + '', 'a',
			'a', StoreLink + '', StoreLink + '', StoreLink + '', 'a',
			
			StoreLinkHSPc + '8705', StoreLinkHSPc + '8746', StoreLink + 'SOLAR_PICO_CPANEL_TX_MO', StoreLink + 'SOLAR_PICO_CPANEL_MIA_MO', 'a',
			StoreLinkHSPc + '8682', StoreLinkHSPc + '8732', StoreLink + 'SOLAR_PICO_PLESK_TX_MO', StoreLink + 'SOLAR_PICO_PLESK_MIA_MO', 'a',
			'a', StoreLink + '', StoreLink + '', StoreLink + '', 'a',
			'a', StoreLink + '', StoreLink + '', StoreLink + '', 'a'
			);
	//Os 1 - 2008; 2 - 2003
	//CPanel - 1; Plesk - 2
	/* Locations:
	 * 1 - New Jersey
	 * 2 - LA
	 * 3 - Dallas
	 * 4 - Miami
	 * 5 - London
	 */
	
	switch(Product)
	{
		case '1':
			document.getElementById('Price_Span').innerHTML = Prices[0];
			document.getElementById('Promo_Span').innerHTML = Promo[0];
			break;
		case '2':
			document.getElementById('Price_Span').innerHTML = Prices[4];
			document.getElementById('Promo_Span').innerHTML = Promo[4];
			break;
		case '3':
			document.getElementById('Price_Span').innerHTML = Prices[8];
			document.getElementById('Promo_Span').innerHTML = Promo[8];
			break;
	}
	
	switch(Product)
	{
		case '1':
			if((Os == 1) && (CPanel == 1))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[0];
				//document.getElementById('Promo_Span').innerHTML = Promo[0];
				if (Location == 1) document.getElementById('Price_a').href = Links[0];
				if (Location == 2) document.getElementById('Price_a').href = Links[1];
				if (Location == 3) document.getElementById('Price_a').href = Links[2];
				if (Location == 4) document.getElementById('Price_a').href = Links[3];
				if (Location == 5) document.getElementById('Price_a').href = Links[4];
			}
			if((Os == 1) && (CPanel == 2))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[1];
				//document.getElementById('Promo_Span').innerHTML = Promo[1];
				if (Location == 1) document.getElementById('Price_a').href = Links[5];
				if (Location == 2) document.getElementById('Price_a').href = Links[6];
				if (Location == 3) document.getElementById('Price_a').href = Links[7];
				if (Location == 4) document.getElementById('Price_a').href = Links[8];
				if (Location == 5) document.getElementById('Price_a').href = Links[9];
			}
			if((Os == 2) && (CPanel == 1))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[2];
				//document.getElementById('Promo_Span').innerHTML = Promo[2];
				if (Location == 1) document.getElementById('Price_a').href = Links[10];
				if (Location == 2) document.getElementById('Price_a').href = Links[11];
				if (Location == 3) document.getElementById('Price_a').href = Links[12];
				if (Location == 4) document.getElementById('Price_a').href = Links[13];
				if (Location == 5) document.getElementById('Price_a').href = Links[14];
			}
			if((Os == 2) && (CPanel == 2))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[3];
				//document.getElementById('Promo_Span').innerHTML = Promo[3];
				if (Location == 1) document.getElementById('Price_a').href = Links[15];
				if (Location == 2) document.getElementById('Price_a').href = Links[16];
				if (Location == 3) document.getElementById('Price_a').href = Links[17];
				if (Location == 4) document.getElementById('Price_a').href = Links[18];
				if (Location == 5) document.getElementById('Price_a').href = Links[19];
			}
			break;
		case '2':
			if((Os == 1) && (CPanel == 1))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[4];
				//document.getElementById('Promo_Span').innerHTML = Promo[4];
				if (Location == 1) document.getElementById('Price_a').href = Links[20];
				if (Location == 2) document.getElementById('Price_a').href = Links[21];
				if (Location == 3) document.getElementById('Price_a').href = Links[22];
				if (Location == 4) document.getElementById('Price_a').href = Links[23];
				if (Location == 5) document.getElementById('Price_a').href = Links[24];
			}
			if((Os == 1) && (CPanel == 2))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[5];
				//document.getElementById('Promo_Span').innerHTML = Promo[5];
				if (Location == 1) document.getElementById('Price_a').href = Links[25];
				if (Location == 2) document.getElementById('Price_a').href = Links[26];
				if (Location == 3) document.getElementById('Price_a').href = Links[27];
				if (Location == 4) document.getElementById('Price_a').href = Links[28];
				if (Location == 5) document.getElementById('Price_a').href = Links[29];
			}
			if((Os == 2) && (CPanel == 1))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[6];
				//document.getElementById('Promo_Span').innerHTML = Promo[6];
				if (Location == 1) document.getElementById('Price_a').href = Links[30];
				if (Location == 2) document.getElementById('Price_a').href = Links[31];
				if (Location == 3) document.getElementById('Price_a').href = Links[32];
				if (Location == 4) document.getElementById('Price_a').href = Links[33];
				if (Location == 5) document.getElementById('Price_a').href = Links[34];
			}
			if((Os == 2) && (CPanel == 2))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[7];
				//document.getElementById('Promo_Span').innerHTML = Promo[7];
				if (Location == 1) document.getElementById('Price_a').href = Links[35];
				if (Location == 2) document.getElementById('Price_a').href = Links[36];
				if (Location == 3) document.getElementById('Price_a').href = Links[37];
				if (Location == 4) document.getElementById('Price_a').href = Links[38];
				if (Location == 5) document.getElementById('Price_a').href = Links[39];
			}
			break;
		case '3':
			if((Os == 1) && (CPanel == 1))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[8];
				//document.getElementById('Promo_Span').innerHTML = Promo[8];
				if (Location == 1) document.getElementById('Price_a').href = Links[40];
				if (Location == 2) document.getElementById('Price_a').href = Links[41];
				if (Location == 3) document.getElementById('Price_a').href = Links[42];
				if (Location == 4) document.getElementById('Price_a').href = Links[43];
				if (Location == 5) document.getElementById('Price_a').href = Links[44];
			}
			if((Os == 1) && (CPanel == 2))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[9];
				//document.getElementById('Promo_Span').innerHTML = Promo[9];
				if (Location == 1) document.getElementById('Price_a').href = Links[45];
				if (Location == 2) document.getElementById('Price_a').href = Links[46];
				if (Location == 3) document.getElementById('Price_a').href = Links[47];
				if (Location == 4) document.getElementById('Price_a').href = Links[48];
				if (Location == 5) document.getElementById('Price_a').href = Links[49];
			}
			if((Os == 2) && (CPanel == 1))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[10];
				//document.getElementById('Promo_Span').innerHTML = Promo[10];
				if (Location == 1) document.getElementById('Price_a').href = Links[50];
				if (Location == 2) document.getElementById('Price_a').href = Links[51];
				if (Location == 3) document.getElementById('Price_a').href = Links[52];
				if (Location == 4) document.getElementById('Price_a').href = Links[53];
				if (Location == 5) document.getElementById('Price_a').href = Links[54];
			}
			if((Os == 2) && (CPanel == 2))
			{
				//document.getElementById('Price_Span').innerHTML = Prices[11];
				//document.getElementById('Promo_Span').innerHTML = Promo[11];
				if (Location == 1) document.getElementById('Price_a').href = Links[55];
				if (Location == 2) document.getElementById('Price_a').href = Links[56];
				if (Location == 3) document.getElementById('Price_a').href = Links[57];
				if (Location == 4) document.getElementById('Price_a').href = Links[58];
				if (Location == 5) document.getElementById('Price_a').href = Links[59];
			}
			break;
		default:
			break;
	}
}

function createAvailability(Availability)
{
	var elSelLocation = document.getElementById('Location');
	for (i = elSelLocation.length - 1; i >= 0; i--) {
		elSelLocation.remove(i);
	}
	
	for(i = 0; i < Availability.length; i++)
	{
		var value;
		var text;
		
		switch(i)
		{
		case 0:
			value = 1;
			text = 'Clifton, New Jersey';
			break;
		case 1:
			value = 2;
			text = 'Los Angeles, California';
			break;
		case 2:
			value = 3;
			text = 'Dallas, Texas';
			break;
		case 3:
			value = 4;
			text = 'Miami, Florida';
			break;
		case 4:
			value = 5;
			text = 'London, United Kingdom';
			break;
		}
		
		var elOptNew = document.createElement('option');
		elOptNew.text = text;
		elOptNew.value = value;

		try {
			elSelLocation.add(elOptNew, null); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			elSelLocation.add(elOptNew, 0); // IE only
		}
	}
	
	for(i = 0; i < Availability.length; i++)
	{
		if (Availability[i] == 0)
		{
			elSelLocation.options[i].disabled = true;
		}
		else if (Availability[i] == 1)
		{
			elSelLocation.options[i].disabled = false;
		}
	}
	
	for(i = 0; i < Availability.length; i++)
	{
		if (Availability[i] == 1)
		{
			elSelLocation.options[i].selected = true;
			break;
		}
	}
}

function setProduct(value, page)
{
	Product = value;
	if (page == 1) getPriceWinVPS();
	if (page == 2) getPriceLinVPS();
}

function changeOs(value, page)
{
	Os = value;
	
//	if ((page == '1' && Os == '1') || (page == '1' && Os == '2' && Product == '1')/*&& Product == '1' && Os == '1'*/)
//	{
//		var elSel = document.getElementById('CPanel');
//		elSel.options[0].innerHTML = 'No control panel option available';
//		elSel.remove(1);
//	}
//	else if (page == '1')*/
//	{
		var elSel = document.getElementById('CPanel');
		elSel.options[0].innerHTML = 'No Panel';
		
		/*var elOptNew = document.createElement('option');
		elOptNew.text = 'Plesk';
		elOptNew.value = '2';

		try {
			elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			elSel.add(elOptNew); // IE only
		}*/
//	}
	
	if (page == '1' && Os == '1')
	{
		document.getElementById('CPanel').options[1].disabled = true;
	}
	else
	{
		document.getElementById('CPanel').options[1].disabled = false;
	}
	
	if (page == '2')
	{
		var elSel = document.getElementById('CPanel');
		elSel.options[0].innerHTML = 'Select Panel';
		
		var elOptNew = document.createElement('option');
		elOptNew.text = 'CPanel';
		elOptNew.value = '1';

		try {
			elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			elSel.add(elOptNew); // IE only
		}
		
		var elOptNew = document.createElement('option');
		elOptNew.text = 'Plesk';
		elOptNew.value = '2';

		try {
			elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			elSel.add(elOptNew); // IE only
		}
	}
	
	/*if (page == '1' && Os == '2')
	{
		var elSel = document.getElementById('CPanel');
		elSel.options[0].innerHTML = 'No Panel';
		
		var elOptNew = document.createElement('option');
		elOptNew.text = 'Plesk';
		elOptNew.value = '2';

		try {
			elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			elSel.add(elOptNew); // IE only
		}
	}*/
	
	if (page == '1' && Os == '1') createAvailability(Availability2008);
	if (page == '1' && Os == '2') createAvailability(Availability2003);
	if (page == '2') createAvailability(AvailabilityLinux);
	
	if (page == 1) getPriceWinVPS();
	if (page == 2) getPriceLinVPS();
}

function changeCPanel(value, page)
{
	CPanel = value;
	
	if (page == 1) getPriceWinVPS();
	if (page == 2) getPriceLinVPS();
	if (page == '2' && value == '0') document.getElementById('Price_a').href = 'javascript: void(0);';
}

function changeLocation(value, page)
{
	Location = value;
	if (page == 1) getPriceWinVPS();
	if (page == 2) getPriceLinVPS();
}

function showAll()
{
	alert(Product);
	alert(Os);
	alert(CPanel);
	alert(Location);
}

function getSelectTable(plan, page)
{
	document.getElementById('Table_Plans').style.display = 'none';
	document.getElementById('Table_Select').style.display = '';
	
	if (page == '1') {Os = 2;}
	else {Os = 1;}
	if (page == '1') CPanel = 1;
	else CPanel = 0;
	Location = 1;
	
	var el;
	el = document.getElementById('OS');
	//el.options[1].selected = true;
	el = document.getElementById('CPanel');
	el.options[0].selected = true;
	
//	if ((page == '1' && Os == '1') || (page == '1' && plan == '1' && Os == '2'))
//	{
//		var elSelPanel = document.getElementById('CPanel');
//		elSelPanel.options[0].innerHTML = 'No control panel option available';
//		elSelPanel.remove(1);
//	}else
//	{

		var elSelPanel = document.getElementById('CPanel');
		if(page == '1')	elSelPanel.options[0].innerHTML = 'No panel';
		if(page == '2')	elSelPanel.options[0].innerHTML = 'Select Panel';
		
		var len;
		if (page == '2') len = 3;
		if (page == '1') len = 2;
		if (elSelPanel.options.length < len)
		{
			var elOptNew = document.createElement('option');
			elOptNew.text = 'Plesk';
			elOptNew.value = '2';
	
			try {
				elSelPanel.add(elOptNew, null); // standards compliant; doesn't work in IE
			}
			catch(ex) {
				elSelPanel.add(elOptNew); // IE only
			}
		}
//	}
	
	if (page == '1' && Os == '2' && Location == '1') Location = 1;
	if (page == '1' && Os == '1') createAvailability(Availability2008);
	if (page == '1' && Os == '2') createAvailability(Availability2003);
	if (page == '2') createAvailability(AvailabilityLinux);
	
	if(page == '2')
	{
		switch(plan)
		{
			case '1':
				document.getElementById('Plan_Selected').innerHTML = 'Solar Micro';
				break;
			case '2':
				document.getElementById('Plan_Selected').innerHTML = 'Solar Nano';
				break;
			case '3':
				document.getElementById('Plan_Selected').innerHTML = 'Solar Pico';
				break;
			default:
				document.getElementById('Plan_Selected').innerHTML = '';
				break;
		}
	}
	else if (page == '1')
	{
		switch(plan)
		{
			case '1':
				document.getElementById('Plan_Selected').innerHTML = 'Solar Mega';
				break;
			case '2':
				document.getElementById('Plan_Selected').innerHTML = 'Solar Giga';
				break;
			case '3':
				document.getElementById('Plan_Selected').innerHTML = 'Solar Tera';
				break;
			default:
				document.getElementById('Plan_Selected').innerHTML = '';
				break;
		}
	}
	
	el = document.getElementById('OS');	
	if (page == '1') {el.options[1].selected = true;}
	if (page == '1' && plan == '1') {el.options[0].disabled = true;}
	else{el.options[0].disabled = false;}
	
	if (page == '1' && plan == '3')
	{
		document.getElementById('OS').options[0].disabled = true;
	}
	else
	{
		document.getElementById('OS').options[0].disabled = false;
	}
	
	if (page == '1' && Os == '1')
	{
		document.getElementById('CPanel').options[1].disabled = true;
	}
	else
	{
		document.getElementById('CPanel').options[1].disabled = false;
	}
	
	if(page == '1' && plan == '1')
	{
		document.getElementById('OS').options[0].disabled = true;
	}
	else
	{
		document.getElementById('OS').options[0].disabled = false;
	}
	document.getElementById('Price_a').href = 'javascript: void(0);';
	setProduct(plan, page);
}

function revertTables()
{
	document.getElementById('Table_Plans').style.display = '';
	document.getElementById('Table_Select').style.display = 'none';	
}

function checkValues(page)
{
	if (page == '2')
	{
		if (CPanel == '0')
		{
			alert('You must select your desired control panel.')
			//document.getElementById('Price_a').href= 'javascript: void(0);';
			return false;
		}
	}
	
	return true;
}

function changeAvailability(context)
{
	if (context == '1')
	{
		document.getElementById('Availability_Table_Windows_2008').style.display = 'none';
		document.getElementById('Availability_Table_Windows_2003').style.display = '';
	}
	
	if (context == '2')
	{
		document.getElementById('Availability_Table_Windows_2008').style.display = '';
		document.getElementById('Availability_Table_Windows_2003').style.display = 'none';
	}
}

function displayHomeBanner()
{
	document.getElementById('Slide2').style.display = '';
	document.getElementById('Slide3').style.display = '';
	document.getElementById('Slide4').style.display = '';
}

