function calculateSavings(){
	obj = document.forms.savingsForm;
	//initialize and clean up cost
	var c = obj.cost.value;
	c = c.replace('$','');
	for(i=0;i<c.length;i++){
		if(c.indexOf(',') > -1){
			c = c.replace(',','');
		}
	}
	c = CheckNumber(c)
	//determine savings percentage
	var p = (matrix[obj.salary.value])/100;
	//calculate open doors cost
	var calc = c*p
	//display new cost
	obj.newCost.value='$'+calc.toFixed(2);
}
function CheckNumber(value){	
	
	var vld_Float =/^((\d+(\.\d*)?)|((\d*\.)?\d+))$/;

	if(eval(vld_Float).test(value)==false){
				
		return 0;
	}	
	return value;
}
function fncCenteredChildWindow(URL,vHeight,vWidth,vScroll,vStatus) {
	if (screen.width) {
		var winl=(screen.width-vWidth)/2;
		var wint=(screen.height-vHeight)/2;
	} else { 
		winl=0;wint=0;
	}
	if(winl<0)winl=0;
	if(wint<0)wint=0;
	var child = window.open(URL,'myWin','height='+vHeight+',width='+vWidth+',scrollbars='+vScroll+',status='+vStatus+',top='+wint+',left='+winl+',resizable=no');
	child.focus();
}

function programCostCalc(){
	total = document.getElementById('total').value;
	fncCenteredChildWindow('/includes/calc.php?p='+total,300,300,'yes','yes');
}