// JavaScript Document
var axmlHttp
function check_captch(code){
  
 axmlHttp=aGetXmlHttpObject();
	if (axmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
   	document.getElementById('error-msg').innerHTML = '<img src="images/indicator_blue_small.gif">';
	document.getElementById('error-msg').innerHTML+= 'Please Wait...';
	alert("sdfsdfs");
	var url="check_captch.php";
	url=url+"?code="+code;
 	axmlHttp.onreadystatechange=stateChangeuser;
	axmlHttp.open("GET",url,true);
	axmlHttp.send("UsernmaeSuggestions");
	
}

function stateChangeuser() 
{ 
	if (axmlHttp.readyState==4){ 
		//document.getElementById(tdid).innerHTML=xmlHttp.responseText;
		if (axmlHttp.status == 200){
			var response = axmlHttp.responseText;
			document.getElementById("error-msg").innerHTML = response;
			
 			}
		}
	}
 
function aGetXmlHttpObject()
{
var axmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  axmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    axmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    axmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return axmlHttp;
}

function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
	var pindex = theStr.indexOf(".",index);
	if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}