var aPSUBanks = new Array(
		0,
		0,
		0,
		4,		// GECLPS3
		1,		// GECLPS4
		4,		// GECLPS5
		1,		// GECLPS6
		2,		// GEXLPS20
		4		// GECLPSWH
	);


MEASURE_FEET = 1;
MEASURE_METERS = 2;

var	nMeasurementMode;



nMeasurementMode = MEASURE_FEET;

// Convert Inches to the required format.

function convInches(nInches) {
	switch(nMeasurementMode) {
		case	MEASURE_METERS:
			return(nInches*0.0254);
			break;
		case	MEASURE_FEET:
			return(nInches);
			break;
	}
}

// Convert feet to the required format.
function convFeet(nFeet) {
	switch(nMeasurementMode) {
		case	MEASURE_METERS:
			//return(nFeet*0.3048);
			//return(nFeet*0.32808399);
			return(nFeet/3.2808399);
			break;
		case	MEASURE_FEET:
			return(nFeet);
			break;
	}
}

function getShortUnits() {
	switch(nMeasurementMode) {
		case	MEASURE_METERS:
			return(' meters');
			break;
		case	MEASURE_FEET:
			return(' feet');
			break;
	}
}

function getLongUnits() {
	switch(nMeasurementMode) {
		case	MEASURE_METERS:
			return(' meters');
			break;
		case	MEASURE_FEET:
			return(' feet');
			break;
	}
}

function getCurrentInches(nVar) {
	switch(nMeasurementMode) {
		case	MEASURE_FEET:
			return(nVar);
			break;
		case	MEASURE_METERS:
			return(roundNumber(nVar/0.0254,4));
			break;
	}
}

function getCurrentFeet(nVar) {
	switch(nMeasurementMode) {
		case	MEASURE_FEET:
			return(nVar);
			break;
		case	MEASURE_METERS:
			//return(roundNumber(nVar*3.2808399,4));
			return(nVar*3.2808399);
			break;
	}
}

function roundNumber(num,places) {
	var newnumber = Math.round(num*Math.pow(10,places))/Math.pow(10,places);
	return(newnumber);
}


function parseURL(id)
{
	var	sURL;
	var pairs;
	
	sURL = "" + window.location;
	
	pairs = sURL.split("&");

	for(var i=0;i<pairs.length;i++)
	{
		var pairSplit=pairs[i].split("=");
		if(pairSplit[0]==id)
		{
			return("" + pairSplit[1]);
		}
	}
	return("");
}

function checkNum(str) {
	for (var i=0; i<str.length; i++) {
		var ch = str.substring(i, i + 1)
		if (ch!="." && ch!="+" && ch!="-" && ch!="e" && ch!="E" && (ch < "0" || ch > "9")) {
			alert("Please enter a valid number.");
			return false;
		}
	}
	return true;
}

function replaceStr(sStr,newColor){
	myString = new String(sStr);
	rExp = /cl/gi;
	newString = new String (newColor);
	results = myString.replace(rExp,newString);
	return(results);
}

function CBOptions_Clear(sCombo) {
	var	oSel = eval("document.frmPartMaster." + sCombo);
	oSel.length = 0;
}

function CBOptions_Add(sCombo,sText,sValue) {
	var	oSel = eval("document.frmPartMaster." + sCombo);
	oSel.options[oSel.length] = new Option(sText,sValue)
}

function UpdateSKU(sName,sVal) {
	document.getElementById("rb" + sName + "SKU").innerHTML = sVal;
}

function UpdateDESC(sName,sVal) {
	document.getElementById("rb" + sName + "DESC").innerHTML = sVal;
}

function UpdateQuantity(sName,sVal) {
	//alert(sName);
	document.getElementById("rb" + sName + "QTY").innerHTML = sVal;
}

function UpdateSupp(sName,sVal) {
	document.getElementById("rb" + sName + "Supp").innerHTML = sVal;
}

function UpdateOrder(sName,sVal) {
	document.getElementById("rb" + sName + "Order").innerHTML = sVal;
}


////////////////
function UpdateSKUDisplay()
{
	doc = window.document.frmPartMaster;	
	nLEDColor = doc.cbLEDColor.options[doc.cbLEDColor.selectedIndex].value;
	nConnectorColor = doc.cbConnectorColor.options[doc.cbConnectorColor.selectedIndex].value;
	
	var icb_value=parseInt(document.getElementById("insideCorner").value);
	var ocb_value=parseInt(document.getElementById("outsideCorner").value);
	var pcb_value=parseInt(document.getElementById("planarCorner").value);
	
	//alert(icb_value);
	
	if(nLEDColor==2 && nConnectorColor==1)
	{
		//display:table-cell
		document.getElementById("row_2").style.display="none";
		document.getElementById("row_3").style.display ="";
		document.getElementById("row_4").style.display = "none";
		document.getElementById("row_5").style.display = "none";
		document.getElementById("display_line").style.display="";
	}else if(nLEDColor==3 && nConnectorColor==2)
	{
		document.getElementById("row_2").style.display ="none";
		document.getElementById("row_3").style.display = "none";
		document.getElementById("row_4").style.display = "";
		document.getElementById("row_5").style.display = "none";
		document.getElementById("display_line").style.display="";
	}else if(nLEDColor==4 && nConnectorColor==5)
	{
		document.getElementById("row_2").style.display ="";
		document.getElementById("row_3").style.display = "none";
		document.getElementById("row_4").style.display = "none";
		document.getElementById("row_5").style.display = "none";
		document.getElementById("display_line").style.display="";
	}else if(nLEDColor==7 && nConnectorColor==6)
	{
		document.getElementById("row_2").style.display ="none";
		document.getElementById("row_3").style.display = "none";
		document.getElementById("row_4").style.display = "none";
		document.getElementById("row_5").style.display ="";
		document.getElementById("display_line").style.display="";
	}else{
		document.getElementById("display_line").style.display="none";
		document.getElementById("row_2").style.display ="none";
		document.getElementById("row_3").style.display = "none";
		document.getElementById("row_4").style.display = "none";
		document.getElementById("row_5").style.display = "none";
	}
	
	
	if(nConnectorColor==1)
	{
		for(i=12;i<33;i++)
		{
			////////////////Code to display inside,outside,planar corner SKUs///////////
			if(i==12)
			{
				if(isNaN(icb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==13)
			{
				if(isNaN(ocb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==14)
			{
				if(isNaN(pcb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else{
				document.getElementById("row_"+i).style.display = "none";
			}
			
			////////////////Code to display inside,outside,planar corner SKUs///////////
			
		}
	}else if(nConnectorColor==2){
		for(i=12;i<33;i++)
		{
			////////////////Code to display inside,outside,planar corner SKUs///////////
			if(i==27)
			{
				if(isNaN(icb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==28)
			{
				if(isNaN(ocb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==29)
			{
				if(isNaN(pcb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else{
				document.getElementById("row_"+i).style.display = "none";
			}
			
			////////////////Code to display inside,outside,planar corner SKUs///////////
		}
	}else if(nConnectorColor==3){
		for(i=12;i<33;i++)
		{
			////////////////Code to display inside,outside,planar corner SKUs///////////
			if(i==24)
			{
				if(isNaN(icb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==25)
			{
				if(isNaN(ocb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==26)
			{
				if(isNaN(pcb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else{
				document.getElementById("row_"+i).style.display = "none";
			}
			
			////////////////Code to display inside,outside,planar corner SKUs///////////
		}
	}else if(nConnectorColor==4){
		for(i=12;i<33;i++)
		{
			////////////////Code to display inside,outside,planar corner SKUs///////////
			if(i==18)
			{
				if(isNaN(icb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==19)
			{
				if(isNaN(ocb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==20)
			{
				if(isNaN(pcb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else{
				document.getElementById("row_"+i).style.display = "none";
			}
			
			////////////////Code to display inside,outside,planar corner SKUs///////////
		}
	}else if(nConnectorColor==5){
		for(i=12;i<33;i++)
		{
			////////////////Code to display inside,outside,planar corner SKUs///////////
			if(i==15)
			{
				if(isNaN(icb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==16)
			{
				if(isNaN(ocb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==17)
			{
				if(isNaN(pcb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else{
				document.getElementById("row_"+i).style.display = "none";
			}
			
			////////////////Code to display inside,outside,planar corner SKUs///////////
		}
	}else if(nConnectorColor==6){
		for(i=12;i<33;i++)
		{
			////////////////Code to display inside,outside,planar corner SKUs///////////
			if(i==30)
			{
				if(isNaN(icb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==31)
			{
				if(isNaN(ocb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==32)
			{
				if(isNaN(pcb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else{
				document.getElementById("row_"+i).style.display = "none";
			}
			
			////////////////Code to display inside,outside,planar corner SKUs///////////
		}
	}
	else if(nConnectorColor==7){
		for(i=12;i<33;i++)
		{
			////////////////Code to display inside,outside,planar corner SKUs///////////
			if(i==21)
			{
				if(isNaN(icb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==22)
			{
				if(isNaN(ocb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else if(i==23)
			{
				if(isNaN(pcb_value))
				{
					document.getElementById("row_"+i).style.display ="none";
			    }else{
					document.getElementById("row_"+i).style.display = "";
				}
			}else{
				document.getElementById("row_"+i).style.display = "none";
			}
			
			////////////////Code to display inside,outside,planar corner SKUs///////////
		}
	}
}


//////////



function compute() {	
	var doc;	

	doc = window.document.frmPartMaster;
	
	var nFeet;
	var nPSU;
	
	nFeet = getCurrentFeet(doc.txtUserEstFt.value);
	document.getElementById("feetSupported").innerHTML = roundNumber(convFeet(nFeet),2);
	nLEDColor = doc.cbLEDColor.options[doc.cbLEDColor.selectedIndex].value;
	nConnectorColor = doc.cbConnectorColor.options[doc.cbConnectorColor.selectedIndex].value;
	nPSU = doc.cbPSUSel.options[doc.cbPSUSel.selectedIndex].value;
	nFeetDiv8 = nFeet/8;
	
	UpdateSKUDisplay();
	
	var icb_val=parseInt(document.getElementById("insideCorner").value);
	var ocb_val=parseInt(document.getElementById("outsideCorner").value);
	var pcb_val=parseInt(document.getElementById("planarCorner").value);
	
	nDWLGQ = 12;
	nLGCQ  = 20;
	nLGECQ = 20;
	nMCLPQ = 50;
	nCSBAQ = 12;
	if(nLEDColor==1)
	{
		nLEQ = 6;
	}
	else if(nLEDColor==2)
	{
		nLEQ = 6;
	}
	else if(nLEDColor==3)
	{
		nLEQ = 6;
	}
	else if(nLEDColor==4)
	{
		nLEQ = 12;
	}
	else if(nLEDColor==5)
	{
		nLEQ = 6;
	}
	else if(nLEDColor==6)
	{
		nLEQ = 6;
	}
	else if(nLEDColor==7)
	{
		nLEQ = 6;
	}
	nSWQ = 500;
	nPSQ = 10;
	nSCQ = 500;
	
	nICBQ=20;
	nOCBQ=20;
	nPCBQ=20;
	
	
	
	UpdateQuantity("DWLG",nDWLGQ);
	UpdateQuantity("LGC",nLGCQ);
	UpdateQuantity("LGEC",nLGECQ);
	UpdateQuantity("MCLP",nMCLPQ);
	UpdateQuantity("CSBA",nCSBAQ);
	UpdateQuantity("LE",nLEQ);	// + getShortUnits());
	UpdateQuantity("SW",roundNumber(convFeet(nSWQ),2) + getShortUnits());
	UpdateQuantity("PS",nPSQ);
	UpdateQuantity("SC",nSCQ);
	
	UpdateQuantity("ICB",nICBQ);
	UpdateQuantity("OCB",nOCBQ);
	UpdateQuantity("PCB",nPCBQ);
	
	
	UpdateQuantity("ICO",nICBQ);
	UpdateQuantity("OCO",nOCBQ);
	UpdateQuantity("PCO",nPCBQ);
	
	UpdateQuantity("ICY",nICBQ);
	UpdateQuantity("OCY",nOCBQ);
	UpdateQuantity("PCY",nPCBQ);
	
	UpdateQuantity("ICLG",nICBQ);
	UpdateQuantity("OCLG",nOCBQ);
	UpdateQuantity("PCLG",nPCBQ);
	
	UpdateQuantity("ICG",nICBQ);
	UpdateQuantity("OCG",nOCBQ);
	UpdateQuantity("PCG",nPCBQ);
	
	UpdateQuantity("ICW",nICBQ);
	UpdateQuantity("OCW",nOCBQ);
	UpdateQuantity("PCW",nPCBQ);
	
	
	nICRQ=20;
	nOCRQ=20;
	nPCRQ=20;
	
	UpdateQuantity("ICR",nICRQ);
	UpdateQuantity("OCR",nOCRQ);
	UpdateQuantity("PCR",nPCRQ)
	
	nLSRDQ=6;
	nLSBLQ=6;
	nLSGLQ=6;
	nLSWHQ=6;
	
	
	UpdateQuantity("LSRD",nLSRDQ);
	UpdateQuantity("LSBL",nLSBLQ);
	UpdateQuantity("LSGL",nLSGLQ);
	UpdateQuantity("LSWH",nLSWHQ);
	
	
	
	
	nDWLG = parseInt(nFeetDiv8+0.999999999);
	nLGC = parseInt(nFeetDiv8*1.2+0.999999999);
	nLGEC = parseInt((nFeet*1/16)+0.999999999);
	nMCLP = parseInt((nFeetDiv8*5*1.1)+0.999999999);
	nCSBA = 12;
	nLE =parseInt(nFeetDiv8+0.999999999);;
	if(nPSU == 20) {
		nPS = parseInt((nFeet/24)+0.999999999);
	} else {
		nPS = parseInt((nFeet/30)+0.999999999);
	}

	switch(parseInt(nPSU)) {
		case	20:		// PS30
			nSW = parseInt((nPS*30)+0.999999999);
			break;
		case	21:		// PS31
			nSW = parseInt((nFeet/(30*15))+0.999999999);
			break;
		default:
			nSW = parseInt((nFeet*15/24)+0.999999999);
			break;
	}
	//nSW = parseInt((nFeet*15/24)+0.999999999);
	
	// PS30 6 Splice Connectors.
	// PS31 3 Splice Connectors.
	
	switch(parseInt(nPSU)) {
		case	20:		// PS30
			nSC = parseInt((nPS*6)+0.999999999);
			break;
		case	21:		// PS31
			nSC = parseInt((nFeet/(30*3))+0.999999999);
			break;
		default:
			nSC = parseInt((nFeet*4/24)+0.999999999);
			break;
	}
	//nSC = parseInt((nFeet*4/24)+0.999999999);
	
	
	
	
	UpdateSupp("DWLG",nDWLG + " 8-foot sections");
	UpdateSupp("LGC",nLGC + " connectors");
	UpdateSupp("LGEC",nLGEC + " end caps");
	UpdateSupp("MCLP",nMCLP + " clips");
	UpdateSupp("CSBA",nCSBA + " bend-aids");
	UpdateSupp("LE",nLE + " 8-foot sections");
	UpdateSupp("SW",roundNumber(convFeet(nSW),2) + getLongUnits());
	UpdateSupp("PS",nPS + " power supplies");
	UpdateSupp("SC",nSC + " connectors");
	
	nLSRDS=parseInt(nFeetDiv8+0.999999999);
	nLSBLS=parseInt(nFeetDiv8+0.999999999);
	nLSWHS=parseInt(nFeetDiv8+0.999999999);
	nLSGLS=parseInt(nFeetDiv8+0.999999999);
	
		
	UpdateSupp("LSRD",nLSRDS + " 8-foot sections");
	UpdateSupp("LSBL",nLSBLS + " 8-foot sections");
	UpdateSupp("LSWH",nLSWHS + " 8-foot sections");
	UpdateSupp("LSGL",nLSGLS + " 8-foot sections");
	
	
	if(isNaN(icb_val))
	icb_val=0;
	
	var nICB=parseInt(icb_val);
	
	if(isNaN(ocb_val))
	ocb_val=0;
	
	var nOCB=parseInt(ocb_val);
	if(isNaN(pcb_val))
	pcb_val=0;
	
	var nPCB=parseInt(pcb_val);
	//UpdateSupp("SW",roundNumber(convFeet(nSW),2) + getLongUnits());
	UpdateSupp("ICB",nICB + " each");
	UpdateSupp("OCB",nOCB + " each");
	UpdateSupp("PCB",nPCB + " each");
	
	
	////////////////////////////code for Red color///////////////
	
	UpdateSupp("ICR",nICB + " each");
	UpdateSupp("OCR",nOCB + " each");
	UpdateSupp("PCR",nPCB + " each");
	
	
	UpdateSupp("ICO",nICB + " each");
	UpdateSupp("OCO",nOCB + " each");
	UpdateSupp("PCO",nPCB + " each");
	
	UpdateSupp("ICY",nICB + " each");
	UpdateSupp("OCY",nOCB + " each");
	UpdateSupp("PCY",nPCB + " each");
	
	UpdateSupp("ICLG",nICB + " each");
	UpdateSupp("OCLG",nOCB + " each");
	UpdateSupp("PCLG",nPCB + " each");
	
	UpdateSupp("ICG",nICB + " each");
	UpdateSupp("OCG",nOCB + " each");
	UpdateSupp("PCG",nPCB + " each");
	
	UpdateSupp("ICW",nICB + " each");
	UpdateSupp("OCW",nOCB + " each");
	UpdateSupp("PCW",nPCB + " each");
	
	
	
	////////////////////////////////////////
	
		
	
	UpdateOrder("DWLG",parseInt(nDWLG/nDWLGQ+0.999999999) + " boxes");
	UpdateOrder("LGC",parseInt(nLGC/nLGCQ+0.999999999) + " bags");
	UpdateOrder("LGEC",parseInt(nLGEC/nLGECQ+0.999999999) + " bags");
	UpdateOrder("MCLP",parseInt(nMCLP/nMCLPQ+0.999999999) + " bags");
	UpdateOrder("CSBA",parseInt(nCSBA/nCSBAQ+0.999999999) + " bags");
	UpdateOrder("LE",(parseInt((nLE/nLEQ)+0.999999999)) + " boxes");
	UpdateOrder("SW",(parseInt(nSW/nSWQ+0.999999999)) + " spool");
	UpdateOrder("PS",parseInt(nPS/nPSQ+0.999999999) + " boxes");
	UpdateOrder("SC",parseInt(nSC/nSCQ+0.999999999) + " bags");
	
	
	UpdateOrder("ICB",parseInt(nICB/nICBQ+0.999999999) + " bags");
	UpdateOrder("OCB",parseInt(nOCB/nOCBQ+0.999999999) + " bags");
	UpdateOrder("PCB",parseInt(nPCB/nPCBQ+0.999999999) + " bags");
	
	
	UpdateOrder("ICR",parseInt(nICB/nICBQ+0.999999999) + " bags");
	UpdateOrder("OCR",parseInt(nOCB/nOCBQ+0.999999999) + " bags");
	UpdateOrder("PCR",parseInt(nPCB/nPCBQ+0.999999999) + " bags");
	
	UpdateOrder("ICO",parseInt(nICB/nICBQ+0.999999999) + " bags");
	UpdateOrder("OCO",parseInt(nOCB/nOCBQ+0.999999999) + " bags");
	UpdateOrder("PCO",parseInt(nPCB/nPCBQ+0.999999999) + " bags");
	
	UpdateOrder("ICY",parseInt(nICB/nICBQ+0.999999999) + " bags");
	UpdateOrder("OCY",parseInt(nOCB/nOCBQ+0.999999999) + " bags");
	UpdateOrder("PCY",parseInt(nPCB/nPCBQ+0.999999999) + " bags");
	
	UpdateOrder("ICLG",parseInt(nICB/nICBQ+0.999999999) + " bags");
	UpdateOrder("OCLG",parseInt(nOCB/nOCBQ+0.999999999) + " bags");
	UpdateOrder("PCLG",parseInt(nPCB/nPCBQ+0.999999999) + " bags");
	
	UpdateOrder("ICG",parseInt(nICB/nICBQ+0.999999999) + " bags");
	UpdateOrder("OCG",parseInt(nOCB/nOCBQ+0.999999999) + " bags");
	UpdateOrder("PCG",parseInt(nPCB/nPCBQ+0.999999999) + " bags");
	
	UpdateOrder("ICW",parseInt(nICB/nICBQ+0.999999999) + " bags");
	UpdateOrder("OCW",parseInt(nOCB/nOCBQ+0.999999999) + " bags");
	UpdateOrder("PCW",parseInt(nPCB/nPCBQ+0.999999999) + " bags");
	
	
	UpdateOrder("LSRD",parseInt(nLSRDS/nLSRDQ+0.999999999) + " boxes");
	UpdateOrder("LSBL",parseInt(nLSBLS/nLSBLQ+0.999999999) + " boxes");
	UpdateOrder("LSWH",parseInt(nLSWHS/nLSWHQ+0.999999999) + " boxes");
	UpdateOrder("LSGL",parseInt(nLSGLS/nLSGLQ+0.999999999) + " boxes");
	
	if(nLEDColor==1)
	{
		UpdateSKU("LE","GEYAXNLE1");
		UpdateDESC("LE","Tetra Contour LED Light Engine (Amber)");
	}
	else if(nLEDColor==2)
	{
		UpdateSKU("LE","GEBLXNLE1");
		UpdateDESC("LE","Tetra Contour LED Light Engine (Blue)");
	}
	else if(nLEDColor==3)
	{
		UpdateSKU("LE","GEGLXNLE1");
		UpdateDESC("LE","Tetra Contour LED Light Engine (Green)");
	}
	else if(nLEDColor==4)
	{
		UpdateSKU("LE","GERDXNLE1");
		UpdateDESC("LE","Tetra Contour LED Light Engine (Red)");
	}
	else if(nLEDColor==5)
	{
		UpdateSKU("LE","GERCXNLE1");
		UpdateDESC("LE","Tetra Contour LED Light Engine (Red/Orange)");
	}
	else if(nLEDColor==6)
	{
		UpdateSKU("LE","GEWWXNLE1");
		UpdateDESC("LE","Tetra Contour LED Light Engine (3200K)");
	}
	else if(nLEDColor==7)
	{
		UpdateSKU("LE","GEWHXNLE1");
		UpdateDESC("LE","Tetra Contour LED Light Engine (6500K)");
	}
	
	/********************************************************/
	if(nConnectorColor==1)
	{
		UpdateSKU("DWLG","GEBLXNLG15");
		UpdateDESC("DWLG","Tetra Contour Light Guide (15mm Blue)");
		UpdateQuantity("DWLG",12);
		
		UpdateSKU("LGC","GEBLXNLGC15");
		UpdateDESC("LGC","Tetra Contour Light Guide Connector (Blue)");
		UpdateQuantity("LGC",20);
		
		UpdateSKU("LGEC","GEBLXNLGEC15");
		UpdateDESC("LGEC","Tetra Contour Light Guide End Cap (Blue)");
		UpdateQuantity("LGEC",20);
	}
	else if(nConnectorColor==2)
	{
		UpdateSKU("DWLG","GEGLXNLG15");
		UpdateDESC("DWLG","Tetra Contour Light Guide (15mm Green )");
		UpdateQuantity("DWLG",12);
		
		UpdateSKU("LGC","GEGLXNLGC15");
		UpdateDESC("LGC","Tetra Contour Light Guide Connector (Green)");
		UpdateQuantity("LGC",20);
		
		UpdateSKU("LGEC","GEGLXNLGEC15");
		UpdateDESC("LGEC","Tetra Contour Light Guide End Cap (Green)");
		UpdateQuantity("LGEC",20);
	}
	else if(nConnectorColor==3)
	{
		UpdateSKU("DWLG","GELGXNLG15");
		UpdateDESC("DWLG","Tetra Contour Light Guide (15mm Lime Green)");
		UpdateQuantity("DWLG",12);
		
		UpdateSKU("LGC","GELGXNLGC15");
		UpdateDESC("LGC","Tetra Contour Light Guide Connector (Lime Green)");
		UpdateQuantity("LGC",20);
		
		UpdateSKU("LGEC","GELGXNLGEC15");
		UpdateDESC("LGEC","Tetra Contour Light Guide End Cap (Lime Green)");
		UpdateQuantity("LGEC",20);
	}
	else if(nConnectorColor==4)
	{
		UpdateSKU("DWLG","GEPOXNLG15");
		UpdateDESC("DWLG","Tetra Contour Light Guide (15mm Orange)");
		UpdateQuantity("DWLG",12);
		
		UpdateSKU("LGC","GEPOXNLGC15");
		UpdateDESC("LGC","Tetra Contour Light Guide Connector (Orange)");
		UpdateQuantity("LGC",20);
		
		UpdateSKU("LGEC","GEPOXNLGEC15");
		UpdateDESC("LGEC","Tetra Contour Light Guide End Cap (Orange)");
		UpdateQuantity("LGEC",20);
	}
	else if(nConnectorColor==5)
	{
		UpdateSKU("DWLG","GERDXNLG15");
		UpdateDESC("DWLG","Tetra Contour Light Guide (15mm Red)");
		UpdateQuantity("DWLG",12);
		
		UpdateSKU("LGC","GERDXNLGC15");
		UpdateDESC("LGC","Tetra Contour Light Guide Connector (Red)");
		UpdateQuantity("LGC",20);
		
		UpdateSKU("LGEC","GERDXNLGEC15");
		UpdateDESC("LGEC","Tetra Contour Light Guide End Cap (Red)");
		UpdateQuantity("LGEC",20);
	}
	else if(nConnectorColor==6)
	{
		UpdateSKU("DWLG","GEXNLG15");
		UpdateDESC("DWLG","Tetra Contour Light Guide (15mm White)");
		UpdateQuantity("DWLG",12);
		
		UpdateSKU("LGC","GEXNLGC15");
		UpdateDESC("LGC","Tetra Contour Light Guide Connector");
		UpdateQuantity("LGC",20);
		
		UpdateSKU("LGEC","GEXNLGEC15");
		UpdateDESC("LGEC","Tetra Contour Light Guide End Cap");
		UpdateQuantity("LGEC",20);
	}
	else if(nConnectorColor==7)
	{
		UpdateSKU("DWLG","GEYAXNLG15");
		UpdateDESC("DWLG","Tetra Contour Light Guide (15mm Yellow)");
		UpdateQuantity("DWLG",12);
		
		UpdateSKU("LGC","GEYAXNLGC15");
		UpdateDESC("LGC","Tetra Contour Light Guide Connector (Yellow)");
		UpdateQuantity("LGC",20);
		
		UpdateSKU("LGEC","GEYAXNLGEC15");
		UpdateDESC("LGEC","Tetra Contour Light Guide End Cap (Yellow)");
		UpdateQuantity("LGEC",20);
	}
	UpdateSupp("DWLG",nDWLG + " 8-foot sections");
	UpdateOrder("DWLG",parseInt(nDWLG/nDWLGQ+0.999999999) + " boxes");
	UpdateSupp("LGC",nLGC + " connectors");
	UpdateOrder("LGC",parseInt(nLGC/nLGCQ+0.999999999) + " bags");
	UpdateSupp("LGEC",nLGEC + " end caps");
	UpdateOrder("LGEC",parseInt(nLGEC/nLGECQ+0.999999999) + " bags");

	/*****************************************************************/
	if(nPSU == 20) {
		UpdateSKU("PS","GEPS24-80");
		UpdateDESC("PS","Power Supply (24VDC / 80W)\, Input Voltage: 108-264VAC; Damp Rated; Self-Contained, Remote or Raceway; 1 Output Bank; Class 2");
	} else {
		UpdateSKU("PS","GEPS24-100U");
		UpdateDESC("PS","Power Supply (24VDC / 100W), Input Voltage: 108-305VAC; Damp Rated; Self-Contained, Remote or Raceway; 1 Output Bank; Class 2");
	}

	var sNotes = "";
	
	sNotes += "IP66, damp location rated.<br>";
	sNotes += "GEPS24-80 Supports from " + roundNumber(convFeet(1),2) + getShortUnits() + " to " + roundNumber(convFeet(24),2) + getShortUnits() + "<br>";
	sNotes += "GEPS24-100U Supports from " + roundNumber(convFeet(1),2) + getShortUnits() + " to " + roundNumber(convFeet(30),2) + getShortUnits() + "<br>";
	document.getElementById("noteBox").innerHTML = sNotes;

}	


function changePart(){
	if (document.frmPartMaster.txtColor.value != "") { 
		document.frmPartMaster.action="index.asp";		
		document.frmPartMaster.submit();		
	}
}

function initColorSettings()
{
	var	doc = document.frmPartMaster;
	
	var nColSel = document.frmPartMaster.cbLEDColor[document.frmPartMaster.cbLEDColor.selectedIndex].value;
	var nOldVal = CB_GetCurrVal("cbLEDColor");
	CBOptions_Clear("cbLEDColor");

	CBOptions_Add("cbLEDColor","Blue","2");
	CBOptions_Add("cbLEDColor","Green","3");
	CBOptions_Add("cbLEDColor","Red","4");
	CBOptions_Add("cbLEDColor","Red-Orange","5");
	CBOptions_Add("cbLEDColor","Warm White","6");
	CBOptions_Add("cbLEDColor","White","7");
	CBOptions_Add("cbLEDColor","Amber","1");

}

function initPSUSettings()
{
	var	doc = document.frmPartMaster;
	var nPSUSel = document.frmPartMaster.cbPSUSel[document.frmPartMaster.cbPSUSel.selectedIndex].value;
	
	CBOptions_Clear("cbPSUSel");
	CBOptions_Add("cbPSUSel","GEPS24-80","20");
	CBOptions_Add("cbPSUSel","GEPS24-100U","21");

	
	CB_ReselectPrevVal("cbPSUSel",nPSUSel);
}



function CB_GetCurrVal(sItem) {
	var	oSel = eval("document.frmPartMaster." + sItem);
	return(oSel[oSel.selectedIndex].value);

}

function CB_ReselectPrevVal(sItem,nPrev) {

	var	oSel = eval("document.frmPartMaster." + sItem);

	var bDone = false;
	if(nPrev == "")
	{
		oSel.selectedIndex = 0;
	}
	else
	{
		for(i=0;i<oSel.length;i++)
		{
			if(oSel[i].value == nPrev)
			{
				oSel.selectedIndex = i;
				bDone = true;
			}
		}
		if(bDone = false)
		{
			oSel.selectedIndex = 0;
		}
	}
}



function reselectUnits() {
	var	doc = document.frmPartMaster;
	var	nSel = eval(doc.cbUnits[doc.cbUnits.selectedIndex].value);
	
	//var	nLetterHeight = getCurrentInches(document.frmPartMaster.txtLetterHeight.value);
	var nEstFeet = getCurrentFeet(eval(document.frmPartMaster.txtUserEstFt.value));
	
	
	
	nMeasurementMode = nSel;
	//<span id='spUnits1' style='position:relative;'>feet</span>
	switch(nSel) {
		case	MEASURE_FEET:
			document.getElementById("spUnits1").innerHTML= "feet";
			document.getElementById("spUnits5").innerHTML= "length";
			break;
		case	MEASURE_METERS:
			document.getElementById("spUnits1").innerHTML= "meters";
			document.getElementById("spUnits5").innerHTML= "length";
			break;
	}
	
	
	//Supports all colors!<br>
	//Damp Location Rated: Can be mounted in a raceway or Letter.<br>
	//GEXNPS30 Supports from 4 to 24'<br>
	//GEPS24-100U Supports from 1' to 4'<br>
	//A Maximum of 15' of Supply Wire can be used.
	
	//if(nLetterHeight>0) {
	//	document.frmPartMaster.txtLetterHeight.value = roundNumber(convInches(nLetterHeight),2);
	//} else {
	//	document.frmPartMaster.txtLetterHeight.value = "";
	//}
	//if(nEstFeet>0) {
//	alert(nEstFeet	
		
	document.frmPartMaster.txtUserEstFt.value = roundNumber(convFeet(nEstFeet),2);
	//} else {
	//	document.frmPartMaster.txtUserEstFt.value = "";
	//}
	
	compute();
	//alert(nSel);
}

function reselectNumLEDFt()
{
	initPSUSet();
	initColorSettings();
	initPSUSet();
	initPSUSettings();
	initPSUSet();
	initPSUSettings();
	compute();
}

function reselectColor()
{
	initColorSettings();
	initPSUSettings();
	initPSUSet();
	initTetraSolution();
	compute();
}

function reselectLetWidth()
{
	compute();
}

function reselectPSU()
{
	initPSUSet();
	compute();
}

function reselectPSUSetting()
{
	initPSUSet();

	compute();
}

function reselectLetHeight()
{
	document.frmPartMaster.txtUserEstFt = "";
	compute();
}

function reselectNumLetters()
{
	document.frmPartMaster.txtUserEstFt = "";
	compute();
}

function recalcFromFeet(c)
{
	//document.frmPartMaster.txtLetterHeight.value = "";
	//document.frmPartMaster.txtN7.value = "";
	compute();
}

function rebuildResultTables() {
	var	doc = document.frmPartMaster;
	switch(nMeasurementMode) {
		case	MEASURE_FEET:
			supplyWirePackage.innerHTML = "500feet/spool";
			break;
		case	MEASURE_METERS:
			supplyWirePackage.innerHTML = "152m/spool";
			break;
	}
}

function resetForm()
{
	initColorSettings();
	document.frmPartMaster.txtUserEstFt.value = "1000";
	//document.frmPartMaster.cbNumLEDFt.selectedIndex = 1;	// 6 LEDs/ft
	document.frmPartMaster.cbLEDColor.selectedIndex = 0;	//RED
	
	document.getElementById("insideCorner").value = "";
	document.getElementById("outsideCorner").value = "";
	document.getElementById("planarCorner").value = "";
	initPSUSettings();
	//reselectColor();
	//initTetraSolution();
	//document.frmPartMaster.cbLetterWidth.selectedIndex = 1;	//5" to 8" (2 Strokes)
	//document.frmPartMaster.cbPSUSel.selectedIndex = 0;		//GECLPS2
	//initPSUSet();
	//document.frmPartMaster.cbPSUSetting.selectedIndex = 0;	//Low
	//document.frmPartMaster.txtLetterHeight.value = 24;		// 24"
	//document.frmPartMaster.txtNumLetters.value = 6;			// 6 Letters
	//initRemoteDist();
	compute();
}

function doPopup(nOption)
{
	
//	MM_openBrWindow('thetoolbox/channel/contourplg/popups/popup1.html','popup','width=350,height=250');
	MM_openBrWindow('http://alpha.lumination.com/thetoolbox/channel/contourplg/popups/popup'+nOption+'.html?PS='+document.frmPartMaster.cbPSUSel.options[document.frmPartMaster.cbPSUSel.selectedIndex].value,'popup','width=350,height=200');
}

function doPSPopup()
{
	var	nPSUOption = document.frmPartMaster.cbPSUSel.options[document.frmPartMaster.cbPSUSel.selectedIndex].value;
	//MM_openBrWindow('file:///C|/Documents%20and%20Settings/Administrator/Desktop/popups/popup1-%27%20%2B%20nPSUOption%20%2B%20%27.html','popup','width=350,height=200');
	MM_openBrWindow('http://lumination.com/thetoolbox/channel/contourplg/popups/popup1.php?PS='+document.frmPartMaster.cbPSUSel.options[document.frmPartMaster.cbPSUSel.selectedIndex].value,'popup','width=350,height=200');
}

function doLSPopup()
{
	//var	nLEDftOption = document.frmPartMaster.cbNumLEDFt.options[document.frmPartMaster.cbNumLEDFt.selectedIndex].value;
	var nColSel = document.frmPartMaster.cbLEDColor[document.frmPartMaster.cbLEDColor.selectedIndex].value;
	//MM_openBrWindow('file:///C|/Documents%20and%20Settings/Administrator/Desktop/popups/popup2-%27%20%2B%20nLEDftOption%20%2B%20%27.html','popup','width=350,height=200');
	MM_openBrWindow('http://lumination.com/thetoolbox/channel/contourplg/popups/popup2.html?PS='+nColSel,'popup','width=350,height=150');
}

function doLEPopup()
{
	//var	nLEDftOption = document.frmPartMaster.cbNumLEDFt.options[document.frmPartMaster.cbNumLEDFt.selectedIndex].value;
	var nColSel = document.frmPartMaster.cbLEDColor[document.frmPartMaster.cbLEDColor.selectedIndex].value;
	//MM_openBrWindow('file:///C|/Documents%20and%20Settings/Administrator/Desktop/popups/popup0-%27%20%2B%20nColSel%20%2B%20%27.html','popup','width=350,height=250');
	MM_openBrWindow('http://lumination.com/thetoolbox/channel/contourplg/popups/popup0.php?PS='+nColSel,'popup','width=350,height=250');
}

function buildResultsTable() {
	var	aUnitNames,aSKU,aDescriptionLines,aQuantity,aComponents,aOrder;
	
	var nColSel = document.frmPartMaster.cbLEDColor[document.frmPartMaster.cbLEDColor.selectedIndex].value;
	aUnitNames = new Array(
				"LE",
				"DWLG",
				"LSRD",
				"LSBL",
				"LSGL",
				"LSWH",
				"PS",
				"SW",
				"SC",
				"MCLP",
				"LGC",
				"LGEC",
				"ICB",
				"OCB",
				"PCB",
				"ICR",
				"OCR",
				"PCR",
				"ICO",
				"OCO",
				"PCO",
				"ICY",
				"OCY",
				"PCY",
				"ICLG",
				"OCLG",
				"PCLG",
				"ICG",
				"OCG",
				"PCG",
				"ICW",
				"OCW",
				"PCW",
				"CSBA"
				);
	aSKU = new Array(
				"GERDXNLE1",
				"GEXNLG15",
				"GERDXNLA2-RD",
				"GEBLXNLA2-BL",
				"GEGLXNLA2-GL",
				"GEWHXNLA2-WH",
				"GEPS24-80",
				"9409",
				"191600041",
				"GEXNMC15",
				"GEXNLGC15",
				"GEXNLGEC15",
				"GEBLXNLGI15",
				"GEBLXNLGO15",
				"GEBLXNLGP15",
				"GERDXNLGI15",
				"GERDXNLGO15",
				"GERDXNLGP15",
				"GEPOXNLGI15",
				"GEPOXNLGO15",
				"GEPOXNLGP15",
				"GEYAXNLGI15",
				"GEYAXNLGO15",
				"GEYAXNLGP15",
				"GELGXNLGI15",
				"GELGXNLGO15",
				"GELGXNLGP15",
				"GEGLXNLGI15",
				"GEGLXNLGO15",
				"GEGLXNLGP15",
				"GEXNLGI15",
				"GEXNLGO15",
				"GEXNLGP15",
				"GEXNBA"
				);
	aDescriptionLines = new Array(
				"Tetra Contour LED Light Engine",
				"15mm White Tetra Contour Light Guide",
				"Tetra Contour LS Red Light Engine and Red Light Guide",
				"Tetra Contour LS Blue Light Engine and Blue Light Guide",
				"Tetra Contour LS Green Light Engine and Green Light Guide",
				"Tetra Contour LS White Light Engine (6500K) and White Light Guide",
				"Power Supply (24VDC / 80W), Input Voltage: 108-264VAC; Damp Rated; Self-Contained, Remote or Raceway; 1 Output Bank; Class 2",
				"18 AWG Supply Wire (0.82 sq. mm)",
				"22-14 AWG Twist-On Wire Connectors  (0.33 – 2.08 sq. mm)",
				"Tetra Contour Light Guide Mounting Clip",
				"Tetra Contour Light Guide Connector",
				"Tetra Contour Light Guide End Cap",
				"Tetra Contour Light Guide 90° Inside Corner (Blue)",
				"Tetra Contour Light Guide 90° Outside Corner (Blue)",
				"Tetra Contour Light Guide 90° Planar Corner (Blue)",
				"Tetra Contour Light Guide 90° Inside Corner (Red)",
				"Tetra Contour Light Guide 90° Outside Corner (Red)",
				"Tetra Contour Light Guide 90° Planar Corner (Red)",
				"Tetra Contour Light Guide 90° Inside Corner (Orange)",
				"Tetra Contour Light Guide 90° Outside Corner (Orange)",
				"Tetra Contour Light Guide 90° Planar Corner (Orange)",
				"Tetra Contour Light Guide 90° Inside Corner (Yellow)",
				"Tetra Contour Light Guide 90° Outside Corner (Yellow)",
				"Tetra Contour Light Guide 90° Planar Corner (Yellow)",
				"Tetra Contour Light Guide 90° Inside Corner (Lime Green)",
				"Tetra Contour Light Guide 90° Outside Corner (Lime Green)",
				"Tetra Contour Light Guide 90° Planar Corner (Lime Green)",
				"Tetra Contour Light Guide 90° Inside Corner (Green)",
				"Tetra Contour Light Guide 90° Outside Corner (Green)",
				"Tetra Contour Light Guide 90° Planar Corner (Green)",
				"Tetra Contour Light Guide 90° Inside Corner (White)",
				"Tetra Contour Light Guide 90° Outside Corner (White)",
				"Tetra Contour Light Guide 90° Planar Corner (White)",
				"Tetra Contour Silicon Bend-Aid"
				);
	aQuantity = new Array(
				"/box",
				"/box",
				"/box",
				"/box",
				"/box",
				"/box",
				"/box",
				"/spool",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag",
				"/bag"
				);
	aComponents = new Array(
				"feet",
				"pieces",
				"ft",
				"ft",
				"ft",
				"ft",
				"each",
				"feet",
				"connectors",
				"clips",
				"connectors",
				"end caps",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"each",
				"bend-aids"
				);
	aOrder = new Array(
				"boxes",
				"boxes",
				"boxes",
				"boxes",	   
				"spool",
				"each",
				"boxes",
				"spool",
				"boxes",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag.",
				"Bag."
				);
	
	
///////////////////////////////////////////////////////
		
	sStr = "<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" width=\"100%\">";
	sStr += "<tr>";
	sStr += "<td align=\"center\" bgcolor=\"#3B73B9\" valign=\"bottom\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\" color=\"#FFFFFF\"><b>SKU</b></font></td>";
	sStr += "<td align=\"center\" bgcolor=\"#3B73B9\" colspan=\"2\" valign=\"bottom\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\" color=\"#FFFFFF\"><b>Component Description</b></font></td>";
	/*sStr += "<td align=\"center\" width=\"10\" bgcolor=\"#3B73B9\">&nbsp;</td>";*/
	sStr += "<td align=\"center\" bgcolor=\"#3B73B9\" valign=\"bottom\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\" color=\"#FFFFFF\"><b>Quantity</b></font></td>";
	sStr += "<td align=\"center\" width=\"10\" bgcolor=\"#3B73B9\">&nbsp;</td>";
	sStr += "<td align=\"center\" bgcolor=\"#3B73B9\" valign=\"bottom\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\" color=\"#FFFFFF\"><b>Components<br>Needed to Support<br><span id=\"feetSupported\" style=\"position:relative;\"></span></b>&nbsp;<b><span id=\"spUnits1\" style=\"position:relative;\">feet</span></b></font></b></td>";
	sStr += "<td align=\"center\" bgcolor=\"#3B73B9\" valign=\"bottom\" width=\"80\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\" color=\"#FFFFFF\"><b>Minimum System Order Qty.</b></font></td>";
	sStr += "</tr>";
	
	///////////////////////////////////////////////////////////////////////////
	
	for(i=0;i<34;i++) {
		
		if(i==2 || i==3  || i==4 || i==5)
		{
		var clr= "#3B73B9";
			
		}else
		{
		var clr="";
		}
		
		if(i==2)
		{
			sStr += "<tr id=\"display_line\" style=display:none>";
			sStr += "<td colspan=9 align=\"left\" bgcolor=\"#F7F7F7\" style=\"border-top-width: 1px;border-bottom-width: 1px;	border-top-style: dashed;border-bottom-style: dashed;border-top-color: #CCCCCC;	border-bottom-color: #CCCCCC;\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#3B73B9\"><small>(For straight run sections, the above two sku's may be replaced with the preassembled light engine and light guide SKU below.) </small></font></td></tr>";
		}
		
		sStr += "<tr id=row_"+i+">";
		sStr += "<td align=\"left\" bgcolor=\"#F7F7F7\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\" color= "+clr+"><b><span id=\"rb" + aUnitNames[i] + "SKU\" style=\"position:relative;\">" + aSKU[i] + "</span></b></font></td>";
		sStr += "<td width=\"140\" bgcolor=\"#F7F7F7\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\" color= "+clr+"><span id=\"rb" + aUnitNames[i] + "DESC\" style=\"position:relative;\">" + aDescriptionLines[i] + "</span></font></td>";
		sStr += "<td bgcolor=\"#F7F7F7\">&nbsp;</td>";
		sStr += "<td align=\"center\" bgcolor=\"#F7F7F7\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\" color= "+clr+"><span id=\"rb" + aUnitNames[i] + "QTY\" style=\"position:relative;\"></span>" + aQuantity[i] + "</font></td>";
		sStr += "<td bgcolor=\"#F7F7F7\">&nbsp;</td>";
		sStr += "<td align=\"center\" bgcolor=\"#F7F7F7\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\" color= "+clr+"><span id=\"rb" + aUnitNames[i] + "Supp\" style=\"position:relative;\">" + aComponents[i] + "</span></font></td>";
		sStr += "<td align=\"center\" bgcolor=\"#F7F7F7\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-2\" color= "+clr+"><span id=\"rb" + aUnitNames[i] + "Order\" style=\"position:relative;\">" + aOrder[i] + "</span></font></td>";
		sStr += "</tr>";
		
		if(i==33)
		{
			sStr += "<tr>";
			sStr += "<td colspan=9 align=\"left\" bgcolor=\"#F7F7F7\" style=\"border-top-width: 1px;border-bottom-width: 1px;	border-top-style: dashed;border-bottom-style: dashed;border-top-color: #CCCCCC;	border-bottom-color: #CCCCCC;\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#3B73B9\"><small>Please refer to the installation instructions for additional information regarding the Tetra Contour system.</small> <a href=\"http://www.lumination.com/literature/ContourInstallWEB1_08.pdf\" target=\"_blank\" class=\"pdflink\" style=\"font-size:10px\"><u>Tetra Contour install instructions</u></a> or  <a href=\"http://www.lumination.com/literature/ContourInstallWEB1_08.pdf\" target=\"_blank\" class=\"pdflink\" style=\"font-size:10px\"><u>Tetra Contour LS install instructions</u></a>.</font></td></tr>";
		}
		
		
	
	}
	<!--sStr += "<tr><td bgcolor=\"#F7F7F7\" colspan=9 >&nbsp;</td></tr>";-->
	sStr += "</table>";
	
	document.getElementById("divResults").innerHTML = sStr;
	document.getElementById("feetSupported").innerHTML = "1000";
	document.getElementById("spUnits1").innerHTML = "feet";
}
