// JavaScript Document
var xmlHttp;
function checkSname(str)
{
		
  if (str.length==0)
  {   	
	document.getElementById('sname_error').innerHTML="";
  	return;
  }

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="add_url.php";
url=url+"?no="+str;

url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
/*          to check browser support ajax or not*/
function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}

/*----------------end of the function -----------------------*/


function stateChanged() 
{ 
	
	if (xmlHttp.readyState==1)
	{ 	
		//document.getElementById('sname_error').innerHTML=xmlHttp.responseText;
		//var t=xmlHttp.responseText;	
		document.getElementById('load').innerHTML="<img src='images/loading.gif' border='0'>";
		
	}

	if (xmlHttp.readyState==4)
	{ 	
		//document.getElementById('sname_error').innerHTML=xmlHttp.responseText;
		var t=xmlHttp.responseText;		
		document.getElementById('name').innerHTML=t;
		document.getElementById('load').innerHTML="";
		
	}
	
	
}




