function RD()
{
	alert("jjj");
}
function calculate3()
{
// Variables
var panel_cost_perfoot	= 3
var panel_type = new Array()
var estimate_array = new Array()
var worksheet		= new Array()

var top1index		= document.forms[0].TOPTRACK1.selectedIndex;
var bot1index		= document.forms[0].BOTTRACK1.selectedIndex;
var size1index		= document.forms[0].STOCKSIZE1.selectedIndex;
var top2index		= document.forms[0].TOPTRACK2.selectedIndex;
var bot2index		= document.forms[0].BOTTRACK2.selectedIndex;
var size2index		= document.forms[0].STOCKSIZE2.selectedIndex;
var top3index		= document.forms[0].TOPTRACK3.selectedIndex;
var bot3index		= document.forms[0].BOTTRACK3.selectedIndex;
var size3index		= document.forms[0].STOCKSIZE3.selectedIndex;
var top4index		= document.forms[0].TOPTRACK4.selectedIndex;
var bot4index		= document.forms[0].BOTTRACK4.selectedIndex;
var size4index		= document.forms[0].STOCKSIZE4.selectedIndex;
var top5index		= document.forms[0].TOPTRACK5.selectedIndex;
var bot5index		= document.forms[0].BOTTRACK5.selectedIndex;
var size5index		= document.forms[0].STOCKSIZE5.selectedIndex;
var top6index		= document.forms[0].TOPTRACK6.selectedIndex;
var bot6index		= document.forms[0].BOTTRACK6.selectedIndex;
var size6index		= document.forms[0].STOCKSIZE6.selectedIndex;
var top7index		= document.forms[0].TOPTRACK7.selectedIndex;
var bot7index		= document.forms[0].BOTTRACK7.selectedIndex;
var size7index		= document.forms[0].STOCKSIZE7.selectedIndex;
var top8index		= document.forms[0].TOPTRACK8.selectedIndex;
var bot8index		= document.forms[0].BOTTRACK8.selectedIndex;
var size8index		= document.forms[0].STOCKSIZE8.selectedIndex;
var top9index		= document.forms[0].TOPTRACK9.selectedIndex;
var bot9index		= document.forms[0].BOTTRACK9.selectedIndex;
var size9index		= document.forms[0].STOCKSIZE9.selectedIndex;
var top10index		= document.forms[0].TOPTRACK10.selectedIndex;
var bot10index		= document.forms[0].BOTTRACK10.selectedIndex;
var size10index		= document.forms[0].STOCKSIZE10.selectedIndex;
var top11index		= document.forms[0].TOPTRACK11.selectedIndex;
var bot11index		= document.forms[0].BOTTRACK11.selectedIndex;
var size11index		= document.forms[0].STOCKSIZE11.selectedIndex;
var top12index		= document.forms[0].TOPTRACK12.selectedIndex;
var bot12index		= document.forms[0].BOTTRACK12.selectedIndex;
var size12index		= document.forms[0].STOCKSIZE12.selectedIndex;
var top13index		= document.forms[0].TOPTRACK13.selectedIndex;
var bot13index		= document.forms[0].BOTTRACK13.selectedIndex;
var size13index		= document.forms[0].STOCKSIZE13.selectedIndex;
var top14index		= document.forms[0].TOPTRACK14.selectedIndex;
var bot14index		= document.forms[0].BOTTRACK14.selectedIndex;
var size14index		= document.forms[0].STOCKSIZE14.selectedIndex;
var top15index		= document.forms[0].TOPTRACK15.selectedIndex;
var bot15index		= document.forms[0].BOTTRACK15.selectedIndex;
var size15index		= document.forms[0].STOCKSIZE15.selectedIndex;
var top16index		= document.forms[0].TOPTRACK16.selectedIndex;
var bot16index		= document.forms[0].BOTTRACK16.selectedIndex;
var size16index		= document.forms[0].STOCKSIZE16.selectedIndex;
var top17index		= document.forms[0].TOPTRACK17.selectedIndex;
var bot17index		= document.forms[0].BOTTRACK17.selectedIndex;
var size17index		= document.forms[0].STOCKSIZE17.selectedIndex;
var top18index		= document.forms[0].TOPTRACK18.selectedIndex;
var bot18index		= document.forms[0].BOTTRACK18.selectedIndex;
var size18index		= document.forms[0].STOCKSIZE18.selectedIndex;
var top19index		= document.forms[0].TOPTRACK19.selectedIndex;
var bot19index		= document.forms[0].BOTTRACK19.selectedIndex;
var size19index		= document.forms[0].STOCKSIZE19.selectedIndex;
var top20index		= document.forms[0].TOPTRACK20.selectedIndex;
var bot20index		= document.forms[0].BOTTRACK20.selectedIndex;
var size20index		= document.forms[0].STOCKSIZE20.selectedIndex;
var top21index		= document.forms[0].TOPTRACK21.selectedIndex;
var bot21index		= document.forms[0].BOTTRACK22.selectedIndex;
var size21index		= document.forms[0].STOCKSIZE21.selectedIndex;
var top22index		= document.forms[0].TOPTRACK22.selectedIndex;
var bot22index		= document.forms[0].BOTTRACK2.selectedIndex;
var size22index		= document.forms[0].STOCKSIZE22.selectedIndex;
var top23index		= document.forms[0].TOPTRACK23.selectedIndex;
var bot23index		= document.forms[0].BOTTRACK23.selectedIndex;
var size23index		= document.forms[0].STOCKSIZE23.selectedIndex;
var top24index		= document.forms[0].TOPTRACK24.selectedIndex;
var bot24index		= document.forms[0].BOTTRACK24.selectedIndex;
var size24index		= document.forms[0].STOCKSIZE24.selectedIndex;
var top25index		= document.forms[0].TOPTRACK25.selectedIndex;
var bot25index		= document.forms[0].BOTTRACK25.selectedIndex;
var size25index		= document.forms[0].STOCKSIZE25.selectedIndex;




//document.forms[0].totalopenings.value = 0;
document.forms[0].subtotal.value		= parseInt(0);
document.forms[0].Totalpanels.value		= parseInt(0);
document.forms[0].costofpanels.value	= parseInt(0);
document.forms[0].costoftracks.value	= parseInt(0);
document.forms[0].totalsquarefeet.value = parseInt(0);
panel_type[0,1]	= "Aluminum .040"
panel_type[0,2]	=	2.5
panel_type[1,1]	= "Aluminum .050"
panel_type[1,2]	=	2.75 


worksheet[1] = new loadsheet(	document.forms[0].QUANTITY1.value,
								document.forms[0].STOCKSIZE1.options[size1index].value,
								document.forms[0].TOPTRACK1.options[top1index].value,
								document.forms[0].BOTTRACK1.options[bot1index].value);
								
worksheet[2] = new loadsheet(	document.forms[0].QUANTITY2.value,
								document.forms[0].STOCKSIZE2.options[size2index].value,
								document.forms[0].TOPTRACK2.options[top2index].value,
								document.forms[0].BOTTRACK2.options[bot2index].value);
								
worksheet[3] = new loadsheet(	document.forms[0].QUANTITY3.value,
								document.forms[0].STOCKSIZE3.options[size3index].value,
								document.forms[0].TOPTRACK3.options[top3index].value,
								document.forms[0].BOTTRACK3.options[bot3index].value);			
								
worksheet[4] = new loadsheet(	document.forms[0].QUANTITY4.value,
								document.forms[0].STOCKSIZE4.options[size4index].value,
								document.forms[0].TOPTRACK4.options[top4index].value,
								document.forms[0].BOTTRACK4.options[bot4index].value);
								
worksheet[5] = new loadsheet(	document.forms[0].QUANTITY5.value,
								document.forms[0].STOCKSIZE5.options[size5index].value,
								document.forms[0].TOPTRACK5.options[top5index].value,
								document.forms[0].BOTTRACK5.options[bot5index].value);
								
worksheet[6] = new loadsheet(	document.forms[0].QUANTITY6.value,
								document.forms[0].STOCKSIZE6.options[size6index].value,
								document.forms[0].TOPTRACK6.options[top6index].value,
								document.forms[0].BOTTRACK6.options[bot6index].value);		
								
worksheet[7] = new loadsheet(	document.forms[0].QUANTITY7.value,
								document.forms[0].STOCKSIZE7.options[size7index].value,
								document.forms[0].TOPTRACK7.options[top7index].value,
								document.forms[0].BOTTRACK7.options[bot7index].value);
								
worksheet[8] = new loadsheet(	document.forms[0].QUANTITY8.value,
								document.forms[0].STOCKSIZE8.options[size8index].value,
								document.forms[0].TOPTRACK8.options[top8index].value,
								document.forms[0].BOTTRACK8.options[bot8index].value);
								
worksheet[9] = new loadsheet(	document.forms[0].QUANTITY9.value,
								document.forms[0].STOCKSIZE9.options[size9index].value,
								document.forms[0].TOPTRACK9.options[top9index].value,
								document.forms[0].BOTTRACK9.options[bot9index].value);	
worksheet[10] = new loadsheet(	document.forms[0].QUANTITY10.value,
								document.forms[0].STOCKSIZE10.options[size10index].value,
								document.forms[0].TOPTRACK10.options[top10index].value,
								document.forms[0].BOTTRACK10.options[bot10index].value);
								
worksheet[11] = new loadsheet(	document.forms[0].QUANTITY11.value,
								document.forms[0].STOCKSIZE11.options[size11index].value,
								document.forms[0].TOPTRACK11.options[top11index].value,
								document.forms[0].BOTTRACK11.options[bot11index].value);
								
worksheet[12] = new loadsheet(	document.forms[0].QUANTITY12.value,
								document.forms[0].STOCKSIZE12.options[size12index].value,
								document.forms[0].TOPTRACK12.options[top12index].value,
								document.forms[0].BOTTRACK12.options[bot12index].value);		
								
worksheet[13] = new loadsheet(	document.forms[0].QUANTITY13.value,
								document.forms[0].STOCKSIZE13.options[size13index].value,
								document.forms[0].TOPTRACK13.options[top13index].value,
								document.forms[0].BOTTRACK13.options[bot13index].value);
								
worksheet[14] = new loadsheet(	document.forms[0].QUANTITY14.value,
								document.forms[0].STOCKSIZE14.options[size14index].value,
								document.forms[0].TOPTRACK14.options[top14index].value,
								document.forms[0].BOTTRACK14.options[bot14index].value);
								
worksheet[15] = new loadsheet(	document.forms[0].QUANTITY15.value,
								document.forms[0].STOCKSIZE15.options[size15index].value,
								document.forms[0].TOPTRACK15.options[top15index].value,
								document.forms[0].BOTTRACK15.options[bot15index].value);		
worksheet[16] = new loadsheet(	document.forms[0].QUANTITY16.value,
								document.forms[0].STOCKSIZE16.options[size16index].value,
								document.forms[0].TOPTRACK16.options[top16index].value,
								document.forms[0].BOTTRACK16.options[bot16index].value);
								
worksheet[17] = new loadsheet(	document.forms[0].QUANTITY17.value,
								document.forms[0].STOCKSIZE17.options[size17index].value,
								document.forms[0].TOPTRACK17.options[top17index].value,
								document.forms[0].BOTTRACK17.options[bot17index].value);

worksheet[18] = new loadsheet(	document.forms[0].QUANTITY18.value,
								document.forms[0].STOCKSIZE18.options[size18index].value,
								document.forms[0].TOPTRACK18.options[top18index].value,
								document.forms[0].BOTTRACK18.options[bot18index].value);
																
worksheet[19] = new loadsheet(	document.forms[0].QUANTITY19.value,
								document.forms[0].STOCKSIZE19.options[size19index].value,
								document.forms[0].TOPTRACK19.options[top19index].value,
								document.forms[0].BOTTRACK19.options[bot19index].value);
								
worksheet[20] = new loadsheet(	document.forms[0].QUANTITY20.value,
								document.forms[0].STOCKSIZE20.options[size20index].value,
								document.forms[0].TOPTRACK20.options[top20index].value,
								document.forms[0].BOTTRACK20.options[bot20index].value);

worksheet[21] = new loadsheet(	document.forms[0].QUANTITY21.value,
								document.forms[0].STOCKSIZE21.options[size21index].value,
								document.forms[0].TOPTRACK21.options[top21index].value,
								document.forms[0].BOTTRACK21.options[bot21index].value);

worksheet[22] = new loadsheet(	document.forms[0].QUANTITY22.value,
								document.forms[0].STOCKSIZE22.options[size22index].value,
								document.forms[0].TOPTRACK22.options[top22index].value,
								document.forms[0].BOTTRACK22.options[bot22index].value);

worksheet[23] = new loadsheet(	document.forms[0].QUANTITY23.value,
								document.forms[0].STOCKSIZE23.options[size23index].value,
								document.forms[0].TOPTRACK23.options[top23index].value,
								document.forms[0].BOTTRACK23.options[bot23index].value);

worksheet[24] = new loadsheet(	document.forms[0].QUANTITY24.value,
								document.forms[0].STOCKSIZE24.options[size24index].value,
								document.forms[0].TOPTRACK24.options[top24index].value,
								document.forms[0].BOTTRACK24.options[bot24index].value);

worksheet[25] = new loadsheet(	document.forms[0].QUANTITY25.value,
								document.forms[0].STOCKSIZE25.options[size25index].value,
								document.forms[0].TOPTRACK25.options[top25index].value,
								document.forms[0].BOTTRACK25.options[bot25index].value);
																																																
																																																							
 
wsindex = parseInt(0);
//1
wsindex = wsindex + parseInt(1);
document.forms[0].COST1.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET1.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY1.value/12)*100)/100;
document.forms[0].TRACKCOST1.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST1.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//2
wsindex = wsindex + parseInt(1);
document.forms[0].COST2.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET2.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY2.value/12)*100)/100;
document.forms[0].TRACKCOST2.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST2.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//3
wsindex = wsindex + parseInt(1);
document.forms[0].COST3.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET3.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY3.value/12)*100)/100;
document.forms[0].TRACKCOST3.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST3.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//4
wsindex = wsindex + parseInt(1);
document.forms[0].COST4.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET4.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY4.value/12)*100)/100;
document.forms[0].TRACKCOST4.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST4.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//5
wsindex = wsindex + parseInt(1);
document.forms[0].COST5.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET5.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY5.value/12)*100)/100;
document.forms[0].TRACKCOST5.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST5.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//6
wsindex = wsindex + parseInt(1);
document.forms[0].COST6.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET6.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY6.value/12)*100)/100;
document.forms[0].TRACKCOST6.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST6.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//7
wsindex = wsindex + parseInt(1);
document.forms[0].COST7.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET7.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY7.value/12)*100)/100;
document.forms[0].TRACKCOST7.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST7.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//8
wsindex = wsindex + parseInt(1);
document.forms[0].COST8.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET8.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY8.value/12)*100)/100;
document.forms[0].TRACKCOST8.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST8.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//9
wsindex = wsindex + parseInt(1);
document.forms[0].COST9.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET9.value		= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY9.value/12)*100)/100;
document.forms[0].TRACKCOST9.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST9.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//10
wsindex = wsindex + parseInt(1);
document.forms[0].COST10.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET10.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY10.value/12)*100)/100;
document.forms[0].TRACKCOST10.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST10.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//11
wsindex = wsindex + parseInt(1);
document.forms[0].COST11.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET11.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY11.value/12)*100)/100;
document.forms[0].TRACKCOST11.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST11.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//12
wsindex = wsindex + parseInt(1);
document.forms[0].COST12.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET12.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY12.value/12)*100)/100;
document.forms[0].TRACKCOST12.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST12.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//13
wsindex = wsindex + parseInt(1);
document.forms[0].COST13.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET13.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY13.value/12)*100)/100;
document.forms[0].TRACKCOST13.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST13.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//14
wsindex = wsindex + parseInt(1);
document.forms[0].COST14.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET14.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY14.value/12)*100)/100;
document.forms[0].TRACKCOST14.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST14.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//15
wsindex = wsindex + parseInt(1);
document.forms[0].COST15.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET15.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY15.value/12)*100)/100;
document.forms[0].TRACKCOST15.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST15.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//16
wsindex = wsindex + parseInt(1);
document.forms[0].COST16.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET16.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY16.value/12)*100)/100;
document.forms[0].TRACKCOST16.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST16.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//17
wsindex = wsindex + parseInt(1);
document.forms[0].COST17.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET17.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY17.value/12)*100)/100;
document.forms[0].TRACKCOST17.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST17.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//18
wsindex = wsindex + parseInt(1);
document.forms[0].COST18.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET18.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY18.value/12)*100)/100;
document.forms[0].TRACKCOST18.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST18.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//19
wsindex = wsindex + parseInt(1);
document.forms[0].COST19.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET19.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY19.value/12)*100)/100;
document.forms[0].TRACKCOST19.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST19.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//20
wsindex = wsindex + parseInt(1);
document.forms[0].COST20.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET20.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY20.value/12)*100)/100;
document.forms[0].TRACKCOST20.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST20.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//21
wsindex = wsindex + parseInt(1);
document.forms[0].COST21.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET21.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY21.value/12)*100)/100;
document.forms[0].TRACKCOST21.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST21.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//22
wsindex = wsindex + parseInt(1);
document.forms[0].COST22.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET22.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY22.value/12)*100)/100;
document.forms[0].TRACKCOST22.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST22.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//23
wsindex = wsindex + parseInt(1);
document.forms[0].COST23.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET23.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY23.value/12)*100)/100;
document.forms[0].TRACKCOST23.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST23.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//24
wsindex = wsindex + parseInt(1);
document.forms[0].COST24.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET24.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY24.value/12)*100)/100;
document.forms[0].TRACKCOST24.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST24.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;
//25
wsindex = wsindex + parseInt(1);
document.forms[0].COST25.value			= Math.ceil(worksheet[wsindex].cost*100)/100;
document.forms[0].SQUAREFEET25.value	= Math.ceil((worksheet[wsindex].Panelheight*document.forms[0].QUANTITY25.value/12)*100)/100;
document.forms[0].TRACKCOST25.value		= Math.ceil((worksheet[wsindex].toptrack_cost+worksheet[wsindex].bottrack_cost)*100)/100;
document.forms[0].PANELCOST25.value		= Math.ceil(worksheet[wsindex].panel_cost*100.00)/100.00;

//document.forms[0].totalanchors.value		= (document.forms[0].Totalpanels.value*2) +(document.forms[0].totalopenings.value*2);
document.forms[0].costofpanels.value		= (Math.ceil(document.forms[0].costofpanels.value*100.00))/100.00;
document.forms[0].costoftracks.value		= (Math.ceil(document.forms[0].costoftracks.value*100.00))/100.00;
//document.forms[0].panelcostfoot.value		= 4.45;
document.forms[0].totalsquarefeet.value		= (Math.ceil(document.forms[0].totalsquarefeet.value*100.00))/100.00;
document.forms[0].subtotal.value			= (Math.ceil(parseFloat(document.forms[0].subtotal.value)*100.00))/100.00;
document.forms[0].salestax.value			= (Math.ceil((document.forms[0].subtotal.value*.07)*100))/100;
document.forms[0].totalcosttax.value		= (Math.ceil((document.forms[0].subtotal.value*1.07)*100))/100;
//document.forms[0].subtotal2					= Math.ceil(((document.forms[0].costofpanels.value + document.forms[0].costoftracks.value)*100))/100;

}
function loadsheet(quantity,stocksize,toptrack,bottrack)
{
	var track_price	= new Array()
//  1 - No Tracks
//  2 - h-Header 
//  3 - stud angle
//  4 - f-track
//  5 - Rev Stud Angle
//  6 - U-header
//  7 - 1" BO U-header 
//  8 - 2" BO U-header
//  9 - 3" BO U-header
//  10 - 1" BO f-track 
//  11 - 2" BO f-track
//  12 - 3" BO f-track
	
	track_price [1]   = 0
	track_price [2]   = 4.50
	track_price [3]   = 4.25
	track_price [4]   = 2.75
        track_price [5]   = 4.25
	track_price [6]   = 4.50
	track_price [7]   = 5.25
	track_price [8]   = 5.95 
	track_price [9]   = 6.95
	track_price [10]   = 3.95
	track_price [11]   = 4.50
	track_price [12]   = 4.95



	var stock_size	= new Array()
	stock_size[1]	= 33
	stock_size[2]	= 42
	stock_size[3]	= 45
	stock_size[4]	= 58
	stock_size[5]	= 62
	stock_size[6]	= 69
	stock_size[7]	= 80
	stock_size[8]	= 82
	stock_size[9]	= 85
	stock_size[10]	= 87
	stock_size[11]	= 90
	stock_size[12]	= 104
	stock_size[13]	= 115

	panel_cost_perfoot = 4.65
	document.forms[0].DUMMY.value 	= parseInt("ABC");
	bottrack_cost			= track_price[parseInt(toptrack)];
	toptrack_cost			= track_price[parseInt(bottrack)];
	this.quantity 			= parseInt(quantity);
	this.stocksize 			= parseInt(stocksize);
    this.Numberpanels		= parseFloat(this.quantity);
    this.Panelheight  		= parseInt(this.stocksize);
    this.square_feet		= (parseFloat(this.quantity) * this.Panelheight)/12;
    this.panel_cost			= parseFloat((this.square_feet * panel_cost_perfoot)*100.00/100.00);
	this.toptrack_cost		= parseFloat((this.Numberpanels+ .25)  * toptrack_cost);
    this.bottrack_cost		= parseFloat((this.Numberpanels+ .25)  * bottrack_cost);
	document.forms[0].DUMMY1.value = parseFloat((this.square_feet * panel_cost_perfoot) + 
      							 parseFloat(this.toptrack_cost) + parseFloat(this.bottrack_cost));
	if (document.forms[0].DUMMY.value == document.forms[0].DUMMY1.value)
	{
		this.cost			= 0;
		this.squart_feet	= 0;
		this.toptrack_cost	= 0;
		this.bottrack_cost	= 0;
		this.Numberpanels	= 0;
		this.panel_cost		= 0;
		this.Panelheight	= "   ";
	}
	else
	{
		this.cost			= Math.ceil(parseFloat(document.forms[0].DUMMY1.value*100))/100;
//		document.forms[0].totalopenings.value = parseInt(document.forms[0].totalopenings.value) + parseInt(1);
		document.forms[0].Totalpanels.value  =  parseInt(document.forms[0].Totalpanels.value) + parseInt(this.quantity);
		document.forms[0].costofpanels.value	=  parseFloat(document.forms[0].costofpanels.value) + 
												parseFloat(this.square_feet * panel_cost_perfoot);
        document.forms[0].costoftracks.value =  parseFloat(document.forms[0].costoftracks.value) +
                                    this.toptrack_cost + this.bottrack_cost;
        this.subtotal	=   parseFloat((parseFloat(document.forms[0].subtotal.value) + parseFloat(this.cost)));                            
		document.forms[0].subtotal.value = this.subtotal;
		document.forms[0].totalsquarefeet.value = parseFloat(document.forms[0].totalsquarefeet.value) + 
												this.square_feet;
		
	}
}

 




