var xmlHttp;
var intID;

function showHint(str,str2,str3)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

   
var url="resources/getcurrencyconv.php";
url=url+"?q="+str+"&d="+str2+"&z="+str3;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateChanged() 
{ 
	clearInterval(intID);
	
	document.getElementById('prog').style.display="block";
	document.getElementById("txtHint").innerHTML	
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById('prog').style.display="none";
		document.getElementById("txtHint").style.height="0px";
		document.getElementById("txtHint").style.display="block";
		intID=setInterval("increHeight()",10);
		document.getElementById("txtHint").innerHTML="<strong>Results</strong><br>"+xmlHttp.responseText;
	}
}

function increHeight()
{	
	if(parseInt(document.getElementById('txtHint').style.height)<40)
		document.getElementById('txtHint').style.height=parseInt(document.getElementById('txtHint').style.height)+2+"px";		
}

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