 

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; max2=0; idle2=0; max3=0; idle3=0;break;
// Case of Model 2218 HE CPUs (2.6 GHz / 55w) 
case 1: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=208;
idle1=161;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=214;
idle1=162;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=220;
idle1=164;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=226;
idle1=165;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=208;
idle1=155;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=214;
idle1=158;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=225;
idle1=162;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=236;
idle1=166;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=209;
idle2=161;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=215;
idle2=165;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=221;
idle2=165.5;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=227;
idle2=166;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=231.5;
idle2=166.5;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=236;
idle2=167;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=240.5;
idle2=167.5;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=245;
idle2=168;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=197;
idle3=153;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=202;
idle3=155;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=206;
idle3=156;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=209;
idle3=158;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=212;
idle3=159.5;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=215;
idle3=161;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=218;
idle3=162.5;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=221;
idle3=164;
}
break;
//Model 2222
case 2: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=224;
idle1=159;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=229;
idle1=160;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=234;
idle1=161;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=239;
idle1=162;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=222;
idle1=152;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=231;
idle1=154;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=243;
idle1=158;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=254;
idle1=162;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=265.5;
idle1=166;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=277;
idle1=170;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=288.5;
idle1=174;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=300;
idle1=178;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=225;
idle2=160;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=235;
idle2=162;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=237;
idle2=162;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=240;
idle2=162;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=244.5;
idle2=162.5;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=249;
idle2=163;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=253.5;
idle2=163.5;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=258;
idle2=164;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=212;
idle3=153;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=217;
idle3=153;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=220;
idle3=154;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=223;
idle3=155;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=226;
idle3=156.5;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=229;
idle3=158;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=232;
idle3=159.5;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=235;
idle3=161;
}

break;
//Model 2224 SE CPUs (3.2GHz / 105w)
case 3: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=224;
idle1=159;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=229;
idle1=160;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=234;
idle1=161;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=239;
idle1=162;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=255;
idle1=154;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=262;
idle1=156;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=273.5;
idle1=160;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=285;
idle1=164;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=296.5;
idle1=168;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=308;
idle1=172;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=319.5;
idle1=176;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=331;
idle1=180;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=260;
idle2=162;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=268;
idle2=165;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=272.5;
idle2=165.5;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=277;
idle2=166;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=281.5;
idle2=166.5;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=286;
idle2=167;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=290.5;
idle2=167.5;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=295;
idle2=168;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=238;
idle3=154;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=243;
idle3=155;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=246;
idle3=156.5;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=249;
idle3=158;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=252;
idle3=159.5;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=255;
idle3=161;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=258;
idle3=162.5;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=261;
idle3=164;
}

break;
//Model 2356 CPUs (2.3GHz / 75w)
case 4: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=239;
idle1=155;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=246;
idle1=159;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=253;
idle1=163;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=259;
idle1=167;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=219;
idle1=153;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=227;
idle1=156;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=234;
idle1=158;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=242;
idle1=161;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=371.5;
idle1=209;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=383;
idle1=213;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=394.5;
idle1=217;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=406;
idle1=221;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=221;
idle2=154;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=232;
idle2=159;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=242;
idle2=163;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=253;
idle2=168;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=368.5;
idle2=208.5;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=373;
idle2=209;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=377.5;
idle2=209.5;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=382;
idle2=210;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=216;
idle3=152;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=224;
idle3=154;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=232;
idle3=157;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=240;
idle3=159;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=317;
idle3=198.5;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=320;
idle3=200;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=323;
idle3=201.5;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=326;
idle3=203;
}

break;
//Model 2347 HE CPUs (1.9GHz / 55w)
case 5: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=199;
idle1=160;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=205;
idle1=161;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=211;
idle1=162;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=216;
idle1=163;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=204;
idle1=154;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=211;
idle1=157;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=222;
idle1=160;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=234;
idle1=164;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=240.5;
idle1=167;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=252;
idle1=171;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=263.5;
idle1=175;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=275;
idle1=179;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=200;
idle2=160;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=208;
idle2=163;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=213;
idle2=163;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=217;
idle2=164;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=221.5;
idle2=164.5;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=226;
idle2=165;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=230.5;
idle2=165.5;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=235;
idle2=166;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=202;
idle3=160;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=207;
idle3=161;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=210;
idle3=162;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=213;
idle3=164;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=202;
idle3=157.5;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=205;
idle3=159;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=208;
idle3=160.5;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=211;
idle3=162;
}
break;

//Model 2380 (2.5 GHz / 75w)
case 6: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=199;
idle1=143;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=210;
idle1=148;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=221;
idle1=153;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=231;
idle1=157;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=198;
idle1=143;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=206;
idle1=145;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=213;
idle1=148;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=221;
idle1=151;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=200;
idle2=144;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=211;
idle2=148;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=221;
idle2=153;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=232;
idle2=158;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=195;
idle3=142;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=203;
idle3=144;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=211;
idle3=146;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=219;
idle3=149;
}

break;
//Model 2384 (2.7 GHz / 75w)
case 7: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=208;
idle1=145;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=219;
idle1=150;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=230;
idle1=155;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=240;
idle1=159;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=207;
idle1=145;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=215;
idle1=147;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=222;
idle1=150;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=230;
idle1=153;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=209;
idle2=146;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=220;
idle2=150;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=230;
idle2=155;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=241;
idle2=160;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=204;
idle3=144;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=212;
idle3=146;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=220;
idle3=148;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=228;
idle3=151;
}
break;

//Model 2376HE (2.3 GHz / 75w)

case 8: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=194;
idle1=145;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=204;
idle1=149;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=214;
idle1=153;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=224;
idle1=157;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=193;
idle1=144;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=201;
idle1=147;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=209;
idle1=150;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=216;
idle1=153;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=195;
idle2=146;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=207;
idle2=150;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=219;
idle2=154;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=230;
idle2=158;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=191;
idle3=144;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=199;
idle3=146;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=206;
idle3=149;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=213;
idle3=151;
}
break;

//Model 2389 CPUs (2.9GHz)
case 9: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=208;
idle1=145;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=219;
idle1=150;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=230;
idle1=155;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=240;
idle1=159;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=207;
idle1=145;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=215;
idle1=147;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=222;
idle1=150;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=230;
idle1=153;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=209;
idle2=146;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=220;
idle2=150;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=230;
idle2=155;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=241;
idle2=160;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=204;
idle3=144;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=212;
idle3=146;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=220;
idle3=148;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=228;
idle3=151;
}
break;

//Model 2435 ( 2.6GHz /w) 
case 10: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=220;
idle1=140;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=228;
idle1=144;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=236;
idle1=148;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=244;
idle1=153;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=221;
idle1=140;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=228;
idle1=143;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=236;
idle1=146;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=244;
idle1=149;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=208;
idle2=139;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=217;
idle2=142;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=226;
idle2=144;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=235;
idle2=146;
}
break;

//Model 2431 ( 2.4GHz /w) 
case 11: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=220;
idle1=145;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=229;
idle1=150;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=238;
idle1=154;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=246;
idle1=158;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=221;
idle1=145;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=229;
idle1=148;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=238;
idle1=151;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=246;
idle1=155;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=208;
idle2=145;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=218;
idle2=147;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=227;
idle2=150;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=237;
idle2=152;
}
break;

//Model 2427 ( 2.2GHz /w) 
case 12: 
if ((1*document.form1.EightGbMemory.value)==2) {
max1=207;
idle1=139;
}
if ((1*document.form1.EightGbMemory.value)==4) {
max1=217;
idle1=143;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=227;
idle1=147;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=237;
idle1=152;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=208;
idle1=139;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=218;
idle1=142;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=227;
idle1=145;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=237;
idle1=148;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=196;
idle2=138;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=206;
idle2=141;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=217;
idle2=143;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=228;
idle2=145;
}
break;

}

if ((max1>max2)&&(max1>max3)) {
var system_power=(max1);
var system_idle=(idle1);
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2);
var system_idle=(idle2);
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3);
var system_idle=(idle3);
}
else {
var system_power=0;
var system_idle=0;
}

var proc = (1*document.form1.Processor.value);
if (proc == 9)  {
	system_power = (system_power + (system_power*0.03));
	system_idle = (system_idle + (system_idle*0.03));
}

var pci_idle=(12*document.form1.pci.value);
var pci_max=(20*document.form1.pci.value);

var hdd_idle=(10*document.form1.hdd.value);
var hdd_max=(12*document.form1.hdd.value);

var dvd=(10*document.form1.DVD.value);

var ssd_min=(0.1*document.form1.ssd.value);
var ssd_max=(2.4*document.form1.ssd.value);

var total_max=system_power+ssd_max+hdd_max+pci_max+dvd-32;
var total_idle=system_idle+ssd_min+hdd_idle+pci_idle+dvd-22;

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


document.form1.sys_tot.value=Math.round(tot);
document.form1.idle_tot.value=Math.round(total_idle);
document.form1.btu_power.value=Math.round((((document.form1.sys_tot.value*3600)/1055.056)*100)/100);
document.form1.btu_power2.value=Math.round((((document.form1.idle_tot.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; max2=0; idle2=0; max3=0; idle3=0;break;
// Case of Model 2218 HE CPUs (2.6 GHz / 55w) 
case 1: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=252;
idle1=176;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=264;
idle1=180;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=275;
idle1=184;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=286;
idle1=188;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=298;
idle1=192;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=309;
idle1=195;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=320;
idle1=199;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=255;
idle1=174;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=269;
idle1=179;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=281;
idle1=182;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=292;
idle1=185;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=302;
idle1=188;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=311;
idle1=190;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=320;
idle1=193;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=330;
idle1=196;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=251;
idle2=175;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=262;
idle2=179;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=272;
idle2=182;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=282;
idle2=185;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=291;
idle2=189;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=299;
idle2=192;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=308;
idle2=196;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=316;
idle2=199;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=245;
idle3=174;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=251;
idle3=176;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=255;
idle3=177;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=260;
idle3=178;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=263;
idle3=180;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=266;
idle3=181;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=269;
idle3=182;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=273;
idle3=183;
}
break;
//Model 2222 CPUs (3.0GHz / 75w)

case 2: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=296;
idle1=171;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=307;
idle1=175;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=318;
idle1=178;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=329;
idle1=182;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=340;
idle1=186;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=351;
idle1=189;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=362;
idle1=193;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=288;
idle1=169;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=302;
idle1=174;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=317;
idle1=177;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=332;
idle1=180;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=341;
idle1=183;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=350;
idle1=185;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=359;
idle1=188;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=367;
idle1=191;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=294;
idle2=171;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=306;
idle2=174;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=316;
idle2=178;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=326;
idle2=181;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=334;
idle2=184;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=342;
idle2=187;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=350;
idle2=191;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=358;
idle2=194;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=284;
idle3=169;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=291;
idle3=172;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=296;
idle3=173;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=301;
idle3=174;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=304;
idle3=175;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=307;
idle3=176;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=310;
idle3=177;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=313;
idle3=179;
}

break;
//Model 2224 SE CPUs (3.2GHz / 105w)
case 3: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=296;
idle1=171;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=307;
idle1=175;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=318;
idle1=178;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=329;
idle1=182;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=340;
idle1=186;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=351;
idle1=189;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=362;
idle1=193;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=352;
idle1=176;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=366;
idle1=181;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=381;
idle1=183.5;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=396;
idle1=186;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=404.75;
idle1=188.75;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=413.5;
idle1=191.5;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=422.25;
idle1=194.25;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=431;
idle1=197;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=364;
idle2=177;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=376;
idle2=180;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=386;
idle2=183.5;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=396;
idle2=187;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=404.25;
idle2=190.25;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=412.5;
idle2=193.5;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=420.75;
idle2=196.75;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=429;
idle2=200;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=358;
idle3=176;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=365;
idle3=179;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=370;
idle3=180;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=375;
idle3=181;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=377.75;
idle3=182;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=380.5;
idle3=183;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=383.25;
idle3=184;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=386;
idle3=185;
}

break;
//Model 2356 CPUs (2.3GHz / 75w)
case 4: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=336;
idle1=191;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=343;
idle1=194;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=350;
idle1=197;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=357;
idle1=200;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=364;
idle1=203;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=370;
idle1=205;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=377;
idle1=208;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=347;
idle1=211;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=317;
idle1=191;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=324;
idle1=194;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=331;
idle1=196;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=338;
idle1=199;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=345;
idle1=202;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=352;
idle1=204;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=359;
idle1=207;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=365;
idle2=215;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=331;
idle2=195;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=340;
idle2=199;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=349;
idle2=202;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=359;
idle2=206;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=368;
idle2=209;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=377;
idle2=213;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=386;
idle2=216;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=334;
idle3=210;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=309;
idle3=191;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=316;
idle3=193;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=323;
idle3=196;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=330;
idle3=198;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=336;
idle3=200;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=343;
idle3=203;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=350;
idle3=205;
}

break;
//Model 2347 HE CPUs (1.9GHz / 55w)
case 5: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=244;
idle1=176;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=256;
idle1=180;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=267;
idle1=184;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=278;
idle1=188;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=289;
idle1=191;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=300;
idle1=195;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=311;
idle1=198;
}
if ((1*document.form1.FourGbMemory.value)==2) {
max1=247;
idle1=199;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=261;
idle1=187;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=276;
idle1=190;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=291;
idle1=193;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=300;
idle1=196;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=309;
idle1=199;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=317;
idle1=201;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=326;
idle1=204;
}
if ((1*document.form1.TwoGbMemory.value)==2) {
max2=256;
idle2=199;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=255;
idle2=179;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=264;
idle2=183;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=274;
idle2=186;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=282;
idle2=189;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=290;
idle2=193;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=299;
idle2=196;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=307;
idle2=199;
}
if ((1*document.form1.OneGbMemory.value)==2) {
max3=235;
idle3=198;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=254;
idle3=183;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=259;
idle3=184;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=264;
idle3=185;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=267;
idle3=186;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=270;
idle3=187;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=273;
idle3=188;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=276;
idle3=189;
}

break;
//Model 2380 (2.5 GHz / 75w)
case 6: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=279;
idle1=171;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=291;
idle1=175;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=302;
idle1=179;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=314;
idle1=183;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=325;
idle1=187;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=337;
idle1=190;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=348;
idle1=194;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=275;
idle1=170;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=282;
idle1=173;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=289;
idle1=175;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=296;
idle1=178;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=303;
idle1=181;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=310;
idle1=183;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=317;
idle1=186;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=289;
idle2=174;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=298;
idle2=178;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=307;
idle2=181;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=317;
idle2=185;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=326;
idle2=188;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=335;
idle2=192;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=344;
idle2=195;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=267;
idle3=170;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=274;
idle3=172;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=281;
idle3=175;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=288;
idle3=177;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=294;
idle3=179;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=301;
idle3=182;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=308;
idle3=184;
}

break;
//Model 2384 (2.7 GHz / 75w)
case 7: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=297;
idle1=175;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=309;
idle1=179;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=320;
idle1=183;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=332;
idle1=187;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=343;
idle1=191;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=355;
idle1=195;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=366;
idle1=199;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=293;
idle1=174;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=300;
idle1=177;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=307;
idle1=180;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=314;
idle1=182;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=321;
idle1=185;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=328;
idle1=188;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=335;
idle1=190;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=307;
idle2=178;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=316;
idle2=182;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=325;
idle2=185;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=335;
idle2=189;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=344;
idle2=192;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=353;
idle2=196;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=362;
idle2=199;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=285;
idle3=174;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=292;
idle3=177;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=299;
idle3=179;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=306;
idle3=181;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=312;
idle3=184;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=319;
idle3=186;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=326;
idle3=188;
}
break;

//Model 2376HE (2.3 GHz / 75w)
case 8: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=257;
idle1=174;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=269;
idle1=178;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=280;
idle1=182;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=292;
idle1=186;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=303;
idle1=190;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=315;
idle1=194;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=326;
idle1=198;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=259;
idle1=173;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=267;
idle1=175;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=274;
idle1=177;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=282;
idle1=180;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=290;
idle1=182;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=298;
idle1=185;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=306;
idle1=187;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=267;
idle2=177;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=277;
idle2=181;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=286;
idle2=184;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=295;
idle2=188;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=304;
idle2=191;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=313;
idle2=195;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=322;
idle2=198;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=256;
idle3=172;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=264;
idle3=174;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=272;
idle3=176;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=280;
idle3=178;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=289;
idle3=181;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=297;
idle3=183;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=305;
idle3=185;
}
break;

//Model 2389 CPUs (2.9GHz)
case 9: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=297;
idle1=175;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=309;
idle1=179;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=320;
idle1=183;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=332;
idle1=187;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=343;
idle1=191;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=355;
idle1=195;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=366;
idle1=199;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=293;
idle1=174;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=300;
idle1=177;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=307;
idle1=180;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=314;
idle1=182;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=321;
idle1=185;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=328;
idle1=188;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=335;
idle1=190;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=307;
idle2=178;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=316;
idle2=182;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=325;
idle2=185;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=335;
idle2=189;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=344;
idle2=192;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=353;
idle2=196;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=362;
idle2=199;
}
if ((1*document.form1.OneGbMemory.value)==4) {
max3=285;
idle3=174;
}
if ((1*document.form1.OneGbMemory.value)==6) {
max3=292;
idle3=177;
}
if ((1*document.form1.OneGbMemory.value)==8) {
max3=299;
idle3=179;
}
if ((1*document.form1.OneGbMemory.value)==10) {
max3=306;
idle3=181;
}
if ((1*document.form1.OneGbMemory.value)==12) {
max3=312;
idle3=184;
}
if ((1*document.form1.OneGbMemory.value)==14) {
max3=319;
idle3=186;
}
if ((1*document.form1.OneGbMemory.value)==16) {
max3=326;
idle3=188;
}
break;

//Model 2435 CPUs (2.6 GHz)
case 10: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=335;
idle1=182;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=345;
idle1=185;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=355;
idle1=189;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=366;
idle1=192;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=376;
idle1=195;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=386;
idle1=199;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=396;
idle1=202;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=336;
idle1=184;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=345;
idle1=187;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=355;
idle1=189;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=364;
idle1=192;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=374;
idle1=195;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=383;
idle1=198;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=393;
idle1=201;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=320;
idle2=183;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=328;
idle2=185;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=336;
idle2=187;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=344;
idle2=188;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=352;
idle2=190;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=360;
idle2=192;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=368;
idle2=194;
}
break;

//Model 2431 CPUs (2.4 GHz)
case 11: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=313;
idle1=175;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=322;
idle1=179;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=332;
idle1=182;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=342;
idle1=186;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=351;
idle1=189;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=361;
idle1=193;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=370;
idle1=197;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=314;
idle1=177;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=323;
idle1=180;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=331;
idle1=183;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=340;
idle1=186;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=349;
idle1=189;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=358;
idle1=192;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=367;
idle1=195;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=297;
idle2=176;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=305;
idle2=178;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=312;
idle2=180;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=320;
idle2=182;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=327;
idle2=184;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=335;
idle2=186;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=342;
idle2=188;
}
break;

//Model 2427 CPUs (2.2 GHz)
case 12: 
if ((1*document.form1.EightGbMemory.value)==4) {
max1=299;
idle1=165;
}
if ((1*document.form1.EightGbMemory.value)==6) {
max1=307;
idle1=168;
}
if ((1*document.form1.EightGbMemory.value)==8) {
max1=315;
idle1=172;
}
if ((1*document.form1.EightGbMemory.value)==10) {
max1=324;
idle1=175;
}
if ((1*document.form1.EightGbMemory.value)==12) {
max1=332;
idle1=178;
}
if ((1*document.form1.EightGbMemory.value)==14) {
max1=340;
idle1=182;
}
if ((1*document.form1.EightGbMemory.value)==16) {
max1=348;
idle1=185;
}
if ((1*document.form1.FourGbMemory.value)==4) {
max1=300;
idle1=166;
}
if ((1*document.form1.FourGbMemory.value)==6) {
max1=307;
idle1=169;
}
if ((1*document.form1.FourGbMemory.value)==8) {
max1=315;
idle1=172;
}
if ((1*document.form1.FourGbMemory.value)==10) {
max1=345;
idle1=184;
}
if ((1*document.form1.FourGbMemory.value)==12) {
max1=330;
idle1=178;
}
if ((1*document.form1.FourGbMemory.value)==14) {
max1=337;
idle1=181;
}
if ((1*document.form1.FourGbMemory.value)==16) {
max1=345;
idle1=184;
}
if ((1*document.form1.TwoGbMemory.value)==4) {
max2=283;
idle2=166;
}
if ((1*document.form1.TwoGbMemory.value)==6) {
max2=289;
idle2=168;
}
if ((1*document.form1.TwoGbMemory.value)==8) {
max2=296;
idle2=169;
}
if ((1*document.form1.TwoGbMemory.value)==10) {
max2=302;
idle2=171;
}
if ((1*document.form1.TwoGbMemory.value)==12) {
max2=308;
idle2=173;
}
if ((1*document.form1.TwoGbMemory.value)==14) {
max2=314;
idle2=175;
}
if ((1*document.form1.TwoGbMemory.value)==16) {
max2=320;
idle2=177;
}
break;
}

if ((max1>max2)&&(max1>max3)) {
var system_power=(max1+(5*document.form1.TwoGbMemory.value)+(2*document.form1.OneGbMemory.value));
var system_idle=(idle1+(1.5*document.form1.TwoGbMemory.value)+(1*document.form1.OneGbMemory.value));
}
else if ((max2>max1)&&(max2>max3)) {
var system_power=(max2+(4.75*document.form1.FourGbMemory.value)+(2*document.form1.OneGbMemory.value));
var system_idle=(idle2+(1.5*document.form1.FourGbMemory.value)+(1*document.form1.OneGbMemory.value));
}
else if ((max3>max2)&&(max3>max1)) {
var system_power=(max3+(4.75*document.form1.FourGbMemory.value)+(5*document.form1.TwoGbMemory.value));
var system_idle=(idle3+(1.5*document.form1.FourGbMemory.value)+(1.5*document.form1.TwoGbMemory.value));
}
else {
var system_power=0;
var system_idle=0;
}

var proc = (1*document.form1.Processor.value);
if (proc == 9)  {
	system_power = (system_power + (system_power*0.03));
	system_idle = (system_idle + (system_idle*0.03));
}

var pci_idle=(12*document.form1.pci.value);
var pci_max=(20*document.form1.pci.value);

var hdd_idle=(10*document.form1.hdd.value);
var hdd_max=(12*document.form1.hdd.value);

var dvd=(10*document.form1.DVD.value);

var ssd_min=(0.1*document.form1.ssd.value);
var ssd_max=(2.4*document.form1.ssd.value);

var total_max=system_power+ssd_max+hdd_max+pci_max+dvd-32;
var total_idle=system_idle+ssd_min+hdd_idle+pci_idle+dvd-22;

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


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

}


function setOptions(chosen) {
var selbox = document.form1.FourGbMemory;
 
selbox.options.length = 0;
if (chosen == " ") {
  selbox.options[selbox.options.length] = new Option('None','0');
 
}
if (chosen == "1") {
  selbox.options[selbox.options.length] = new Option('None','0');
  selbox.options[selbox.options.length] = new Option('2 DIMMs','2');
  selbox.options[selbox.options.length] = new Option('4 DIMMs','4');
  selbox.options[selbox.options.length] = new Option('6 DIMMs','6');
  selbox.options[selbox.options.length] = new Option('8 DIMMs','8');  
}
if (chosen == "2") {
  selbox.options[selbox.options.length] = new Option('None','0');  
  selbox.options[selbox.options.length] = new Option('4 DIMMs','4');
  selbox.options[selbox.options.length] = new Option('6 DIMMs','6');
  selbox.options[selbox.options.length] = new Option('8 DIMMs','8');
  selbox.options[selbox.options.length] = new Option('10 DIMMs','10');
  selbox.options[selbox.options.length] = new Option('12 DIMMs','12');
  selbox.options[selbox.options.length] = new Option('14 DIMMs','14');
  selbox.options[selbox.options.length] = new Option('16 DIMMs','16');
}
}


 function setOptions2(chosen) {
 var selbox2 = document.form1.TwoGbMemory;
 
selbox2.options.length = 0;
if (chosen == " ") {
  selbox2.options[selbox2.options.length] = new Option('None','0');
 
}
if (chosen == "1") {
  selbox2.options[selbox2.options.length] = new Option('None','0');
  selbox2.options[selbox2.options.length] = new Option('2 DIMMs','2');
  selbox2.options[selbox2.options.length] = new Option('4 DIMMs','4');
  selbox2.options[selbox2.options.length] = new Option('6 DIMMs','6');
  selbox2.options[selbox2.options.length] = new Option('8 DIMMs','8');  
}
if (chosen == "2") {
  selbox2.options[selbox2.options.length] = new Option('None','0');  
  selbox2.options[selbox2.options.length] = new Option('4 DIMMs','4');
  selbox2.options[selbox2.options.length] = new Option('6 DIMMs','6');
  selbox2.options[selbox2.options.length] = new Option('8 DIMMs','8');
  selbox2.options[selbox2.options.length] = new Option('10 DIMMs','10');
  selbox2.options[selbox2.options.length] = new Option('12 DIMMs','12');
  selbox2.options[selbox2.options.length] = new Option('14 DIMMs','14');
  selbox2.options[selbox2.options.length] = new Option('16 DIMMs','16');
}
}

 function setOptions3(chosen) {
 var selbox3 = document.form1.OneGbMemory;
 var proc = (1*document.form1.Processor.value);
 
selbox3.options.length = 0;
if (chosen == " " || proc == 10 || proc == 11 || proc == 12 ) {
  selbox3.options[selbox3.options.length] = new Option('N/A','0');
} if (chosen == "1") {
  selbox3.options[selbox3.options.length] = new Option('None','0');
  selbox3.options[selbox3.options.length] = new Option('2 DIMMs','2');
  selbox3.options[selbox3.options.length] = new Option('4 DIMMs','4');
  selbox3.options[selbox3.options.length] = new Option('6 DIMMs','6');
  selbox3.options[selbox3.options.length] = new Option('8 DIMMs','8');
} else if (chosen == "2") {
  selbox3.options[selbox3.options.length] = new Option('None','0');  
  selbox3.options[selbox3.options.length] = new Option('4 DIMMs','4');
  selbox3.options[selbox3.options.length] = new Option('6 DIMMs','6');
  selbox3.options[selbox3.options.length] = new Option('8 DIMMs','8');
  selbox3.options[selbox3.options.length] = new Option('10 DIMMs','10');
  selbox3.options[selbox3.options.length] = new Option('12 DIMMs','12');
  selbox3.options[selbox3.options.length] = new Option('14 DIMMs','14');
  selbox3.options[selbox3.options.length] = new Option('16 DIMMs','16');
}
}

 function setOptions4(chosen) {
 var selbox3 = document.form1.EightGbMemory;
 
selbox3.options.length = 0;
if (chosen == " ") {
  selbox3.options[selbox3.options.length] = new Option('None','0');
}
if (chosen == "1") {
  selbox3.options[selbox3.options.length] = new Option('None','0');
  selbox3.options[selbox3.options.length] = new Option('2 DIMMs','2');
  selbox3.options[selbox3.options.length] = new Option('4 DIMMs','4');
  selbox3.options[selbox3.options.length] = new Option('6 DIMMs','6');
  selbox3.options[selbox3.options.length] = new Option('8 DIMMs','8');
}
if (chosen == "2") {
  selbox3.options[selbox3.options.length] = new Option('None','0');  
  selbox3.options[selbox3.options.length] = new Option('4 DIMMs','4');
  selbox3.options[selbox3.options.length] = new Option('6 DIMMs','6');
  selbox3.options[selbox3.options.length] = new Option('8 DIMMs','8');
  selbox3.options[selbox3.options.length] = new Option('10 DIMMs','10');
  selbox3.options[selbox3.options.length] = new Option('12 DIMMs','12');
  selbox3.options[selbox3.options.length] = new Option('14 DIMMs','14');
  selbox3.options[selbox3.options.length] = new Option('16 DIMMs','16');
}
}

 

function PrintMenu() {
if (document.form1.Quantity.value == 1) {
setOptions('1'); setOptions2('1'); setOptions3('1'); setOptions4('1');
}
else if (document.form1.Quantity.value == 2) {
setOptions('2'); setOptions2('2'); setOptions3('2');setOptions4('2');
}
}

function proceed() {
var a=1*document.form1.Quantity.value;
var b=1*document.form1.Processor.value;
if (a==1) {
ServerModule(b);
}
else if (a==2) {
ServerModule2(b);
}
}

function CheckForm () { 

	//Initialise variables
	var errorMsg = "";


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



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

