var http = getHTTPObject(); // We create the HTTP Object

function getHTTPObject() {

  var xmlhttp;

  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

    try {

      xmlhttp = new XMLHttpRequest();

    } catch (e) {

      xmlhttp = false;

    }

  }
  else
  {
	xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.3.0");
  }

  return xmlhttp;

}
function handleAlexa() {

  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText;
	document.getElementById('alexa').innerHTML = results;
	 document.getElementById('submit').disabled= false ; 
	 
	}
}

function handleHttpResponse() {

  if (http.readyState == 4) {
    // Split the comma delimited response into an array
    results = http.responseText;
	document.getElementById('pr').innerHTML = "PR: " + results;
	 document.getElementById('submit').disabled= false ; 
	 
	 		var atoj = new Date();
	  var tid = atoj.toGMTString();
	  var url = document.mosForm.web.value;
	 document.getElementById('alexa').innerHTML="<img src='../images/rotation.gif'>"; 
	 document.getElementById('submit').disabled= true ; 
	 http.open("GET", "http://smallwebsitehost.com/stat/pr.php?alexa=" + escape(url)+"&tid=" + escape(tid), true);
	  http.onreadystatechange = handleAlexa;
	  http.send(null);
  }
}

function pr() {

		var atoj = new Date();
	  var tid = atoj.toGMTString();
	  var url = document.mosForm.web.value;
	 document.getElementById('pr').innerHTML="<img src='../images/rotation.gif'>"; 
	 document.getElementById('result').innerHTML="Results of: " + url ; 
	 document.getElementById('submit').disabled= true ; 
	 http.open("GET", "http://smallwebsitehost.com/stat/pr.php?url=" + escape(url)+"&tid=" + escape(tid), true);
	  http.onreadystatechange = handleHttpResponse;
	  http.send(null);
 }


