function tell_report(a) 
{
     info_x = document.getElementById('the_info');
   
	// AJAX stuff
    getAJAX = getHTTPObject();
    if (getAJAX.readyState == 4 || getAJAX.readyState == 0) 
	{
	    
		getAJAX.open("GET","http://localhost/hero/chkaval.php?usernmae=" + a , true);
        getAJAX.onreadystatechange = function () 
		{
			if (getAJAX.readyState == 4){
    	   document.getElementById("the_info").style.display="block";
		   info_x.innerHTML = getAJAX.responseText;
		   
			}
     	}
  		getAJAX.send(null);
	}
    
}

 function chkavailability() 
{
   
    var a ;
	var all_ele;
		all_ele = document.form1;

    a = all_ele.username.value;
	
    //more onLoad stuff
    tell_report(a);
	//var  getAJAX;
   //getAJAX = getHTTPObject();
    
}


//initiates the XMLHttpRequest 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;
    }
  }	
  return xmlhttp;
}
