<!--
vCurrentTab = "pTabLength";
function IM_showPriceTab(tabID) {
	if (vCurrentTab != tabID) { 
		eval(layerRef + vCurrentTab + endLayerRef + styleRef + ".display= 'none'");
	}
	vCurrentTab = tabID;
	eval(layerRef + tabID + endLayerRef + styleRef + ".display= 'block'");

	// Make the new radio button "checked"
	var thisOption = "RB_" + tabID;
	var object = document.getElementById (thisOption);
	object.checked=true;

}

function IM_calcChop() {
	// Calculate ChopLength
	ChopCalcSuccessful = "";
	if ( (isNaN(document.getElementById("chopWidth").value)) || (document.getElementById("chopWidth").value == '')) { 
		alert("Frame Width must be a number."); 
	}
	else if ( (isNaN(document.getElementById("chopHeight").value)) || (document.getElementById("chopHeight").value == '')) { 
		alert("Frame Height must be a number."); 
	}
	else {
	fWidth = parseFloat(document.getElementById("chopWidth").value);
	fHeight = parseFloat(document.getElementById("chopHeight").value);
	cBase = 2 * (fWidth + fHeight);
	cExtra = 8 * parseFloat(ChopMouldingWidth);
	chopCalcFeet = (cBase + cExtra) / 12;
	chopCalcFeet = Math.round(chopCalcFeet * Math.pow(10,2))/Math.pow(10,2);

	if (document.getElementById("chopBoreYes").checked == true ) {
		chopCalcResult = (chopCalcFeet * ChopPricePerFoot) + ChopPriceBore;
	}
	else {
		chopCalcResult = chopCalcFeet * ChopPricePerFoot;
	}

	// Set SX-Chop-Length hidden field to calculated total length in feet
	document.getElementById("ChopLength").value = chopCalcFeet;

	// Show calculation
	document.getElementById("chopCalcPrice").innerHTML = formatCurrency(chopCalcResult);
	ChopCalcSuccessful = "yes";
	}
}

function IM_calcChopReset() {
	// Set SX-Chop-Length hidden field to NULL
	document.getElementById("ChopLength").value = "";

	// Show "Calculate" button
	document.getElementById("chopCalcPrice").innerHTML = "<a href='javascript:IM_calcChop();'><img src='buttons/calculate.gif'></a>";
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}

// Calculate Chop Price & submit form
function IM_addChopToCart() {
	IM_calcChop();
	if (ChopCalcSuccessful == "yes") { document.ChopOrder.submit(); }
}


-->