function change( cell, newColor ) {
  document.getElementById(cell).style.backgroundColor = newColor;
}

function unchange( cell, newColor ) {
  document.getElementById(cell).style.backgroundColor = newColor;
}

function mostrar(id) {
	/*current=(document.getElementById(id).style.display == 'none') ? 'block' : 'none';*/
	/*document.getElementById(id).style.display = current;*/
	document.getElementById(id).style.display = 'block';
}

function ocultar(id) {
	document.getElementById(id).style.display = 'none';
}

function Img(URL, ancho, alto) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=0,toolbar=0,location=0,statusbar=0,menubar=0,resizable=0,width='+ancho+',height='+alto+'');");
}

function Img2(URL, ancho, alto) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1,toolbar=0,location=0,statusbar=0,menubar=0,resizable=0,width='+ancho+',height='+alto+'');");
}

function Morgcal()
{
	form = document.hipoteca
	LoanAmount= form.h_capital.value
		
	DownPayment= "0"
	AnnualInterestRate = form.h_interes.value/100
	Years= form.h_plazo.value
		MonthRate=AnnualInterestRate/12
	NumPayments=Years*12
	Prin=LoanAmount-DownPayment
	
	MonthPayment=Math.floor((Prin*MonthRate)/(1-Math.pow((1+MonthRate),(-1*NumPayments)))*100)/100
		//form.NumberOfPayments.value=NumPayments
	form.h_mes.value=MonthPayment
}
