// Javascript Document
<!--
function isANumeric(sText, sMessage)
{
   var ValidChars = "0123456789.";
   var isANumber=true;
   var Char;
   for (i = 0; i < sText.length && isANumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         isANumber = false;
		 alert("Please use only numbers and the '.' as decimal for the " + sMessage + " field");
         }
      }
   return isANumber;
   
   }


function calc_mort() { //v.0.1
  var d=document; 
if (d.mortcalc.amount.value == '' || d.mortcalc.interest.value == '' || d.mortcalc.years.value == ''){
		alert("Please to make an estimation of your mortgage fill the Total Amount, Rate and Time");
		return false;
}else if (d.mortcalc.amount.value == '0' || d.mortcalc.interest.value == '0' || d.mortcalc.years.value == '0'){
		alert("Please don't use the zero value for the calculation");
		return false;
} else if (isANumeric(d.mortcalc.amount.value,"Amount") && isANumeric(d.mortcalc.interest.value,"Interest") && isANumeric(d.mortcalc.years.value,"Time in Years")){
		 var pv= Number(d.mortcalc.amount.value);
		 var rate = Number((d.mortcalc.interest.value/12)/100);
		 var nper = Number(d.mortcalc.years.value*12);	
	    var valoraux = 1/(Math.pow((1+rate),nper));
		 var valor = Math.round(pv*100*rate/(1-valoraux))/100;
		 d.mortcalc.valorcalc.value = "Pay " + valor + " €/month";			
} else {return false;}
}

function verAmount() { //v.0.1
	var d=document; 
	if (d.cconv.Amount.value == ''){
		alert("Please fill the Amount to convert it in the other currency");
		return false;
	}else if (d.cconv.Amount.value == '0'){
		alert("Please don't use the zero value for the calculation");
		return false;
	} else if (isANumeric(d.cconv.Amount.value,"Amount to convert")){
		return true;
	} else {return false;}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

 function swapVis(div1, div2) { //v0.1
	div1id=MM_findObj(div1);div2id=MM_findObj(div2);
	div2id.style.display='none';
	div1id.style.display='inline';
}
//-->