

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


function ServerModule1(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;
// Model UltraSPARC T2+ 8-core CPUs (1.4 Ghz)
case 1: 
if ((1*document.form1.EightGbMemory.value)==4) {
max3=443;
idle3=393;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max3=513;
idle3=446;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max3=628;
idle3=531;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=456;
idle1=395;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=515;
idle1=452;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=641;
idle1=553;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=424;
idle2=386;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=474;
idle2=423;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=554;
idle2=486;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.2 Ghz)
case 2: 
if ((1*document.form1.EightGbMemory.value)==4) {
max3=406;
idle3=372;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max3=470;
idle3=413;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max3=583;
idle3=500;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=416;
idle1=370;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=476;
idle1=419;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=598;
idle1=512;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=391;
idle2=360;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=427;
idle2=397;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=508;
idle2=453;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.6 Ghz)

case 3: 
if ((1*document.form1.EightGbMemory.value)==4) {
max3=498;
idle3=406;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max3=564;
idle3=463;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max3=697;
idle3=576;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=511;
idle1=412;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=576;
idle1=459;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=707;
idle1=554;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=451;
idle2=411;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=496;
idle2=437;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=585;
idle2=490;
}
break;

}


// Calculates Total Memory Usage
if ((max1>max2)&&(max1>max3)) {
var system_power=(max1+(2.5*document.form1.TwoGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle1+(2*document.form1.TwoGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2+(5*document.form1.FourGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle2+(2*document.form1.FourGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3+(2.5*document.form1.FourGbMemory.value)+(2.5*document.form1.TwoGbMemory.value));
var system_idle=(idle3+(1.25*document.form1.FourGbMemory.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.sata.value)+(10*document.form1.HardDrive146.value));
var hdd_max=((2.4*document.form1.sata.value)+(12*document.form1.HardDrive146.value));

// Calculates Total Optical Drive Wattage
var dvd_idle=(3*document.form1.DVD.value);
var dvd_max=(10*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);

// Calculates Total Ethernet XAUI Wattage
var ethernet_idle =(7*document.form1.ethernet.value);
var ethernet_max=(14*document.form1.ethernet.value);

var total_idle=system_idle+hdd_idle+dvd_idle+pci_idle+ethernet_idle-10;
var total_max=system_power+hdd_max+dvd_max+pci_max+ethernet_max-12;

var proc = (1*document.form1.Processor.value);
if (proc == 3)  {
	total_idle = total_idle-10;
	total_max = total_max-12;
}

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(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;
// Model UltraSPARC T2+ 8-core CPUs (1.4 Ghz)
case 1: 
if ((1*document.form1.EightGbMemory.value)==8) {
max3=668;
idle3=548;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max3=813;
idle3=650;
}
if ((1*document.form1.EightGbMemory.value)==32) {
max3=1004;
idle3=827;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=690;
idle1=560;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=825;
idle1=650;
}
if ((1*document.form1.FourGbMemory.value)==32) {
max1=1030;
idle1=850;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=630;
idle2=530;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=715;
idle2=600;
}
if ((1*document.form1.TwoGbMemory.value)==32) {
max2=865;
idle2=740;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.2 Ghz)
case 2: 
if ((1*document.form1.EightGbMemory.value)==8) {
max3=607;
idle3=494;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max3=729;
idle3=606;
}
if ((1*document.form1.EightGbMemory.value)==32) {
max3=925;
idle3=791;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=640;
idle1=525;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=745;
idle1=615;
}
if ((1*document.form1.FourGbMemory.value)==32) {
max1=980;
idle1=820;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=595;
idle2=500;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=665;
idle2=570;
}
if ((1*document.form1.TwoGbMemory.value)==32) {
max2=820;
idle2=705;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.6 Ghz)
case 3: 
if ((1*document.form1.EightGbMemory.value)==8) {
max3=759;
idle3=591;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max3=883;
idle3=694;
}
if ((1*document.form1.EightGbMemory.value)==32) {
max3=1132;
idle3=900;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=779;
idle1=586;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=900;
idle1=682;
}
if ((1*document.form1.FourGbMemory.value)==32) {
max1=1142;
idle1=873;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=684;
idle2=563;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=766;
idle2=638;
}
if ((1*document.form1.TwoGbMemory.value)==32) {
max2=931;
idle2=789;
}
break;

}


// Calculates Total Memory Usage
if ((max1>max2)&&(max1>max3)) {
var system_power=(max1+(2.5*document.form1.TwoGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle1+(2*document.form1.TwoGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2+(5*document.form1.FourGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle2+(2*document.form1.FourGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3+(2.5*document.form1.FourGbMemory.value)+(2.5*document.form1.TwoGbMemory.value));
var system_idle=(idle3+(1.25*document.form1.FourGbMemory.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.sata.value)+(10*document.form1.HardDrive146.value));
var hdd_max=((2.4*document.form1.sata.value)+(12*document.form1.HardDrive146.value));

// Calculates Total Optical Drive Wattage
var dvd_idle=(3*document.form1.DVD.value);
var dvd_max=(10*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);

// Calculates Total Ethernet XAUI Wattage
var ethernet_idle =(7*document.form1.ethernet.value);
var ethernet_max=(14*document.form1.ethernet.value);

var total_idle=system_idle+hdd_idle+dvd_idle+pci_idle+ethernet_idle-10;
var total_max=system_power+hdd_max+dvd_max+pci_max+ethernet_max-12;

var proc = (1*document.form1.Processor.value);
if (proc == 3)  {
	total_idle = total_idle-10;
	total_max = total_max-12;
}

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 ServerModule3(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;
// Model UltraSPARC T2+ 8-core CPUs (1.4 Ghz)
case 1: 
if ((1*document.form1.EightGbMemory.value)==12) {
max3=843;
idle3=704;
}
if ((1*document.form1.EightGbMemory.value)==24) {
max3=1019;
idle3=849;
}
if ((1*document.form1.EightGbMemory.value)==48) {
max3=1321;
idle3=1113;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=857;
idle1=709;
}
if ((1*document.form1.FourGbMemory.value)==24) {
max1=1062;
idle1=881;
}
if ((1*document.form1.FourGbMemory.value)==48) {
max1=1402;
idle1=1178;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=778;
idle2=677;
}
if ((1*document.form1.TwoGbMemory.value)==24) {
max2=934;
idle2=789;
}
if ((1*document.form1.TwoGbMemory.value)==48) {
max2=1155;
idle2=993;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.2 Ghz)
case 2: 
if ((1*document.form1.EightGbMemory.value)==12) {
max3=745;
idle3=624;
}
if ((1*document.form1.EightGbMemory.value)==24) {
max3=923;
idle3=781;
}
if ((1*document.form1.EightGbMemory.value)==48) {
max3=1230;
idle3=1037;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=766;
idle1=644;
}
if ((1*document.form1.FourGbMemory.value)==24) {
max1=967;
idle1=807;
}
if ((1*document.form1.FourGbMemory.value)==48) {
max1=1298;
idle1=1093;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=682;
idle2=585;
}
if ((1*document.form1.TwoGbMemory.value)==24) {
max2=834;
idle2=706;
}
if ((1*document.form1.TwoGbMemory.value)==48) {
max2=1056;
idle2=915;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.6 Ghz)
case 3: 
if ((1*document.form1.EightGbMemory.value)==12) {
max3=916;
idle3=759;
}
if ((1*document.form1.EightGbMemory.value)==24) {
max3=1112;
idle3=913;
}
if ((1*document.form1.EightGbMemory.value)==48) {
max3=1504;
idle3=1222;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=936;
idle1=767;
}
if ((1*document.form1.FourGbMemory.value)==24) {
max1=1146;
idle1=912;
}
if ((1*document.form1.FourGbMemory.value)==48) {
max1=1567;
idle1=1202;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=844;
idle2=733;
}
if ((1*document.form1.TwoGbMemory.value)==24) {
max2=976;
idle2=838;
}
if ((1*document.form1.TwoGbMemory.value)==48) {
max2=1240;
idle2=1049;
}
break;

}


if ((max1>max2)&&(max1>max3)) {
var system_power=(max1+(2.5*document.form1.TwoGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle1+(2*document.form1.TwoGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2+(5*document.form1.FourGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle2+(2*document.form1.FourGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3+(2.5*document.form1.FourGbMemory.value)+(2.5*document.form1.TwoGbMemory.value));
var system_idle=(idle3+(1.25*document.form1.FourGbMemory.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.sata.value)+(10*document.form1.HardDrive146.value));
var hdd_max=((2.4*document.form1.sata.value)+(12*document.form1.HardDrive146.value));

// Calculates Total Optical Drive Wattage
var dvd_idle=(3*document.form1.DVD.value);
var dvd_max=(10*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);

// Calculates Total Ethernet XAUI Wattage
var ethernet_idle =(7*document.form1.ethernet.value);
var ethernet_max=(14*document.form1.ethernet.value);

var total_idle=system_idle+hdd_idle+dvd_idle+pci_idle+ethernet_idle-10;
var total_max=system_power+hdd_max+dvd_max+pci_max+ethernet_max-12;

var proc = (1*document.form1.Processor.value);
if (proc == 3)  {
	total_idle = total_idle-10;
	total_max = total_max-12;
}

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 ServerModule4(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;
// Model UltraSPARC T2+ 8-core CPUs (1.4 Ghz)
case 1: 
if ((1*document.form1.EightGbMemory.value)==16) {
max3=1102;
idle3=839;
}
if ((1*document.form1.EightGbMemory.value)==32) {
max3=1387;
idle3=1040;
}
if ((1*document.form1.EightGbMemory.value)==64) {
max3=1787;
idle3=1401;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=1125;
idle1=855;
}
if ((1*document.form1.FourGbMemory.value)==32) {
max1=1355;
idle1=1040;
}
if ((1*document.form1.FourGbMemory.value)==64) {
max1=1785;
idle1=1420;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=1020;
idle2=820;
}
if ((1*document.form1.TwoGbMemory.value)==32) {
max2=1195;
idle2=950;
}
if ((1*document.form1.TwoGbMemory.value)==64) {
max2=1470;
idle2=1205;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.2 Ghz)
case 2: 
if ((1*document.form1.EightGbMemory.value)==16) {
max3=968;
idle3=752;
}
if ((1*document.form1.EightGbMemory.value)==32) {
max3=1217;
idle3=962;
}
if ((1*document.form1.EightGbMemory.value)==64) {
max3=1613;
idle3=1304;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=1030;
idle1=810;
}
if ((1*document.form1.FourGbMemory.value)==32) {
max1=1235;
idle1=980;
}
if ((1*document.form1.FourGbMemory.value)==64) {
max1=1685;
idle1=1360;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=935;
idle2=775;
}
if ((1*document.form1.TwoGbMemory.value)==32) {
max2=1090;
idle2=890;
}
if ((1*document.form1.TwoGbMemory.value)==64) {
max2=1400;
idle2=1150;
}
break;

// Model UltraSPARC T2+ 8-core CPUs (1.6 Ghz)
case 3: 
if ((1*document.form1.EightGbMemory.value)==16) {
max3=1256;
idle3=929;
}
if ((1*document.form1.EightGbMemory.value)==32) {
max3=1542;
idle3=1153;
}
if ((1*document.form1.EightGbMemory.value)==64) {
max3=2002;
idle3=1551;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=1308;
idle1=927;
}
if ((1*document.form1.FourGbMemory.value)==32) {
max1=1595;
idle1=1140;
}
if ((1*document.form1.FourGbMemory.value)==64) {
max1=2015;
idle1=1518;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=1113;
idle2=873;
}
if ((1*document.form1.TwoGbMemory.value)==32) {
max2=1355;
idle2=1049;
}
if ((1*document.form1.TwoGbMemory.value)==64) {
max2=1655;
idle2=1308;
}
break;

}


// Calculates Total Memory Usage
if ((max1>max2)&&(max1>max3)) {
var system_power=(max1+(2.5*document.form1.TwoGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle1+(2*document.form1.TwoGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2+(5*document.form1.FourGbMemory.value)+(2*document.form1.EightGbMemory.value));
var system_idle=(idle2+(2*document.form1.FourGbMemory.value)+(1.5*document.form1.EightGbMemory.value));
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3+(2.5*document.form1.FourGbMemory.value)+(2.5*document.form1.TwoGbMemory.value));
var system_idle=(idle3+(1.25*document.form1.FourGbMemory.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.sata.value)+(10*document.form1.HardDrive146.value));
var hdd_max=((2.4*document.form1.sata.value)+(12*document.form1.HardDrive146.value));

// Calculates Total Optical Drive Wattage
var dvd_idle=(3*document.form1.DVD.value);
var dvd_max=(10*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);

// Calculates Total Ethernet XAUI Wattage
var ethernet_idle =(7*document.form1.ethernet.value);
var ethernet_max=(14*document.form1.ethernet.value);

var total_idle=system_idle+hdd_idle+dvd_idle+pci_idle+ethernet_idle-10;
var total_max=system_power+hdd_max+dvd_max+pci_max+ethernet_max-12;

var proc = (1*document.form1.Processor.value);
if (proc == 3)  {
	total_idle = total_idle-10;
	total_max = total_max-12;
}

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) {
	  ServerModule1(a);
	} else if (b == 2) {
	  ServerModule2(a);
	} else if (b == 3) {
	  ServerModule3(a);
	} else if (b == 4) {
	  ServerModule4(a);
	}
}


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

function setPciOptions()  {
	var xaui = (1*document.form1.ethernet.value);

	var selbox = document.form1.pci;
	selbox.options.length = 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 (xaui < 2)	{
		selbox.options[selbox.options.length] = new Option('7 PCIe Cards','7');
	}
	if (xaui < 1)	{
		selbox.options[selbox.options.length] = new Option('8 PCIe Cards','8');
	}
}


function setOptions(chosen) {

var selbox1 = document.form1.EightGbMemory;
var selbox2 = document.form1.FourGbMemory;
var selbox3 = document.form1.TwoGbMemory;

selbox1.options.length = 0;
selbox2.options.length = 0;
selbox3.options.length = 0;


selbox1.options[selbox1.options.length] = new Option('None','0');
selbox2.options[selbox2.options.length] = new Option('None','0');
selbox3.options[selbox3.options.length] = new Option('None','0');

if (chosen == "1") {  

	selbox1.options[selbox1.options.length] = new Option('4 DIMMs','4');
  selbox1.options[selbox1.options.length] = new Option('8 DIMMs','8');
  selbox1.options[selbox1.options.length] = new Option('16 DIMMs','16');  

  selbox2.options[selbox2.options.length] = new Option('4 DIMMs','4');
  selbox2.options[selbox2.options.length] = new Option('8 DIMMs','8');
  selbox2.options[selbox2.options.length] = new Option('16 DIMMs','16');  
  
  selbox3.options[selbox3.options.length] = new Option('4 DIMMs','4');
  selbox3.options[selbox3.options.length] = new Option('8 DIMMs','8');
  selbox3.options[selbox3.options.length] = new Option('16 DIMMs','16');  
}

if (chosen == "2") {  

	selbox1.options[selbox1.options.length] = new Option('8 DIMMs','8');
  selbox1.options[selbox1.options.length] = new Option('16 DIMMs','16');
  selbox1.options[selbox1.options.length] = new Option('32 DIMMs','32');  

  selbox2.options[selbox2.options.length] = new Option('8 DIMMs','8');
  selbox2.options[selbox2.options.length] = new Option('16 DIMMs','16');
  selbox2.options[selbox2.options.length] = new Option('32 DIMMs','32');  

  selbox3.options[selbox3.options.length] = new Option('8 DIMMs','8');
  selbox3.options[selbox3.options.length] = new Option('16 DIMMs','16');
  selbox3.options[selbox3.options.length] = new Option('32 DIMMs','32');  
}

if (chosen == "3") {  

	selbox1.options[selbox1.options.length] = new Option('12 DIMMs','12');
  selbox1.options[selbox1.options.length] = new Option('24 DIMMs','24');
  selbox1.options[selbox1.options.length] = new Option('48 DIMMs','48');  

  selbox2.options[selbox2.options.length] = new Option('12 DIMMs','12');
  selbox2.options[selbox2.options.length] = new Option('24 DIMMs','24');
  selbox2.options[selbox2.options.length] = new Option('48 DIMMs','48');  

  selbox3.options[selbox3.options.length] = new Option('12 DIMMs','12');
  selbox3.options[selbox3.options.length] = new Option('24 DIMMs','24');
  selbox3.options[selbox3.options.length] = new Option('48 DIMMs','48');  
}

if (chosen == "4") {  

	selbox1.options[selbox1.options.length] = new Option('16 DIMMs','16');
  selbox1.options[selbox1.options.length] = new Option('32 DIMMs','32');  
  selbox1.options[selbox1.options.length] = new Option('64 DIMMs','64');

  selbox2.options[selbox2.options.length] = new Option('16 DIMMs','16');
  selbox2.options[selbox2.options.length] = new Option('32 DIMMs','32');  
  selbox2.options[selbox2.options.length] = new Option('64 DIMMs','64');

  selbox3.options[selbox3.options.length] = new Option('16 DIMMs','16');
  selbox3.options[selbox3.options.length] = new Option('32 DIMMs','32');  
  selbox3.options[selbox3.options.length] = new Option('64 DIMMs','64');
}

}


function PrintMenu() {
	var cpuQty = document.form1.Quantity.value;
  setOptions(cpuQty); 
}



function FinalCheck() {
//Checks to make sure user cannot proceed (Mozilla) if memory exceeds 16
if (((1*document.form1.FourGbMemory.value)+(1*document.form1.EightGbMemory.value)+(1*document.form1.TwoGbMemory.value))>64) {
stop
}
//Checks to make sure user cannot proceed (Mozilla) if no memory is selected
else if (((1*document.form1.EightGbMemory.value)+(1*document.form1.TwoGbMemory.value)+(1*document.form1.FourGbMemory.value))==0) {
stop
}
//Checks to make sure user cannot proceed (Mozilla) if hard drives are mixed
else if (((1*document.form1.HardDrive146.value)+(1*document.form1.sata.value))>4) {
stop
}
else {
proceed();
}
}


function CheckForm () { 

	//Initialise variables
	var errorMsg = "";


	//Check for DIMM quantity
	if ((document.form1.FourGbMemory.value == "0")&&(document.form1.TwoGbMemory.value == "0")&&(document.form1.EightGbMemory.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();
}

