//pointer to menu frame
var oMenu = top.fra_top;
var oElement = document.frmCalc;

function verifyQty(){
	if (isNaN (document.frmCalc.txtQty.value / 3)){
		alert ("Incorrect number.");
		document.frmCalc.txtQty.value = '1';
		document.frmCalc.txtQty.focus();
	}
	else if (parseInt(document.frmCalc.txtQty.value) > 50) {
		alert ("Quantity was set beyond 50 limit.");
		document.frmCalc.txtQty.value = '50';
		document.frmCalc.txtQty.focus();
	}
	
	oMenu.computeCost();
}

//IE5.0x specific
function addOption(oElement, text, val, idx){
	var option = new Option(text,val, true, true);
	oElement.options[idx] = option;
}


function init() {
	var returnflag = false;
	//if (oMenu.document.fMenu == undefined) return; // let the top frame do the job
	if ("object" != typeof(oMenu.document.fMenu)) return;
	//alert('load calc');
	var oElement = document.frmCalc;
	oMenu.polulateSelect (oElement.selHD, 24);
	oMenu.polulateSelect (oElement.selMD, 59);
	oMenu.polulateSelect (oElement.selDM, 31);
	oMenu.fillAppliances();
	oMenu.restoreList();
	//sync menu
	if (oMenu.isStateCalc == false) oMenu.setStateCalc();
	oMenu.checkThreshold();
}

function openApplTip()
{
	var newTipWindow = window.open ('calc_tip.asp', 'tip', 'location=0,resizable=yes,width=400,height=300,top=20,left=0');
	if (parseInt(navigator.appVersion) >= 4) newTipWindow.window.focus();
}