function usernamechk(uname)
{ 
var uln=uname.length;
if((uln<6) || (uln>15))
{

alert("Username legth should be between 6 and 15 characters");
document.form1.REQUSERID.value="";
document.form1.REQUSERID.focus();
return false;
}
else
{
 
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;        
}      
}    
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.responseText==1)
{
alert("Username Already Exist")
document.form1.REQUSERID.value="";
document.form1.REQUSERID.focus();
return false;
}
else
{
return true;
}
}
}
xmlHttp.open("GET","username.asp?user="+uname,true);
xmlHttp.send(null); 
}
}
