
/////////////////////////////////////////////////////////////////////////
/////////// Calculates Total Wattage for System Configuration///////////
///////////////////////////////////////////////////////////////////////



function ServerModule(model) {

var a=model;

var max1=0;
var idle1=0;
var max2=0;
var idle2=0;
var max3=0;
var idle3=0;

var workload=(((1*document.form1.workload.value))/100);

switch (a) {
case 0: max1=0; idle1=0; break;
// Case of Model X5460 3.16GHz 120W
case 1: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=275;
idle1=157;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=297;
idle1=175;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=341;
idle1=211;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=429;
idle1=283;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=273;
idle2=157;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=293;
idle2=175;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=333;
idle2=211;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=413;
idle2=283;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=273;
idle3=157;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=293;
idle3=175;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=333;
idle3=211;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=413;
idle3=283;
}
break;

// Case of Model E5440 2.83GHz 80W
case 2: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=224;
idle1=151;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=246;
idle1=169;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=290;
idle1=205;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=378;
idle1=277;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=222;
idle2=151;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=242;
idle2=169;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=282;
idle2=205;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=362;
idle2=277;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=222;
idle3=151;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=242;
idle3=169;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=282;
idle3=205;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=362;
idle3=277;
}
break;

// Case of Model E5410 2.33GHz 80W
case 3: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=223;
idle1=159;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=245;
idle1=177;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=289;
idle1=213;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=377;
idle1=285;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=221;
idle2=159;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=241;
idle2=177;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=281;
idle2=213;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=361;
idle2=285;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=221;
idle3=159;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=241;
idle3=177;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=281;
idle3=213;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=361;
idle3=285;
}
break;

// Case of Model X5260 3.33GHz 80W
case 4: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=262;
idle1=164;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=284;
idle1=182;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=328;
idle1=218;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=416;
idle1=290;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=260;
idle2=164;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=280;
idle2=182;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=320;
idle2=218;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=400;
idle2=290;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=260;
idle3=164;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=280;
idle3=182;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=320;
idle3=218;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=400;
idle3=290;
}
break;

// Case of Model L5420 2.5GHz 50W
case 5: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=232;
idle1=192;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=254;
idle1=210;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=298;
idle1=246;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=386;
idle1=318;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=230;
idle2=192;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=250;
idle2=210;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=290;
idle2=246;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=370;
idle2=318;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=230;
idle3=192;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=250;
idle3=210;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=290;
idle3=246;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=370;
idle3=318;
}
break;

// Case of Model X5470 Processor (3.33 GHz)
case 6: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=275;
idle1=157;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=297;
idle1=175;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=341;
idle1=211;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=429;
idle1=283;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=273;
idle2=157;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=293;
idle2=175;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=333;
idle2=211;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=413;
idle2=283;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=273;
idle3=157;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=293;
idle3=175;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=333;
idle3=211;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=413;
idle3=283;
}
break;

// Case of Model L5430 Processor (2.66 GHz)
case 7: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=232;
idle1=192;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=254;
idle1=210;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=298;
idle1=246;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=386;
idle1=318;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=230;
idle2=192;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=250;
idle2=210;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=290;
idle2=246;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=370;
idle2=318;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=230;
idle3=192;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=250;
idle3=210;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=290;
idle3=246;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=370;
idle3=318;
}
break;

// Case of Model E5450 2.83GHz 80W
case 8: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=224;
idle1=151;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=246;
idle1=169;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=290;
idle1=205;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=378;
idle1=277;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=222;
idle2=151;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=242;
idle2=169;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=282;
idle2=205;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=362;
idle2=277;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=222;
idle3=151;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=242;
idle3=169;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=282;
idle3=205;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=362;
idle3=277;
}
break;
}


// Calculates Total Memory Usage
if ((max1>max2)&&(max1>max3)) {
var system_power=(max1+(2.5*document.form1.TwoGbMemory.value)+(2*document.form1.FourGbMemory.value));
var system_idle=(idle1+(2*document.form1.TwoGbMemory.value)+(1.5*document.form1.FourGbMemory.value));
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2+(5*document.form1.OneGbMemory.value)+(2*document.form1.FourGbMemory.value));
var system_idle=(idle2+(2*document.form1.OneGbMemory.value)+(1.5*document.form1.FourGbMemory.value));
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3+(2.5*document.form1.OneGbMemory.value)+(2.5*document.form1.TwoGbMemory.value));
var system_idle=(idle3+(1.25*document.form1.OneGbMemory.value)+(2*document.form1.TwoGbMemory.value));
}
else {
var system_power=0;
var system_idle=0;
}

// Calculates Total HDD Wattage
var hdd_idle=((.1*document.form1.ssd.value)+(10*document.form1.hdd.value));
var hdd_max=((2.4*document.form1.ssd.value)+(12*document.form1.hdd.value));

// Calculates Total Optical Drive Wattage
var dvd_idle=(1*document.form1.DVD.value);
var dvd_max=(3*document.form1.DVD.value);


// Calculates Total PCI-E Wattage
var pci_idle=(12*document.form1.pci.value);
var pci_max=(20*document.form1.pci.value);


var total_idle=system_idle+hdd_idle+dvd_idle+pci_idle-22;
var total_max=system_power+hdd_max+dvd_max+pci_max-32;

var tot=Math.round((100*((total_idle+((total_max-total_idle)*workload))))/100);

document.form1.tot2_idle.value=Math.round(total_idle);
document.form1.tot2_power.value=tot;
document.form1.btu_power.value=Math.round((((document.form1.tot2_idle.value*3600)/1055.056)*100)/100);
document.form1.btu_power2.value=Math.round((((document.form1.tot2_power.value*3600)/1055.056)*100)/100);

}


function ServerModule2(model2) {

var a=model2;

var max1=0;
var idle1=0;
var max2=0;
var idle2=0;
var max3=0;
var idle3=0;

var workload=(((1*document.form1.workload.value))/100);


switch (a) {
case 0: max1=0; idle1=0; break;
// Case of Model X5460 3.16GHz 120W
case 1: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=331;
idle1=178;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=353;
idle1=196;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=397;
idle1=232;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=485;
idle1=304;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=329;
idle2=178;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=349;
idle2=196;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=389;
idle2=232;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=469;
idle2=304;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=329;
idle3=178;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=349;
idle3=196;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=389;
idle3=232;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=469;
idle3=304;
}
break;

// Case of Model E5440 2.83GHz 80W
case 2: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=284;
idle1=163;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=306;
idle1=181;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=350;
idle1=217;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=438;
idle1=289;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=282;
idle2=163;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=302;
idle2=181;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=342;
idle2=217;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=422;
idle2=289;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=282;
idle3=163;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=302;
idle3=181;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=342;
idle3=217;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=422;
idle3=289;
}
break;

// Case of Model E5410 2.33GHz 80W
case 3: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=268;
idle1=168;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=290;
idle1=186;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=334;
idle1=222;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=422;
idle1=294;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=266;
idle2=168;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=286;
idle2=186;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=326;
idle2=222;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=406;
idle2=294;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=266;
idle3=168;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=286;
idle3=186;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=326;
idle3=222;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=406;
idle3=294;
}
break;

// Case of Model X5260 3.33GHz 80W
case 4: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=312;
idle1=176;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=334;
idle1=194;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=378;
idle1=230;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=466;
idle1=302;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=310;
idle2=176;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=330;
idle2=194;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=370;
idle2=230;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=450;
idle2=302;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=310;
idle3=176;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=330;
idle3=194;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=370;
idle3=230;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=450;
idle3=302;
}
break;

// Case of Model L5420 2.5GHz 50W
case 5: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=275;
idle1=200;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=297;
idle1=218;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=341;
idle1=254;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=429;
idle1=326;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=273;
idle2=200;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=293;
idle2=218;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=333;
idle2=254;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=413;
idle2=326;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=273;
idle3=200;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=293;
idle3=218;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=333;
idle3=254;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=413;
idle3=326;
}
break;

// Case of Model X5470 Processor (3.33 GHz)
case 6: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=331;
idle1=178;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=353;
idle1=196;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=397;
idle1=232;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=485;
idle1=304;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=329;
idle2=178;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=349;
idle2=196;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=389;
idle2=232;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=469;
idle2=304;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=329;
idle3=178;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=349;
idle3=196;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=389;
idle3=232;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=469;
idle3=304;
}
break;

// Case of Model L5430 Processor (2.66 GHz)
case 7: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=275;
idle1=200;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=297;
idle1=218;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=341;
idle1=254;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=429;
idle1=326;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=273;
idle2=200;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=293;
idle2=218;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=333;
idle2=254;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=413;
idle2=326;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=273;
idle3=200;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=293;
idle3=218;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=333;
idle3=254;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=413;
idle3=326;
}
break;

// Case of Model E5450 2.83GHz 80W
case 8: 
if ((1*document.form1.OneGbMemory.value)==2) {
max1=284;
idle1=163;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max1=306;
idle1=181;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max1=350;
idle1=217;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max1=438;
idle1=289;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=282;
idle2=163;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=302;
idle2=181;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=342;
idle2=217;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=422;
idle2=289;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max3=282;
idle3=163;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max3=302;
idle3=181;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max3=342;
idle3=217;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max3=422;
idle3=289;
}
break;
}


// Calculates Total Memory Usage
if ((max1>max2)&&(max1>max3)) {
var system_power=(max1+(2.5*document.form1.TwoGbMemory.value)+(2*document.form1.FourGbMemory.value));
var system_idle=(idle1+(2*document.form1.TwoGbMemory.value)+(1.5*document.form1.FourGbMemory.value));
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2+(5*document.form1.OneGbMemory.value)+(2*document.form1.FourGbMemory.value));
var system_idle=(idle2+(2*document.form1.OneGbMemory.value)+(1.5*document.form1.FourGbMemory.value));
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3+(2.5*document.form1.OneGbMemory.value)+(2.5*document.form1.TwoGbMemory.value));
var system_idle=(idle3+(1.25*document.form1.OneGbMemory.value)+(2*document.form1.TwoGbMemory.value));
}
else {
var system_power=0;
var system_idle=0;
}

// Calculates Total HDD Wattage
var hdd_idle=((.1*document.form1.ssd.value)+(10*document.form1.hdd.value));
var hdd_max=((2.4*document.form1.ssd.value)+(12*document.form1.hdd.value));

// Calculates Total Optical Drive Wattage
var dvd_idle=(1*document.form1.DVD.value);
var dvd_max=(3*document.form1.DVD.value);


// Calculates Total PCI-E Wattage
var pci_idle=(12*document.form1.pci.value);
var pci_max=(20*document.form1.pci.value);


var total_idle=system_idle+hdd_idle+dvd_idle+pci_idle-22;
var total_max=system_power+hdd_max+dvd_max+pci_max-32;

var tot=Math.round((100*((total_idle+((total_max-total_idle)*workload))))/100);

document.form1.tot2_idle.value=Math.round(total_idle);
document.form1.tot2_power.value=tot;
document.form1.btu_power.value=Math.round((((document.form1.tot2_idle.value*3600)/1055.056)*100)/100);
document.form1.btu_power2.value=Math.round((((document.form1.tot2_power.value*3600)/1055.056)*100)/100);

}



function systot() {
var a=(1*document.form1.Processor.value);
var b=(1*document.form1.Quantity.value);

if (b == 1) {
ServerModule(a);
}
else if (b == 2) {
ServerModule2(a);
}
}


// Calls ALL Functions
function proceed() {
systot();
}


function setOptions(chosen) {
var selbox = document.form1.pci
 
selbox.options.length = 0;

if (chosen == "0") {
  selbox.options[selbox.options.length] = new Option('None','0');
  selbox.options[selbox.options.length] = new Option('1 PCIe Card','1');
  selbox.options[selbox.options.length] = new Option('2 PCIe Cards','2');
  selbox.options[selbox.options.length] = new Option('3 PCIe Cards','3');
  selbox.options[selbox.options.length] = new Option('4 PCIe Cards','4');
  selbox.options[selbox.options.length] = new Option('5 PCIe Cards','5');
  selbox.options[selbox.options.length] = new Option('6 PCIe Cards','6');
}
if (chosen == "1") {
  selbox.options[selbox.options.length] = new Option('1 PCIe Card','1');
  selbox.options[selbox.options.length] = new Option('2 PCIe Cards','2');
  selbox.options[selbox.options.length] = new Option('3 PCIe Cards','3');
  selbox.options[selbox.options.length] = new Option('4 PCIe Cards','4');
  selbox.options[selbox.options.length] = new Option('5 PCIe Cards','5');
  selbox.options[selbox.options.length] = new Option('6 PCIe Cards','6');
}
}


function PrintMenu() {
var a=((1*document.form1.hdd.value));
var b=((1*document.form1.ssd.value));
if (a==0 && b==0) {
setOptions('0');
}
if (a>0 || b>0) {
setOptions('1');
}
}



function FinalCheck() {
//Checks to make sure user cannot proceed (Mozilla) if memory exceeds 16
if (((1*document.form1.OneGbMemory.value)+(1*document.form1.FourGbMemory.value)+(1*document.form1.TwoGbMemory.value))>16) {
stop
}
//Checks to make sure user cannot proceed (Mozilla) if no memory is selected
else if (((1*document.form1.FourGbMemory.value)+(1*document.form1.TwoGbMemory.value)+(1*document.form1.OneGbMemory.value))==0) {
stop
}
else {
proceed();
}
}


function CheckForm () { 

	//Initialise variables
	var errorMsg = "";


	//Check for DIMM quantity
	if ((document.form1.OneGbMemory.value == "0")&&(document.form1.TwoGbMemory.value == "0")&&(document.form1.FourGbMemory.value == "0")){
		errorMsg += "\n\tDIMMs \t\t- Enter # of DIMMs desired";	
	}
	
	//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";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	FinalCheck();
}



// Ttests to ensure that at least 4 DIMMS are selected
function parameterchecksone() {
CheckForm();
}

 