  var http 				= false;

  if(navigator.appName == "Microsoft Internet Explorer") {
    http = new ActiveXObject("Microsoft.XMLHTTP");
  } else {
    http = new XMLHttpRequest();
  }

//Send phone and message
function sendMessage() {
  sShortcode  = document.frmEmulator.txtPhoneNumber.value;
  sMessage    = document.frmEmulator.txtMessage.value;
  
  sUrl = "http://www.paygol.com/ws/mp/emulator/paygol_micropayment.php?shortcode="+sShortcode+"&message="+sMessage; 

  http.open("GET", sUrl, true);

  http.onreadystatechange=function() {
  	if(http.readyState == 4) {
  		//alert(http.responseText);
 			document.getElementById("loader").style.display = "none";   			
 			document.getElementById("result").innerHTML = http.responseText;   			
    	document.getElementById("divNew").style.display = "block";   			
 		}
	}
	http.send(null);
}



//Send phone and message
function updateStatus(sServiceId, sObj, show, sLoader, sChangerEnabled, sChangerTesting, sStatus){
  //alert(sServiceId);
  //alert(sStatus);
  //alert(sChanger);
  
  sUrl = "http://www.paygol.com/update_status.php?serviceid="+sServiceId+"&status="+sStatus; 

  http.open("GET", sUrl, true);

  http.onreadystatechange=function() {
  	if(http.readyState == 4) {
  		//alert(http.responseText);
 			document.getElementById(sLoader).style.display = "none";
      if (sStatus=='Enabled'){ 
        document.getElementById(sChangerEnabled).style.display = "block";
        document.getElementById(sChangerTesting).style.display = "none";
		  }else{
        document.getElementById(sChangerEnabled).style.display = "none";
        document.getElementById(sChangerTesting).style.display = "block";
      }
 			//document.getElementById(sChanger).innerHTML = "<a href='javascript:changeStatus(\"sServiceId\", \"sObj\", true, \"sLoader\", \"sChanger\", \"sStatus\")' class='txt_small'><img src='http://www.paygol.com/images/icons/16x16/".$sStatusImage.".png' align='absmiddle' border='0'></a>&nbsp;<span class='txt_small'>"+sStatus+"</span>";   			
 			//document.getElementById(sChanger).innerHTML = "<a href='javascript:changeStatus("+sServiceId+", \"+sObj+\", true, sLoader, sChanger, sStatus);' class='txt_small'><span class='txt_small'><img src='http://www.paygol.com/images/icons/16x16/"+sStatus+".png' align='absmiddle' border='0'></a>&nbsp;"+sStatus+"</span>";   			
 			//document.getElementById("result").innerHTML = http.responseText;   			
    	//document.getElementById("divNew").style.display = "block";   			
 		}
	}
	http.send(null);
}
