
var obj;


function chkDupUserId(UserId)

{  
  
  var xmlHttp;
  
  try
    {   
	 // Firefox, Opera 8.0+, Safari
	    xmlHttp=new XMLHttpRequest();    
    }
  
  catch (e)
    {
        // Internet Explorer    
     
        try
          {
	      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
          }
       catch (e)
       {      
	    try
              {
		    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
	      }
            catch (e)
            { 
 		       alert("Your browser does not support AJAX!");  
		       return false;       
	    }
      }    
    } 

 	var url;

	obj=UserId;	
	url = "DupUserId.php?UserId=" + UserId.value;
	
	xmlHttp.onreadystatechange=resDupUserId;
	xmlHttp.open("GET",url,true);
	xmlHttp.send();


function resDupUserId()
{

	  if(xmlHttp.readyState==4)
    	  {
	    // Get the data from the server's response
		
		
	       if (xmlHttp.responseText == 1)
	       {
	       		alert ("Username not available, try another Username");
			obj.focus();
		}
		else
		{

		}
		
	  }
}

}
