

// Calculates MaxPower
function MaxPower() {

var a=1*document.form1.server.value;

if (a==1) {
var total=892.8;
}
else if (a==2) {
var total=1019.6;
}
else if (a==3) {
var total=969.2;
}
else {
var total=1020.4;
}

document.form1.sys_tot.value=Math.round(total);
var temp=(1*document.form1.sys_tot.value);
document.form1.btu_power.value=Math.round(temp*3.414)
}

// Calculates IdlePower
function IdlePower() {
var a=1*document.form1.server.value;

if (a==1) {
var total=812.8;
}
else if (a==2) {
var total=909.3;
}
else if (a==3) {
var total=862.1;
}
else {
var total=910.2;
}

document.form1.sys_idle.value=Math.round(total);
var temp=(1*document.form1.sys_idle.value);
document.form1.btu_idle.value=Math.round(temp*3.414)
}


function proceed() {
MaxPower();IdlePower();
}

function CheckForm () { 

	//Initialise variables
	var errorMsg = "";


	//Check for DIMM quantity
	if ((document.form1.tapedrive1.value == "0")&&(document.form1.tapedrive2.value == "0")&&(document.form1.tapedrive3.value == "0")&&(document.form1.tapedrive4.value == "0")){
		errorMsg += "Select a minimum of ONE SATA Disk Tray\n";	
	}


	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your request has not been processed because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: \n\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	proceed();
}



// Ttests to ensure that at least 4 DIMMS are selected
function parameterchecksone() {
proceed();
}

