// Java Document
ns4 = document.layers && true;
msie = document.all && true;
function winshow(displayit) {
	switch (displayit) {
		case(0): window.status=' ';
			break;
		case(1): window.status='Choose a Processor Type';
			break;
		case(2): window.status='Choose the Amount of Memory (RAM)';
			break;
		case(3): window.status='Choose the Primary Hard Drive';
			break;
		case(4): window.status='Choose the Secondary Hard Drive';
			break;
		case(5): window.status='Choose the Video Card';
			break;
		case(6): window.status='Choose the 1st Optical Drive';
			break;
		case(7): window.status='Choose the 2nd Optical Drive';
			break;
		case(8): window.status='Choose the Operating System';
			break;
		case(9): window.status='Choose the AMD Processor Speed';
			break;
		case(10): window.status='Choose the Intel Processor Speed';
			break; 
		case(11): window.status='Choose the Sound Card'
			break;
		case(12): window.status='Choose the Motherboard'
			break;} }
function printdetail() {
var AMD=false;
var Intel=false;
var BoardID=0;
var DualDDR=false;
var RAIDBoard=false;
var ilist = [0,0,0,0,0,0,0,0,0,0,0,0,0,0] ;
var totp = 0 ;

var cbase=68.00;//Base System Price (don't change)
//Determine if AMD or Intel for Processing the selected processor
if (Proc[0].checked) ilist[0]=form0.AMDPROC.value;
if (Proc[1].checked) ilist[0]=form0.IntelProc.value;
//Again, so much for else statement...always filters an error through
ilist[1]=form0.Memory.value;
ilist[2]=form0.HD1.value;
ilist[3]=form0.HD2.value;
ilist[4]=form0.Video.value;
ilist[5]=form0.Optical1.value;
ilist[6]=form0.Optical2.value;
ilist[7]=form0.OS.value;
ilist[8]=form0.Mboard.value;
ilist[9]=form0.Sound.value;
ilist[10]=form0.Software.value;
//totp=cbase;
//for (var i=0; i < 11; i++)
//	{
//	totp=totp+costadd[icost[i]];
//	alert(totp);
//	}
//form0.Price.value="$"+totp;
//form0.Price2.value="$"+totp;
//totalprice=totp;

//if (form0.AMDPROC.disabled) {AMD=false; Intel=true;BoardID=1}
//else {AMD=true; Intel=false; BoardID=0}
//alert (BoardID);	
//for (i=0; i<Boards[BoardID].length; i++)
//	{if (Boards[BoardID][i][1]==theone) {
//		OBVboard=Boards[BoardID][i][2]; 
//		RAIDBoard=Boards[BoardID][i][5];
//		DualDDR=Boards[BoardID][i][6]}
//	}
}
function proccheck(theone) {
var i=0;
var boardno=0;
//1st clear out the Motherboard list
for (i=0; i<form0.Mboard.options.length; i++) 
	{
	form0.Mboard.options[i]=null;
	}
if (theone[0].checked) { 
	form0.AMDPROC.disabled=false ; 
	form0.IntelProc.disabled=true; 
	//Rebuild the list with the AMD Motherboards
	for (i=0; i<Boards[0].length; i++) 
		{
		form0.Mboard[i]= new Option (Boards[0][i][0], Boards[0][i][1]);
		} 
	form0.Mboard.selectedIndex=2;
	boardno=Boards[0][2][1];
	}
if (theone[1].checked) { 
	form0.AMDPROC.disabled=true ;
	form0.IntelProc.disabled=false; 
//Rebuild the list with the Intel Motherboards
	for (i=0; i<Boards[1].length; i++)
		{
		form0.Mboard[i]= new Option (Boards[1][i][0], Boards[1][i][1]);
		} 
	form0.Mboard.selectedIndex=1;
	boardno=Boards[1][1][1];
	}
//Given up on using else statement...always gives error...some kind of JS support issue?
//Switch and successive if seems to work fine, though cumbersome programming
//Update video settings based on default board
Boardcheck(boardno);
return true}
//Some Global variables
var totalprice = 0.00;
var Boards = new Array(2);   //Motherboard options (2) for AMD/Intel
var Videos = new Array(2);   //video options (2) for now (Boards with OBV and without)
var Mem = new Array(2);      //memory options (2) for now (Boards needing Dual DDR and not)
var costadd = new Array(150);//cost basis for parts
//Need a way to read this data in from a database --> working on PHP implementation with mySQL
//1st variable in array identifies the board for list menus
//2nd variable in array numerically identifies for the cost array
//3rd variable in array will tell if the board support OBV
//...don't forget to put this in correctly as it will control video options
//4th variable tells whether supports all processors---> NYI
//5th variable tells whether supports S-ATA (probably can be removed later)---> NYI
//6th variable tells whether supports RAID 0/1 ---> NYI
//7th variable tells whether it uses Dual DDR 
//8th variable tells the location of product information ---> NYI
Boards[0]=[["",0,,,,,,""],["",0,,,,,,""],["",0,,,,,,""],["",0,,,,,,""]];
Boards[1]=[["",0,,,,,,""],["",0,,,,,,""],["",0,,,,,,""],["",0,,,,,,""]];
Boards[0][0]=["Asus A7V8X-MX",96,true,false,false,false,false,"http://usa.asus.com/products/mb/socketa/a7v8x-mx/overview.htm"];
Boards[0][1]=["Asus A7V8X-X",97,false,false,false,false,false,"http://usa.asus.com/products/mb/socketa/a7v8x-x/overview.htm"];
Boards[0][2]=["Asus A7N8X",98,false,true,true,true,false,"http://usa.asus.com/products/mb/socketa/a7n8x/overview.htm"];
Boards[0][3]=["Asus A7N8X-E Deluxe", 99,false,true,true,true,false,"http://usa.asus.com/products/mb/socketa/a7n8x-e-d/overview.htm"];
Boards[1][0]=["Chaintech 9VIFG",91,true,false,false,false,false,"http://www.chaintech.com.tw/tw/eng/product_spec.asp?MPSNo=13&PISNo=15"];
Boards[1][1]=["Intel 865 GLCL", 92,true,true,true,false,true,"http://usa.asus.com/products/mb/socket478/p4p800-vm/overview.htm"];
Boards[1][2]=["Asus P4P800", 93,false,true,true,true,true,"http://usa.asus.com/products/mb/socket478/p4p800/overview.htm"];
Boards[1][3]=["Asus P4P800 Deluxe", 94,false,true,true,true,true,"http://usa.asus.com/products/mb/socket478/p4p800-d/overview.htm"];
//List containing OBV
Videos[0]=[["On Board Video",51,""],["Radeon 9200SE 128MB",52,"http://www.ati.com/products/radeon9200/radeon9200/specs.html"],["Radeon 9600SE 128MB",53,"http://www.ati.com/products/radeon9600/radeon9600pro/specs.html "],["Radeon 9600 256MB",54,"http://www.ati.com/products/radeon9600/radeon9600pro/specs.html"],["Radeon 9600XT 256MB",55,"http://www.ati.com/products/radeon9600/radeon9600pro/specs.html"],["Radeon 9800 Pro 256MB",56,"http://www.ati.com/products/radeon9800/radeon9800pro/specs.html"],["Radeon 9800XT 256MB",57,"http://www.ati.com/products/radeon9800/radeon9800pro/specs.html"],["GeForce 5200 128MB",58,"http://www.nvidia.com/page/pg_20040109440047.html"],["GeForce 5900 128MB",59,"http://www.nvidia.com/page/pg_20040109265519.html"],["GeForce 5950 256MB",60,"http://www.nvidia.com/page/pg_20040109265519.html"]];
//List without OBV
Videos[1]=[["Radeon 9200SE 128MB",52,""],["Radeon 9600SE 128MB",53,""],["Radeon 9600 256MB",54,""],["Radeon 9600XT 256MB",55,""],["Radeon 9800 Pro 256MB",56,""],["Radeon 9800XT 256MB",57,""],["GeForce 5200 128MB",58,""],["GeForce 5900 128MB",59,""],["GeForce 5950 256MB",60,""]];
//Memory list
Mem[0]=[["128 MB", 21],["256MB", 22], ["512MB", 24], ["1GB", 26], ["2GB",28], ["4GB", 30]]
Mem[1]=[["256MB", 22], ["512MB", 24], ["1GB", 26], ["2GB",28], ["4GB", 30]]

//Intel Processors
costadd[1]=[80.00, "Intel Celeron 2.5 GHz 533 MHz FSB 256K Cache"];
costadd[2]=[115.00, "Intel Celeron 2.8 GHz 533 MHz FSB 256K Cache"];
costadd[3]=[153.00, "Intel Pentium4 2.8 GHz 800 MHz FSB 2MB Cache"];
costadd[4]=[188.00, "Intel Pentium4 3.0 GHz 800 MHz FSB 2MB Cache"];
costadd[5]=[212.00, "Intel Pentium4 3.2 GHz 800 MHz FSB 2MB Cache"];
costadd[6]=[278.00, "Intel Pentium4 3.4 GHz 800 MHz FSB 2MB Cache"];
//AMD Processors
costadd[11]=[70.00, "AMD Athlon 64 XP 2000+ 266 MHz FSB 384K Cache 1.67 GHz"];
costadd[12]=[89.00, "AMD Athlon 64 XP 2500+ 333 MHz FSB 512K Cache 1.83 GHz"];
costadd[13]=[109.00, "AMD Athlon 64 XP 2800+ 333 MHz FSB 512K Cache"];
costadd[14]=[200.00,"AMD Athlon 64 XP 3000+ 333 MHz FSB 512K Cache 2.16 GHz"];
costadd[15]=[250.00, "AMD Athlon 64 XP 3200+ 400 MHz FSB 512K Cache 2.2 GHz"];
costadd[16]=[500.00,"Error: Not a Choice"];
//Memory
costadd[21]=[35.00," Kingston 400 MHz DDR 256MB "];
costadd[22]=[52.00," Kingston 400 MHz DDR 512MB "];
costadd[23]=[52.00," Kingston 400 MHz DDR 1GB "];
costadd[24]=[119.00," Kingston 400 MHz DDR 2GB "];
costadd[25]=[119.00," Kingston 400 MHz DDR 4GB "];
costadd[26]=[244.00," Kingston 667 MHz DDR2 512MB"];
costadd[27]=[244.00," Kingston 667 MHz SDRAM 1GB"];
costadd[28]=[625.00," Kingston 667 MHz SDRAM 2GB"];
costadd[29]=[625.00," Kingston 667 MHz SDRAM 4GB"];
costadd[30]=[1295.00," Kingston 667 MHz SDRAM 8GB"];
//Hard Drive #1
costadd[31]=[63.00,"Hitachi 40GB 7200 RPM"];
costadd[32]=[67.00,"Hitachi 80GB 7200 RPM"];
costadd[33]=[98.00,"Western Digital 120GB 7200 RPM"];
costadd[34]=[132.00,"Hitachi 250GB 7200 RPM"];
costadd[35]=[71.00,"Hitachi 80GB 7200 RPM SATA"];
costadd[36]=[138.00,"Hitachi 250GB 7200 RPM SATA"];
costadd[40]=[0.00,""];
//Hard Drive #2
costadd[41]=[63.00,"Hitachi 40GB 7200 RPM"];
costadd[42]=[67.00,"Hitachi 80GB 7200 RPM"];
costadd[43]=[98.00,"Western Digital 120GB 7200 RPM"];
costadd[44]=[132.00,"Hitachi 250GB 7200 RPM"];
costadd[45]=[71.00,"Hitachi 80GB 7200 RPM SATA"];
costadd[46]=[138.00,"Hitachi 250GB 7200 RPM SATA"];
costadd[50]=[0.00,""];
//Video Card - moved Motherboard to seperate item
costadd[51]=[0.00,""];//On Board VIDEO
costadd[52]=[55.00,""];//Radeon 9200SE 128MB
costadd[53]=[75.00,""];//Radeon 9600SE 128MB
costadd[54]=[94.00,""];//Radeon 9600 256MB
costadd[55]=[189.00,""];//Radeon 9800 Pro 256MB
costadd[56]=[75.00,""];//Radeon XT300 128MB PCI-x
costadd[57]=[161.00,""];//Radeon XT700 256MB PCI-x
costadd[58]=[361.00,""];//Radeon XT850 256MB PCI-x
costadd[59]=[522.00,""];//Radeon XL1800 256MB PCI-x
costadd[60]=[341.00,""];//GeForce 5950 256MB
//Optical Drives #1
costadd[61]=[19.00,"52x CD-ROM"];
costadd[62]=[39.00,"16x DVD-ROM"];
costadd[63]=[39.00,"52X32X52X CD-RW"];
costadd[64]=[68.00,"16x8x16x Dual Layer DVD-RW"];
costadd[70]=[0.00,""];
//Optical Drives #2
costadd[71]=[19.00,"52x CD-ROM"];
costadd[72]=[39.00,"16x DVD-ROM"];
costadd[73]=[39.00,"52X32X52X CD-RW"];
costadd[74]=[68.00,"16x8x16x Dual Layer DVD-RW"];
costadd[80]=[0.00,""];
//Operating Systems
costadd[81]=[88.00,"Windows XP Home"] ;
costadd[82]=[158.00,"Windows XP Professional"] ;
costadd[83]=[95.00,"Windows 2000 Professional"] ;
costadd[90]=[0.00,""] ;
//Motherboards
costadd[91]=[60.00,""];//Chaintech 9VIFG - 533 MHz - OBV, OBS
costadd[92]=[108.00,""];//Intel 865GLCL - 800 MHz - OBV, OBS
costadd[93]=[108.00,""];//Intel 915GL - 800 MHz - PCI-x
costadd[94]=[118.00,""];//Asus P4P800 Deluxe
costadd[95]=[0.00,""];//Asus 
costadd[96]=[70.00,""];//Asus A7V8X-MX OBV, OBS
costadd[97]=[78.00,""];//Asus A7V8X-X OBS
costadd[98]=[109.00,""];//Asus A7N8X
costadd[99]=[129.00,""];//Asus A7N8X-E Deluxe
costadd[100]=[0.00,""];
//Sound
costadd[101]=[0.00,""];//On Board Sound (OBS)
costadd[102]=[25.00,""];//SB PCI 128
costadd[103]=[45.00,""];//SB Live 5.1
costadd[104]=[69.00,""];//SB Audigy Gamer
costadd[105]=[132.00,""];//SB Audigy 2 Gamer
costadd[106]=[192.00,""];//SB Audigy 2 Platinum
costadd[107]=[0.00,""];
costadd[108]=[0.00,""];
//Software
costadd[111]=[70.00,""];//Works Suite 2004
costadd[112]=[199.00,""];//Office 2003 Basic
costadd[113]=[349.00,""];//Office 2003 Pro
costadd[114]=[49.00,""];//WordPerfect Suite 2003
costadd[115]=[0.00,""];
costadd[116]=[0.00,""];
costadd[117]=[0.00,""];
costadd[120]=[0.00,""];//None
//End of costbasis

function Boardcheck(theone)
//Remove the OBV for motherboards that won't support it
{
var Intel=false;
var AMD=false;
var BoardID=2;
var i=0;
var OBVboard=false; //Indicate if this board supports OBV
var RAIDBoard=false; //Indicate if this board supports RAID 0/1
var DualDDR=false; //Indicate if this board requires Dual DDR (2 memory sticks)
//Strip out the Video list so that it can be rebuilt
for (i=0; i<form0.Video.options.length; i++) 
	{
	form0.Video.options[i]=null;
	}
//Strip out the memory list so that it can be rebuilt
for (i=0; i<form0.Memory.options.length; i++)
	{
	form0.Memory.options[i]=null;
	}
if (form0.AMDPROC.disabled) {AMD=false; Intel=true;BoardID=1}
else {AMD=true; Intel=false; BoardID=0}
//alert (BoardID);	
for (i=0; i<Boards[BoardID].length; i++)
	{if (Boards[BoardID][i][1]==theone) {
		OBVboard=Boards[BoardID][i][2]; 
		RAIDBoard=Boards[BoardID][i][5];
		DualDDR=Boards[BoardID][i][6]}
	}
//configure OBV settings	
if (OBVboard) {
	for (i=0; i<Videos[0].length; i++)
		{ form0.Video[i] = new Option (Videos[0][i][0], Videos[0][i][1]); } 
	form0.Video.selectedIndex=3;
	}
else	{
	for (i=0; i<Videos[1].length; i++)
		{ form0.Video[i] = new Option (Videos[1][i][0], Videos[1][i][1]); } 
	form0.Video.selectedIndex=2;
	}
//Configure RAID Settings
if (RAIDBoard) {
	form0.Raid[0].disabled=false;
	form0.Raid[1].disabled=false;
	}
else {
	form0.Raid[0].disabled=true;
	form0.Raid[1].disabled=true;
	}
//Remove Memory list and update prices
if (DualDDR) {
	for (i=0; i<Mem[1].length; i++)
		{ form0.Memory[i] = new Option (Mem[1][i][0], Mem[1][i][1]); }
	form0.Memory.selectedIndex=1
	costadd[21]=[35.00,""];//not available
	costadd[22]=[66.00,""];//256 - 128's
	costadd[23]=[110.00,""];//ignored
	costadd[24]=[98.00,""];//512 - 256's
	costadd[25]=[198.00,""];
	costadd[26]=[202.00,""];//1GB - 512's
	costadd[27]=[400.00,""];
	costadd[28]=[391.00,""];//2GB - 4 512's
	costadd[29]=[1225.00,""];
	costadd[30]=[1295.00,""];//4GB - 4 1GB
	}
else {
	for (i=0; i<Mem[0].length; i++)
		{ form0.Memory[i] = new Option (Mem[0][i][0], Mem[0][i][1]); }
	form0.Memory.selectedIndex=2
	costadd[21]=[35.00,""];//128
	costadd[22]=[52.00,""];//256 - 256
	costadd[23]=[110.00,""];//ignored
	costadd[24]=[88.00,""];//512 - 512
	costadd[25]=[198.00,""];//ignored
	costadd[26]=[202.00,""];//1GB - 512's
	costadd[27]=[400.00,""];//ignored
	costadd[28]=[391.00,""];//2GB - 4 512's
	costadd[29]=[1225.00,""];//ignored
	costadd[30]=[1295.00,""];//4GB - 4 1GB
}

}//end function BoardCheck

function proddet()
{}

function totcost(Proc) 
{
//Figure total cost of computer
var icost = [0,0,0,0,0,0,0,0,0,0,0,0,0,0] ;
var totp = 0 ;

var cbase=56.00;//Base System Price (don't change)
//Determine if AMD or Intel for Processing the selected processor
if (Proc[0].checked) icost[0]=form0.AMDPROC.value;
if (Proc[1].checked) icost[0]=form0.IntelProc.value;
//Again, so much for else statement...always filters an error through
icost[1]=form0.Memory.value;
icost[2]=form0.HD1.value;
icost[3]=form0.HD2.value;
icost[4]=form0.Video.value;
icost[5]=form0.Optical1.value;
icost[6]=form0.Optical2.value;
icost[7]=form0.OS.value;
icost[8]=form0.Mboard.value;
icost[9]=form0.Sound.value;
icost[10]=form0.Software.value;
totp=cbase;
//alert(totp);
for (var i=0; i < 11; i++)
	{
//		alert(costadd[icost[i]][0]);
	totp=totp+(costadd[icost[i]][0]);
//	alert(totp);
	}
//	alert(totp)
form0.Price.value="$"+totp;
form0.Price2.value="$"+totp;
totalprice=totp;
//alert(totalprice);
return true; 
}


