// 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;}
}
  
//-->