function OpenWindow(openURL,windowName,features) 
{
  window.open(openURL,windowName,features);
}


function any_pop(url,width,height)
	{
		newWin = window.open(url, "", "width="+ width +",height="+ height +",toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
		newWin.focus();
	}
	

function show(ii,jj)
{
if (document.getElementById(ii).checked)
	document.getElementById(jj).style.display = 'block';
else
	document.getElementById(jj).style.display = 'none';
}


function calcPay(){
	fff=document.fMortgage;
	nMortgage = fff.mortgage.value*(1-fff.percentage.value/100);
	nAmort = fff.amort.value;
	nIntrate = fff.intrate.value;
	nFreq = fff.freq.value;
	nCompound=2;
	var compound = nCompound/12;
	var monTime = nAmort * 12;
	var rate = (nIntrate*1.0)/100;
	var yrRate = rate/nCompound;
	var rdefine    = Math.pow((1.0 + yrRate),compound)-1.0;
	var payment = (nMortgage*rdefine * (Math.pow((1.0 + rdefine),monTime)))/  ((Math.pow((1.0 + rdefine),monTime)) - 1.0);
	if(payment!=0) 
		{payment =Math.round(payment*100)/100;
		 sPeriod="month";
		if(nFreq==12){ payment=payment; sPeriod="month";}
		if(nFreq==24){ payment=payment/2.0; sPeriod="semi-month"; }
		if(nFreq==26){ payment=payment/2.0; sPeriod="bi-week"; }
		if(nFreq==52){payment=payment/4.0;  sPeriod="week";}
		
		
		fff.paymentM.value="$" + payment + "/"+sPeriod;
		}
	}

