var xmlHttp
var curinrate
var curexrate
var newexrate
var newinrate

function calAmt(str1,str2,str3)
{
 if ((parseFloat(str1)==0) || !parseFloat(str1))
 { 
  alert("Enter Loan Amount")
  return
 }

 xmlHttp=GetXmlHttpObject()
 if (xmlHttp==null)
 {
  alert ("Browser does not support HTTP Request")
  return
 } 
 var url="http://theinternationallendinggroup.com/_library/templates/cal.asp"
 curinrate=parseFloat(str3)
 url=url+"?amt="+str1
 url=url+"&exrt="+str2
 url=url+"&sid="+Math.random()

 xmlHttp.onreadystatechange=stateChanged
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)

 curexrate=parseFloat(str2)
 curinrate=parseFloat(str3)

} 

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  var result=xmlHttp.responseText
  //alert(result);
   // document.getElementById("sflnamt").innerHTML=result 
	 //document.getElementById("ert").value=result 
 // document.getElementById("pmtsf").innerHTML=Math.round((result*curinrate)/12/100)
  //document.getElementById("pmtus").innerHTML=Math.round((result*curinrate)/12/100/curexrate)
  
   document.getElementById("sflnamt").value=Math.round(result)
	 //document.getElementById("ert").value=result 
  document.getElementById("pmtsf").value=Math.round((result*curinrate)/12/100)
  document.getElementById("pmtus").value=Math.round((result*curinrate)/12/100/curexrate)
 
 } 
}

function GetXmlHttpObject()
{
 var xmlHttp=null;
 try
 {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
 }
 catch (e)
 {
  // Internet Explorer
  try
  {
   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch (e)
  {
   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
 return xmlHttp;
}// JavaScript Document

