// change base prices here
var selpackage = (location.search) ? location.search : 'basic';
var price = 0;
var monthly = price;
var basesetup = 0;
var packsetup = 0;
var setup = 0;
var forfait = 0;
var maind = 0;
var RAMsetup = 0;
//var setup = basesetup;
var ossetup = 0;
var osmonthly = 0;
var controlfee = 0;
var controlmofee = 0;
var sqlfee = 0;
var firewallfee = 0;
var firewallsetup = 0;
var opersysfee = 0;
var backupfee = 0;
var ipfee = 0;
var monitoringfee = 0;

var portfee = 0;
var bandwidthfee = 0;
var HDfee = 0;
var Bandwidthfee = 0;
var SavBackup = 0;
var firewall = 0;

var PanelAdmin = 0;
var LogicielFee = 0;
var ServeurJeuFee = 0;
var nvIG = 0;
var certificatSSL = 0;

var pricemultiplier = 1;
var cycletime = "<div align=\"right\">Prix mensuel:</div>";

var osnote = "";

//check http variable
var checkstart = (selpackage.indexOf('starter') > -1) ? 'checked' : '';
var checkpower = (selpackage.indexOf('power') > -1) ? 'checked' : '';
var checkbasic  = (selpackage.indexOf('basic') > -1) ? 'checked' : '';
var checkpowerplus = (selpackage.indexOf('powerplus') > -1) ? 'checked' : '';
var checkbusiness  = (selpackage.indexOf('business') > -1) ? 'checked' : '';
var checkpowerpro = (selpackage.indexOf('powerpro') > -1) ? 'checked' : '';


if (selpackage.indexOf('starter') > -1) {price = 49; packsetup = 0; choice = "start"; osnote = "Please Note: 64-bit Operating Systems are not compatible with the selected server package.";}
if (selpackage.indexOf('power') > -1) {price = 99; packsetup = 0; choice = "power"; osnote = "Please Note: 64-bit Operating Systems are not compatible with the selected server package.";}
if (selpackage.indexOf('basic') > -1) {price = 69; packsetup = 0; choice = "basic"}
if (selpackage.indexOf('powerplus') > -1) {price = 139; packsetup = 0; choice = "powerplus"}
if (selpackage.indexOf('business') > -1) {price = 89; packsetup = 0; choice = "business"; osnote = "Please Note: 64-bit Operating Systems are not compatible with the selected server package.";}
if (selpackage.indexOf('powerpro') > -1) {price = 159; packsetup = 0; choice = "powerpro"}



//var setup = basesetup + packsetup;

var total = price + setup;
var totalCmd = price + setup + forfait + maind;
var totalTTC = Math.round((total * 1.196)*100)/100;
var totalCmdTTC = Math.round((totalCmd * 1.196)*100)/100;

//form validation functions

var iserror;
//var errortxt = 'Please fix the following errors:\n\n';
var errortxt = '\n';

function verifyMe(thisform)
	{

	var chosen = 0;
	var billingaddress = 0;
	var usecc = 0;
	
	for (var i=0;i<thisform.length;i++)
		{
		clearhighlight(thisform[i].name);
		}
	
	for (var i=0;i<thisform.length;i++)
		{
		//document.debug.debugtxt.value += thisform[i].name + '\n';
		switch(thisform[i].name) 
			{
			case 'packagetype':
				if (thisform[i].checked)
					{
					chosen=1;
					}
			break;
			
			case 'usebilling':
				billingaddress = (thisform[i].checked) ? 0 : 1; // verify billing address if different
			break;
			
			case 'pay_method':
				if (thisform[i].checked)
					{
					usecc = (thisform[i].value == 'creditcard') ? 1 : 0;
					}
			break;
			
			case 'ccnum':
				if (usecc) {
					var firstnum = thisform[i].value.substring(0,1);
					var numonly = thisform[i].value.replace(/-/gi, '');
					var numonly = thisform[i].value.replace(/ /gi, '');
					if (firstnum == 3)
						{
						if (numonly.length != 15)
							{
							highlight('ccnum', 'Not a valid Credit Card Number');
							}
						}
					else if (firstnum == 4 || firstnum == 5)
						{
						if (numonly.length != 16)
							{
							highlight('ccnum', 'Not a valid Credit Card Number');
							}
						}
					
					else if (firstnum == 6)
						{
						if (numonly.length != 16)
							{
							iserror = 1;
							highlight('ccnum', 'Not a valid Credit Card Number');
							}
						}
					
					else
						{
						highlight('ccnum', 'Not a valid Credit Card Number');
						}
					}
			break;
			
			case 'expmon':
				if (usecc) {
					if (thisform[i].selectedIndex == 0)
						{
						highlight('expmon', 'Please choose an Expiration Month');
						}
					}
			break;
			
			case 'expyear':
				if (usecc) {
					if (thisform[i].selectedIndex == 0)
						{
						highlight('expyear', 'Please choose an Expiration Year');
						}
					}
			break;
			
			case 'cctype':
				if (usecc) {
					if (thisform[i].selectedIndex == 0)
						{
						highlight('cctype', 'Please choose a Card Type');
						}
				}
			break;
			
			case 'nameoncc':
				if (usecc) {
					if (thisform[i].value == '') {
					highlight(thisform[i].name, 'Please type in your name as it appears on your credit card');
					}
				}
			break;
			
			case 'issuebank':
				if (usecc) {
					if (thisform[i].value == '' && thisform[i].disabled == false) {
					highlight(thisform[i].name, 'Please type in your '+thisform[i].title);
					}
				}
			break;
			
			case 'terms':
				//if (document.terms.agree.checked)
				if (thisform[i].checked)
					{
						break;
					}
				else
					{
						highlight('terms', 'You must agree to the Terms of Service to place your order');
					}
				
			
			case 'address2':
				// optional, just skip it
			break;
			
			case 'domain':
				// optional, just skip it
			break;
			
			case 'billaddress2':
				// optional, just skip it
			break;
			
			case 'country':
				// optional, just skip it
			break;
			
			case 'comments':
				// optional, just skip it
			break;
			
			case 'billcountry':
				// optional, just skip it
			break;
			
			case 'company':
				// optional, just skip it
			break;
			
			case 'billcompany':
				// optional, just skip it
			break;
			
			//case 'backupspace':
				// optional, just skip it
			//break;
			
			//case 'numip':
				// optional, just skip it
			//break;
			
			//case 'monitoring':
				// optional, just skip it
			//break;
			
			//case 'port':
				// optional, just skip it
			//break;
			
			case 'referred':
				// optional, just skip it
			break;
			
			case 'CCID':
				// optional, just skip it
				if (usecc) {
					if (thisform[i].value == '') {
					highlight(thisform[i].name, 'Please type in your CCID');
					}
				}
			break;
			
			default:
				if (thisform[i].name.indexOf('bill') > -1)
					{
					if (!billingaddress)
						{
						continue;
						}
					}
				if (thisform[i].name.indexOf('state') > -1)
					{
					//alert(thisform[i].name);
					/* Skip this for now.
					if (thisform[i].selectedIndex == 0)
						{
						highlight(thisform[i].name, 'Please select a '+thisform[i].title);
						}
					*/
					}
				else if (thisform[i].value.length < 1)
					{
					highlight(thisform[i].name, '* '+thisform[i].title);
					}
			break;
			}
		}
	if (iserror)
		{
		alert("Veuillez remplir tous les champs:\n");
		iserror = 0;
		errortxt = '';
		return false;
		}
	else
		{
		if (document.all)
		{
		document.all['subbutton'].innerHTML = 'En cours de chargement';
		}
	else if (document.getElementById)
		{
		document.getElementById('subbutton').innerHTML = 'En cours de chargement';
		}
		return true;
		}
	}

function highlight(tgt, errtxt)
	{
	iserror = 1;
	errortxt += '\t' + errtxt + '\n';
	if (document.all || document.getElementById) 
		{
		document.hostbill[tgt].className = 'fixme';
		}
	}
function clearhighlight(tgt)
	{
	if (document.all || document.getElementById) 
		{
		document.hostbill[tgt].className = '';
		}
	}

	
// Price update functions
function updatePage(){
	try {
		
		
		// if customer is paying quarterly, give free setup
		/*if (pricemultiplier > 1){
			//alert("Customer is paying quarterly, give free setup");
			setup = backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee + HDfee + Bandwidthfee + PanelAdmin + LogicielFee + ServeurJeuFee + firewall + ipfee + nvIG + SavBackup;
			//alert("Setup: " + setup);
			cycletime = "<div align=\"right\">Quarterly Price:</div>";
		} else {
			/*alert("Customer is not paying quarterly, don't give free setup to him/her");
			alert("Ram Setup: " + RAMsetup);*/
			/*setup = backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee + HDfee + Bandwidthfee + PanelAdmin + LogicielFee + ServeurJeuFee + firewall + ipfee + nvIG + SavBackup;		
			//alert("Setup: " + setup);
			cycletime = "<div align=\"right\">Prix mensuel :</div>";
		}*/
		monthly = price;
		setup = HDfee + Bandwidthfee + PanelAdmin + LogicielFee + ServeurJeuFee + firewall + ipfee + nvIG + SavBackup + RAMsetup;	
		forfait = certificatSSL;
		maind = packsetup + basesetup;
		
		cycletime = "<div align=\"right\">Prix mensuel :</div>";
		monthly = monthly * pricemultiplier;
		monthly = Math.round(monthly*100)/100;
		
		
		//setup = setup + packsetup;
		var totalvalue = (monthly) + setup;
		var totalCmdvalue = (totalvalue) + forfait + maind;
		var totalvalueTTC = Math.round((totalvalue * 1.196)*100)/100;
		var totalCmdvalueTTC = Math.round((totalCmdvalue * 1.196)*100)/100;
		if (document.all)
			{

			document.all['monthly'].innerHTML = monthly + ' € HT';
			document.all['setupfee'].innerHTML = setup + ' € HT';
			document.all['forfait'].innerHTML = forfait + ' € HT';
			document.all['maind'].innerHTML = maind + ' € HT';
			document.all['total'].innerHTML = totalvalue + ' € HT';
			document.all['totalCmd'].innerHTML = totalCmdvalue + ' € HT';
			document.all['totalTTC'].innerHTML = totalvalueTTC + ' € TTC';
			document.all['totalCmdTTC'].innerHTML = totalCmdvalueTTC + ' € TTC';
			document.getElementById('monthly').innerHTML =  monthly+ ' € HT';
			document.getElementById('setupfee').innerHTML =  setup+ ' € HT';
			document.getElementById('forfait').innerHTML =  forfait+ ' € HT';
			document.getElementById('maind').innerHTML =  maind+ ' € HT';
			document.getElementById('total').innerHTML =  totalvalue+ ' € HT';
			document.getElementById('totalCmd').innerHTML =  totalCmdvalue+ ' € HT';
			document.getElementById('totalTTC').innerHTML =  totalvalueTTC+ ' € TTC';
			document.getElementById('totalCmdTTC').innerHTML =  totalCmdvalueTTC+ ' € TTC';
			
			}
		else if (document.getElementById)
			{

			document.getElementById('monthly').innerHTML =  monthly+ ' € HT';
			document.getElementById('setupfee').innerHTML =  setup+ ' € HT';
			document.getElementById('forfait').innerHTML =  forfait+ ' € HT';
			document.getElementById('total').innerHTML =  totalvalue+ ' € HT';
			document.getElementById('totalCmd').innerHTML =  totalCmdvalue+ ' € HT';
			document.getElementById('totalTTC').innerHTML =  totalvalueTTC+ ' € TTC';
			document.getElementById('totalCmdTTC').innerHTML =  totalCmdvalueTTC+ ' € TTC';
			
			}
		document.hostbill.monthlytotal.value = monthly;
		document.hostbill.setuptotal.value = setup;
		document.hostbill.forfaittotal.value = forfait;
		document.hostbill.annueltotal.value = maind;
		document.hostbill.feetotal.value = totalvalue;
		document.hostbill.feetotalCmd.value = totalCmdvalue;
		document.hostbill.feetotalTTC.value = totalvalueTTC;
		document.hostbill.feetotalCmdTTC.value = totalCmdvalueTTC;
		
		
	} catch(e) {
		//alert("An error has ocurred.  Please Contact the administrator. ERROR: " + e.toString());
	}
}

function SelectOptions(){
// ON selection of packagetype this function will work

removeAllOptions(document.hostbill.harddrive);
addOption(document.hostbill.harddrive, "", "-- Séléctionnez ---", "");

removeAllOptions(document.hostbill.operatingsystem);
addOption(document.hostbill.operatingsystem, "", "-- Séléctionnez ---", "");

removeAllOptions(document.hostbill.ram);
addOption(document.hostbill.ram, "", "-- Séléctionnez ---", "");

removeAllOptions(document.hostbill.bandwidth);
addOption(document.hostbill.bandwidth, "", "-- Séléctionnez ---", "");

for (counter=0; counter < 8; counter++){
	if (document.hostbill.packagetype[counter].checked == true){
		choice = document.hostbill.packagetype[counter].value;
	}//ends IF
}//ends for

if(choice == 'start'){
addOption(document.hostbill.harddrive,"1x80", "1 x 80 Go Disque dur : Inclus");
addOption(document.hostbill.harddrive,"2x1T", "2 x 1 To Disque dur : + 25€/mois.");
addOption(document.hostbill.ram,"1go", "1 Go DDR RAM: Inclus");
addOption(document.hostbill.ram,"2go", "2 Go DDR RAM: + 15€");
addOption(document.hostbill.bandwidth,"Plandefault", "200GB: Inclus (Overages billed $.89 per GB)");
addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
} else if(choice == 'power'){
addOption(document.hostbill.harddrive,"2x500R1", "2 x 500 Go Disque dur Raid 1 : Inclus");
addOption(document.hostbill.harddrive,"2x1T", "2 x 1 To Disque dur : + 25€/mois.");
addOption(document.hostbill.ram,"1go", "2 Go DDR RAM: Inclus");
addOption(document.hostbill.ram,"2go", "2 Go DDR RAM: + 15€");
addOption(document.hostbill.bandwidth,"Plandefault", "400GB: Inclus (Overages billed $.89 per GB)");
addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
} else if(choice == 'basic'){
addOption(document.hostbill.harddrive,"1x120", "1 x 120 Go Disque dur : Inclus");
addOption(document.hostbill.harddrive,"2x1T", "2 x 1 To Disque dur : + 25€/mois.");
addOption(document.hostbill.ram,"1go", "2 Go DDR RAM: Inclus");
addOption(document.hostbill.ram,"2go", "2 Go DDR RAM: + 15€");
addOption(document.hostbill.bandwidth,"Plandefault", "600GB: Inclus (Overages billed $.89 per GB)");
addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4x64", "Fedora Core4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5x64", "Fedora Core5 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6x64", "Fedora Core6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54x64", "FreeBSD 5.4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6x64", "FreeBSD 6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006x64", "Gentoo 2006.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4x64", "CentOS 4.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31x64", "Debian 3.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606x64", "Ubuntu 6.06 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610x64", "Ubuntu 6.10 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101x64", "openSUSE 10.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39x64", "OpenBSD 3.9 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003x64", "Windows 2003 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2x64", "Windows 2003 R2 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entx64", "Windows 2003 Enterprise 64-bit: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2x64", "Windows 2003 Enterprise R2 64-bit: + $35/mo.");
} else if(choice == 'powerplus'){
addOption(document.hostbill.harddrive,"120+2x120R1", "120 + 2 x 120 Go Disque dur Raid 1 : Inclus");
addOption(document.hostbill.harddrive,"2x1T", "2 x 1 To Disque dur : + 25€/mois.");
addOption(document.hostbill.ram,"1go", "2 Go DDR RAM: Inclus");
addOption(document.hostbill.ram,"2go", "2 Go DDR RAM: + 15€");
addOption(document.hostbill.bandwidth,"Plandefault", "800GB: Inclus (Overages billed $.89 per GB)");
addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4x64", "Fedora Core4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5x64", "Fedora Core5 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6x64", "Fedora Core6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54x64", "FreeBSD 5.4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6x64", "FreeBSD 6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006x64", "Gentoo 2006.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4x64", "CentOS 4.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31x64", "Debian 3.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606x64", "Ubuntu 6.06 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610x64", "Ubuntu 6.10 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101x64", "openSUSE 10.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39x64", "OpenBSD 3.9 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003x64", "Windows 2003 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2x64", "Windows 2003 R2 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entx64", "Windows 2003 Enterprise 64-bit: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2x64", "Windows 2003 Enterprise R2 64-bit: + $35/mo.");
} else if(choice == 'powerplus2'){
addOption(document.hostbill.harddrive,"2x120", "basic 120 GB Disque dur : Inclus");
addOption(document.hostbill.harddrive,"4x120", "Quad 120 GB Disque dur : + $70/mo.");
addOption(document.hostbill.ram,"1560", "1560 MB DDR RAM: Inclus");
addOption(document.hostbill.ram,"2000", "2 GB DDR RAM: + $90 pour paramétrer");
addOption(document.hostbill.ram,"4000", "4 GB DDR RAM: + $390 pour paramétrer");
addOption(document.hostbill.bandwidth,"Plandefault", "1000GB: Inclus (Overages billed $.89 per GB)");
} else if(choice == 'powerpro'){
addOption(document.hostbill.harddrive,"2x120+2x500R1", "2 x 120 + 2 x 500 Go Disque dur Raid 1 : Inclus");
addOption(document.hostbill.harddrive,"2x120+2x1T", "2 x 120 Go + 2 x 1 To Disque dur : + 40€/mois.");
addOption(document.hostbill.ram,"1go", "4 Go DDR RAM: Inclus");
addOption(document.hostbill.ram,"2go", "2 Go DDR RAM: + 15€");
addOption(document.hostbill.bandwidth,"Plandefault", "1400GB: Inclus (Overages billed $.89 per GB)");
addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
//addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9&#8224;: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");

addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
} else if(choice == 'business'){
addOption(document.hostbill.harddrive,"2x350R1", "2 x 350 Go Disque dur Raid 1 : Inclus");
addOption(document.hostbill.harddrive,"2x120+2x500", "2 x 120 + 2 x 500 Go Disque dur : + 30€/mois.");
addOption(document.hostbill.ram,"1go", "2 Go DDR RAM: Inclus");
addOption(document.hostbill.ram,"2go", "2 Go DDR RAM: + 15€");
addOption(document.hostbill.bandwidth,"Plandefault", "200GB: Inclus (Overages billed $.89 per GB)");
addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
//addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9&#8224;: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
} else if(choice == 'storage'){
addOption(document.hostbill.harddrive,"2x500", "basic 500 GB Disque dur : Inclus");
addOption(document.hostbill.ram,"768", "768 MB DDR RAM: Inclus");
addOption(document.hostbill.ram,"1000", "1 GB DDR RAM: + $75 pour paramétrer");
addOption(document.hostbill.ram,"1560", "1560 MB DDR RAM: + $210 pour paramétrer");
addOption(document.hostbill.ram,"2000", "2 GB DDR RAM: + $300 pour paramétrer");
addOption(document.hostbill.bandwidth,"Plandefault", "2000GB: Inclus (Overages billed $.89 per GB)");
addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4x64", "Fedora Core4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5x64", "Fedora Core5 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6x64", "Fedora Core6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54x64", "FreeBSD 5.4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6x64", "FreeBSD 6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006x64", "Gentoo 2006.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4x64", "CentOS 4.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31x64", "Debian 3.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606x64", "Ubuntu 6.06 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610x64", "Ubuntu 6.10 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101x64", "openSUSE 10.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39x64", "OpenBSD 3.9 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003x64", "Windows 2003 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2x64", "Windows 2003 R2 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entx64", "Windows 2003 Enterprise 64-bit: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2x64", "Windows 2003 Enterprise R2 64-bit: + $35/mo.");
} else if(choice == 'xtreme'){
addOption(document.hostbill.harddrive,"2x160", "basic 160 GB Disque dur : Inclus");
addOption(document.hostbill.harddrive,"4x160", "Quad 160 GB Disque dur : + $70/mo.");
addOption(document.hostbill.ram,"2000", "2 GB DDR RAM: Inclus");
addOption(document.hostbill.ram,"4000", "4 GB DDR RAM: + $300 pour paramétrer");
addOption(document.hostbill.bandwidth,"Plandefault", "1400GB: Inclus (Overages billed $.89 per GB)");
//addOption(document.hostbill.operatingsystem,"0|0|redhat7", "Red Hat 7.3: Inclus");
//addOption(document.hostbill.operatingsystem,"0|0|redhat9", "Red Hat 9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4", "Fedora Core4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora4x64", "Fedora Core4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5", "Fedora Core5: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora5x64", "Fedora Core5 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6", "Fedora Core6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|fedora6x64", "Fedora Core6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd49", "FreeBSD 4.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54", "FreeBSD 5.4: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd54x64", "FreeBSD 5.4 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6", "FreeBSD 6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|freebsd6x64", "FreeBSD 6 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006", "Gentoo 2006.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|gentoo2006x64", "Gentoo 2006.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos36", "CentOS 3.6: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4", "CentOS 4.x: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|centos4x64", "CentOS 4.x 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31", "Debian 3.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|debian31x64", "Debian 3.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606", "Ubuntu 6.06: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu606x64", "Ubuntu 6.06 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610", "Ubuntu 6.10: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|ubuntu610x64", "Ubuntu 6.10 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse90", "Suse 9.0: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse93", "Suse 9.3: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101", "openSUSE 10.1: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|suse101x64", "openSUSE 10.1 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39", "OpenBSD 3.9: Inclus");
addOption(document.hostbill.operatingsystem,"0|0|openbsd39x64", "OpenBSD 3.9 64-bit: Inclus");
addOption(document.hostbill.operatingsystem,"0|26|win2000", "Windows 2000: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2000adv", "Windows 2000 Advanced: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|18|win2003web", "Windows 2003 Web: + $18/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003", "Windows 2003: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003x64", "Windows 2003 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2", "Windows 2003 R2: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|26|win2003r2x64", "Windows 2003 R2 64-bit: + $26/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003ent", "Windows 2003 Enterprise: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entx64", "Windows 2003 Enterprise 64-bit: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2", "Windows 2003 Enterprise R2: + $35/mo.");
addOption(document.hostbill.operatingsystem,"0|35|win2003entr2x64", "Windows 2003 Enterprise R2 64-bit: + $35/mo.");
}

addOption(document.hostbill.bandwidth,"1000gb", "1000GB Additional: + $8.95/mo.");
addOption(document.hostbill.bandwidth,"5mbps", "5Mbps Unmetered: + $175/mo.");
addOption(document.hostbill.bandwidth,"10mbps", "10Mbps Unmetered: + $350/mo.");
addOption(document.hostbill.bandwidth,"100mbps", "100Mbps Unmetered: + $900/mo.");

//reset Options fee
Bandwidthfee = 0;
HDfee = 0;
RAMsetup = 0;


updatePage();
}
////////////////// 
///// SELECT OS OPTIONS FUNCTION
function SelectOSOptions(){

removeAllOptions(document.hostbill.operatingsystem);
addOption(document.hostbill.operatingsystem, "", "-- Séléctionnez --", "");

oschoice = document.hostbill.operatingsystem.value;

if(oschoice == '0|0|redhat7' || oschoice == '0|0|redhat9'){
//cPanel + Plesk 7.5
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"109", "Plesk 7.5 (10 domaine license): + 109€ pour paramétrer");
addOption(document.hostbill.controlpanel,"50", "CPanel: + 50€/mo.");
} else if(oschoice == '0|0|fedora4' || oschoice == '0|0|fedora4x64' || oschoice == '0|0|fedora5' || oschoice == '0|0|fedora5x64' || oschoice == '0|0|freebsd54' || oschoice == '0|0|freebsd54x64' || oschoice == '0|0|freebsd6' || oschoice == '0|0|freebsd6x64' || oschoice == '0|0|centos36' || oschoice == '0|0|centos4' || oschoice == '0|0|centos4x64'){
//cPanel + Plesk 8
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"109", "Plesk 8 (10 domaine license): + 109€ pour paramétrer");
addOption(document.hostbill.controlpanel,"50", "CPanel: + 50€/mois.");
} else if(oschoice == '0|0|debian31' || oschoice == '0|0|debian31x64' || oschoice == '0|0|ubuntu606' || oschoice == '0|0|ubuntu606x64' || oschoice == '0|0|ubuntu610' || oschoice == '0|0|ubuntu610x64' || oschoice == '0|0|suse93' || oschoice == '0|0|suse101' || oschoice == '0|0|suse101x64'){
//Plesk 8
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"109", "Plesk 8 (10 domaine license): + 109€ pour paramétrer");
} else if(oschoice == '0|0|suse90'){
//cPanel
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"40", "CPanel: + $40/mo.");
} else if(oschoice == '0|28|win2003web' || oschoice == '0|36|win2003' || oschoice == '0|36|win2003r2' || oschoice == '0|36|win2003r2x64' || oschoice == '0|45|win2003ent' || oschoice == '0|45|win2003entr2'){
//Helm + Plesk 8
addOption(document.hostbill.controlpanel,"35", "Helm: + 35€/mois.");
addOption(document.hostbill.controlpanel,"109", "Plesk 8 (10 domaine license): + 109€ pour paramétrer");
addOption(document.hostbill.controlpanel,"0.001", "Aucun");
} else if(oschoice == '0|36|win2000' || oschoice == '0|45|win2000adv'){
//Helm
addOption(document.hostbill.controlpanel,"35", "Helm: + 35€/mois.");
addOption(document.hostbill.controlpanel,"0.001", "Aucun");
} else if(oschoice == '0|36|win2003x64' || oschoice == '0|45|win2003entx64' || oschoice == '0|45|win2003entr2x64'){
//Aucun (windows only)
addOption(document.hostbill.controlpanel,"0.001", "Aucun");
} else {
//Webmin (linux only)
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
}

/*addOption(document.hostbill.bandwidth,"5mbps", "5Mbps Unmetered: + $175/mo.");
addOption(document.hostbill.bandwidth,"10mbps", "10Mbps Unmetered: + $350/mo.");
addOption(document.hostbill.bandwidth,"100mbps", "100Mbps Unmetered: + $900/mo.");*/

//reset Options fee

controlfee = 0;
controlmofee = 0;


updatePage();
}
/////END SELECT OS
function SelectCPOptions(){
// ON selection of packagetype this function will work

removeAllOptions(document.hostbill.controlpanel);
addOption(document.hostbill.controlpanel, "", "-- Séléctionnez ---", "");

oschoice = document.hostbill.operatingsystem.value;

if(oschoice == '0|0|redhat7' || oschoice == '0|0|redhat9'){
//cPanel + Plesk 7.5
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"109", "Plesk 7.5 (10 domaine license): + 109€ pour paramétrer");
addOption(document.hostbill.controlpanel,"50", "CPanel: + 50€/mois.");
} else if(oschoice == '0|0|fedora4' || oschoice == '0|0|fedora4x64' || oschoice == '0|0|fedora5' || oschoice == '0|0|fedora5x64' || oschoice == '0|0|freebsd54' || oschoice == '0|0|freebsd54x64' || oschoice == '0|0|freebsd6' || oschoice == '0|0|freebsd6x64' || oschoice == '0|0|centos36' || oschoice == '0|0|centos4' || oschoice == '0|0|centos4x64'){
//cPanel + Plesk 8
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"109", "Plesk 8 (10 domaine license): + 109€ pour paramétrer");
addOption(document.hostbill.controlpanel,"50", "CPanel: + 50€/mois.");
} else if(oschoice == '0|0|debian31' || oschoice == '0|0|debian31x64' || oschoice == '0|0|ubuntu606' || oschoice == '0|0|ubuntu606x64' || oschoice == '0|0|ubuntu610' || oschoice == '0|0|ubuntu610x64' || oschoice == '0|0|suse93' || oschoice == '0|0|suse101' || oschoice == '0|0|suse101x64'){
//Plesk 8
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"109", "Plesk 8 (10 domaine license): + 109€ pour paramétrer");
} else if(oschoice == '0|0|suse90'){
//cPanel
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
addOption(document.hostbill.controlpanel,"50", "CPanel: + 50€/mois.");
} else if(oschoice == '0|28|win2003web' || oschoice == '0|36|win2003' || oschoice == '0|36|win2003r2' || oschoice == '0|36|win2003r2x64' || oschoice == '0|45|win2003ent' || oschoice == '0|45|win2003entr2'){
//Helm + Plesk 8
addOption(document.hostbill.controlpanel,"35", "Helm: + 35€/mois.");
addOption(document.hostbill.controlpanel,"109", "Plesk 8 (10 domaine license): + 109€ pour paramétrer");
addOption(document.hostbill.controlpanel,"0.001", "Aucun");
} else if(oschoice == '0|36|win2000' || oschoice == '0|45|win2000adv'){
//Helm
addOption(document.hostbill.controlpanel,"35", "Helm: + 35€/mois.");
addOption(document.hostbill.controlpanel,"0.001", "Aucun");
} else if(oschoice == '0|36|win2003x64' || oschoice == '0|45|win2003entx64' || oschoice == '0|45|win2003entr2x64'){
//Aucun (windows only)
addOption(document.hostbill.controlpanel,"0.001", "Aucun");
} else {
//Webmin (linux only)
addOption(document.hostbill.controlpanel,"0", "Webmin: Inclus");
}

/*addOption(document.hostbill.bandwidth,"5mbps", "5Mbps Unmetered: + $175/mo.");
addOption(document.hostbill.bandwidth,"10mbps", "10Mbps Unmetered: + $350/mo.");
addOption(document.hostbill.bandwidth,"100mbps", "100Mbps Unmetered: + $900/mo.");*/

//reset Options fee

controlfee = 0;
controlmofee = 0;


updatePage();
}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}


function updatePrice(value)
	{
	price = value;
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	
	if (price == 49){
	osnote = "Please Note: 64-bit Operating Systems are not compatible with the selected server package.";
	//osnote = "<table width='97%' height='100'  border='0' align='center' cellpadding='5' cellspacing='0'><tr><td background='pictures/alert.jpg'>";
	//osnote += "<br><br>SATA Raid is incompatible with MOST linux installations and all Linux installations that support a Control Panel.</td></tr></table>";
	packsetup = 0;
	} else if (price == 99){
	osnote = "Please Note: 64-bit Operating Systems are not compatible with the selected server package.";
	packsetup = 0;
	} else if (price == 69){
	osnote = "";
	packsetup = -69;
	} else if (price == 139){
	osnote = "";
	packsetup = 30;
	} else if (price == 89){
	osnote = "";
	packsetup = 30;
	} else if (price == 159){
	osnote = "Please Note: 64-bit Operating Systems are not compatible with the selected server package.";
	packsetup = 0;
	} else {
	packsetup = 0;
	}
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	
	SelectOptions();
	//updatePage();
	}
	
function updateHD(thisD) {

	HD = thisD.options[thisD.selectedIndex].value;
	
	if (choice == "starter" && HD == "2x1T"){
		HDfee = 25;
	} else if (choice == "power" && HD == "2x1T"){
		HDfee = 25;
	} else if (choice == "basic" && HD == "2x1T"){
		HDfee = 25;
	} else if (choice == "powerplus" && HD == "2x1T"){
		HDfee = 25;
	} else if (choice == "business" && HD == "2x120+2x500"){
		HDfee = 30;
	} else if (choice == "powerpro" && HD == "2x120+2x1T"){
		HDfee = 40;
	} else {
		HDfee = 0;
	}
	
	updatePage();
}
/*function updateBackup(thisD){
	
	backupfee = thisD.options[thisD.selectedIndex].value;
	
	if (backupfee == "1M"){
		Bandwidthfee = 0;
	} else if (backupfee == "10"){
		Bandwidthfee = 15;
	} else if (backupfee == "25"){
		Bandwidthfee = 40;
	} else if (backupfee == "85"){
		Bandwidthfee = 85;
	}else {
		Bandwidthfee = 0;
	}
	updatePage();
}*/

function updateSavbackup(thisD) 
{
	SavBack = thisD.options[thisD.selectedIndex].value;
	
	if (SavBack == "0"){
		SavBackup = 0;
	} else if (SavBack == "10Go"){
		SavBackup = 15;
	} else if (SavBack == "25Go"){
		SavBackup = 40;
	} else if (SavBack == "ddtt"){
		SavBackup = 85;
	}
	
	updatePage();
}

function updateCertificatSSL(thisD) 
{
	CSSL = thisD.options[thisD.selectedIndex].value;
	
	if (CSSL == "0"){
		certificatSSL = 0;
	} else if (CSSL == "SSLDomaine"){
		certificatSSL = 99;
	} else if (CSSL == "SSLServeur"){
		certificatSSL = 119;
	}
	
	updatePage();
}

function updateRAM(thisD) 
{
	RAM = thisD.options[thisD.selectedIndex].value;
	
	if (choice == "starter" && RAM == "2go"){
		RAMsetup = 15;
	} else if (choice == "power" && RAM == "2go"){
		RAMsetup = 15;
	} else if (choice == "basic" && RAM == "2go"){
		RAMsetup = 15;
	} else if (choice == "powerplus" && RAM == "2go"){
		RAMsetup = 15;
	} else if (choice == "business" && RAM == "2go"){
		RAMsetup = 15;
	} else if (choice == "powerpro" && RAM == "2go"){
		RAMsetup = 15;
	} else {
		RAMsetup = 0;
	}
	
/*	addOption(document.hostbill.ram,"1000", "1 GB DDR RAM: Free");
addOption(document.hostbill.ram,"1560", "1560 MB DDR RAM: + $210 pour paramétrer");
addOption(document.hostbill.ram,"2000", "2 GB DDR RAM: + $300 pour paramétrer");*/	
	updatePage();
}

function updatenvIG(thisD) 
{
	nvIGINFO = thisD.options[thisD.selectedIndex].value;
	
	if (nvIGINFO == "0"){
		nvIG = 0;
	} else if (nvIGINFO == "nv1"){
		nvIG = 25;
	} else if (nvIGINFO == "nv2"){
		nvIG = 49;
	} else if (nvIGINFO == "nv3"){
		nvIG = 69;
	} else if (nvIGINFO == "nv4"){
		nvIG = 99;
	} else if (nvIGINFO == "nv5"){
		nvIG = 129;
	} else {
		nvIG = 0;
	}
	
	updatePage();
}
function updatePaneldmin(thisD) 
{
	PA = thisD.options[thisD.selectedIndex].value;
	
	if (PA == "pl9.2-1d"){
		PanelAdmin = 0;
	} else if (PA == "pl9.2-10d"){
		PanelAdmin = 5;
	} else if (PA == "pl9.2-30d"){
		PanelAdmin = 15;
	} else if (PA == "pl9.2-100d"){
		PanelAdmin = 25;
	} else if (PA == "pl9.2-illimited"){
		PanelAdmin = 69;
	} else {
		PanelAdmin = 0;
	}
	updatePage();
}

function updateBandwidth(thisD) {

	BW = thisD.options[thisD.selectedIndex].value;
	
	if (BW == "1M"){
		Bandwidthfee = 0;
	} else if (BW == "2Mo"){
		Bandwidthfee = 70;
	}else {
		Bandwidthfee = 0;
	}
	
	updatePage();
}

function updateLogicielPreInstalles(thisD) {

	LP = thisD.options[thisD.selectedIndex].value;
	
	if (LP == "0"){
		LogicielFee = 0;
	} else if (LP == "50Logs"){
		LogicielFee = 25;
	}else {
		LogicielFee = 0;
	}
	
	updatePage();
}

function updateServeurJeu(thisD) {

	SJ = thisD.options[thisD.selectedIndex].value;
	
	if (SJ == "0"){
		ServeurJeuFee = 0;
	} else if (SJ == "ServeurJeu"){
		ServeurJeuFee = 25;
	}else {
		ServeurJeuFee = 0;
	}
	
	updatePage();
}
function updateFirewall(thisD) {

	Fw = thisD.options[thisD.selectedIndex].value;
	
	if (Fw == "0"){
		firewall = 0;
	} else if (Fw == "1"){
		firewall = 20;
	}else {
		firewall = 0;
	}
	
	updatePage();
}

function updateCP(thisD)
	{
	if (thisD.options[thisD.selectedIndex].value == "40" || thisD.options[thisD.selectedIndex].value == "25")
		{
		controlfee = 0;
		controlmofee = parseInt(thisD.options[thisD.selectedIndex].value);
		}
	else if (thisD.options[thisD.selectedIndex].value == "" )
		{
		controlfee = 0;
		controlmofee = 0;
		}
	else
		{
		controlfee = parseInt(thisD.options[thisD.selectedIndex].value);
		controlmofee = 0;
		}
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	updatePage();
	}
	

	
function updateSQL(thisD)
	{
	sqlfee = parseInt(thisD.options[thisD.selectedIndex].value);
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	updatePage();
	}
	
function updateMonitoring(thisD)
	{
	monitoringfee = parseInt(thisD.options[thisD.selectedIndex].value);
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	updatePage();
	}
	
function updatePort(thisD)
	{
	portfee = parseInt(thisD.options[thisD.selectedIndex].value);
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	updatePage();
	}
	
/*function updateFirewall(thisD)
	{
	
	if (thisD.options[thisD.selectedIndex].value == "0")
		{
		firewallfee = 0;
		firewallsetup = 0;
		}
	else
		{
		firewallfee = 20;
		firewallsetup = 0;
		}
		
	//firewallfee = 50;
	//firewallsetup = 100;
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	updatePage();
	}*/


function updateOSlist(thisD)
	{
					
	//if (thisD.options[thisD.selectedIndex].value != "0|0|linux" && thisD.options[thisD.selectedIndex].value != "0|0|debian" && thisD.options[thisD.selectedIndex].value != "0|0|redhat7" && thisD.options[thisD.selectedIndex].value != "0|0|redhat9" && thisD.options[thisD.selectedIndex].value != "0|0|fedora1" && thisD.options[thisD.selectedIndex].value != "0|0|fedora2" && thisD.options[thisD.selectedIndex].value != "0|0|freebsd" && thisD.options[thisD.selectedIndex].value != "0|0|suse" && thisD.options[thisD.selectedIndex].value != "0|0|gentoo")
	if (thisD.options[thisD.selectedIndex].value == "0|36|win2000" ||
		thisD.options[thisD.selectedIndex].value == "0|45|win2000adv" ||
		thisD.options[thisD.selectedIndex].value == "0|36|win2003" ||
		thisD.options[thisD.selectedIndex].value == "0|36|win2003x64" ||
		thisD.options[thisD.selectedIndex].value == "0|36|win2003r2" ||
		thisD.options[thisD.selectedIndex].value == "0|36|win2003r2x64" ||
		thisD.options[thisD.selectedIndex].value == "0|45|win2003ent" ||
		thisD.options[thisD.selectedIndex].value == "0|45|win2003entx64" ||
		thisD.options[thisD.selectedIndex].value == "0|45|win2003entr2" ||
		thisD.options[thisD.selectedIndex].value == "0|45|win2003entr2x64")
		{
		//document.hostbill.controlpanel.disabled = true;
		//document.hostbill.controlpanel.value = "0.001";
		controlfee = 0;
		controlmofee = 0;
		document.hostbill.sql.disabled = false;


		}
	//Cpanel
	else if (thisD.options[thisD.selectedIndex].value == "0|0|fedora3" ||
		thisD.options[thisD.selectedIndex].value == "0|0|fedora4" ||
		thisD.options[thisD.selectedIndex].value == "0|0|fedora5" ||
		thisD.options[thisD.selectedIndex].value == "0|0|freebsd54" ||
		thisD.options[thisD.selectedIndex].value == "0|0|centos41")
		{
		//document.hostbill.controlpanel.disabled = false;
		document.hostbill.sql.disabled = true;
		document.hostbill.sql.value = "0";
		sqlfee = 0;
	
	
		}
		
		//Plesk
		else if (thisD.options[thisD.selectedIndex].value == "0|0|debian" ||
		thisD.options[thisD.selectedIndex].value == "0|0|suse91")
		{
		//document.hostbill.controlpanel.disabled = false;
		document.hostbill.sql.disabled = true;
		document.hostbill.sql.value = "0";
		sqlfee = 0;
	
		}
		//Aucun (Webmin Only)
		else if (thisD.options[thisD.selectedIndex].value == "0|0|suse93" ||
		thisD.options[thisD.selectedIndex].value == "0|0|gentoo" ||
		thisD.options[thisD.selectedIndex].value == "0|0|openbsd36" ||
		thisD.options[thisD.selectedIndex].value == "0|0|openbsd38" ||
		thisD.options[thisD.selectedIndex].value == "0|0|centos35" ||
		thisD.options[thisD.selectedIndex].value == "0|0|freebsd60" ||
		thisD.options[thisD.selectedIndex].value == "0|0|opensuse" ||
		thisD.options[thisD.selectedIndex].value == "0|0|ubuntu")
		{
		//document.hostbill.controlpanel.disabled = false;
		document.hostbill.sql.disabled = true;
		document.hostbill.sql.value = "0";
		sqlfee = 0;
		
	
		} else
		{
		//document.hostbill.controlpanel.disabled = false;
		document.hostbill.sql.disabled = true;
		document.hostbill.sql.value = "0";
		sqlfee = 0;
	
	
		}
	
	if (thisD.options[thisD.selectedIndex].value == "0|28|windowsweb2003")
		{
		document.hostbill.sql.disabled = true;
		document.hostbill.sql.value = "0";
		sqlfee = 0;

		}
		
	var ostemp = thisD.options[thisD.selectedIndex].value.split('|');
	osmonthly = parseInt(ostemp[1]);
	ossetup = parseInt(ostemp[0]);
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	
	SelectCPOptions();
	
	updatePage();
	}
	

function updateIP(thisip)
	{
	ipfee = parseInt(thisip.options[thisip.selectedIndex].value) * 10;
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	updatePage();
	}
	
/*function updateBackup(thisbk)
	{
	backupfee = parseInt(thisbk.options[thisbk.selectedIndex].value);
	//backupfee = thisbk.options[thisbk.selectedIndex].value;
	if (backupfee == "1M"){
		Bandwidthfee = 0;
	} else if (backupfee == "10"){
		Bandwidthfee = 15;
	} else if (backupfee == "25"){
		Bandwidthfee = 40;
	} else if (backupfee == "85"){
		Bandwidthfee = 85;
	}else {
		Bandwidthfee = 0;
	}
	
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	//setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	updatePage();
	}*/
	
function changeIssueBank(thisD)
	{
	if(thisD.options[thisD.selectedIndex].text == 'MasterCard' || thisD.options[thisD.selectedIndex].text == 'Visa') 
		{
		//document.hostbill.issuebank.disabled = false;
		document.hostbill.issuebank.style.backgroundColor = 'white';
		}
	else
		{
		//document.hostbill.issuebank.disabled = true;
		document.hostbill.issuebank.style.backgroundColor = 'dddddd';
		}
	}
	

function updatebillingcycle(thisD)
	{
	pricemultiplier = parseInt(thisD.options[thisD.selectedIndex].value);
	//monthly = price + backupfee + osmonthly + sqlfee + controlmofee + firewallfee + monitoringfee + portfee;
	
	/*if (thisD.options[thisD.selectedIndex].value > 1)
		{
		basesetup = 0;
		packsetup = 0;
		setup = controlfee + ipfee + basesetup + ossetup + packsetup + firewallsetup;
	}*/
	
	updatePage();
	}


