function GetXmlHttpObject()
{
   try { return new XMLHttpRequest(); } catch(e) {}
   try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
   alert("XMLHttpRequest not supported");
   return null;
}

function ajaxRequest(action,div){
	xmlHttp = GetXmlHttpObject();
    //alert(document.getElementById(div).innerHTML);
	document.getElementById(div).innerHTML="<br /><br /><br /><br /><center><img src='images/loading.gif'></center>";
	xmlHttp.onreadystatechange=function(){stateChanged(div);}
	xmlHttp.open("GET",action,true);
	xmlHttp.send(null);
}
function stateChanged(div){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		//alert('--'+xmlHttp.responseText+'--');
		
		//document.getElementById('phoneno').value = xmlHttp.responseText;
		if(div=="amountx" && xmlHttp.responseText!='Destination MSISDN out of range'){
		document.getElementById("hiddeninfo").style.display = 'block';
		}
		document.getElementById(div).innerHTML = xmlHttp.responseText;
		// Fixation starts here
		if(myFunction!=null)
		{
			myFunction();
		}
		// Fixation ends here
	}
}
 function callFunc(func, args, div){
      ajaxRequest('phoenix/includes/functions.php?fun='+func+'&args='+args,div)
  }
    
