
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;
}
var http = getHTTPObject(); // We create the HTTP Object

var url = "find_email.php?param="; 
function handleHttpResponse() {
	
	

       if (http.readyState==4)
        {
                var response = http.responseText;
				
                if(response==1)
                {
                       alert("This Email Already used ! Please write another valid email.");
                       document.customForm.email.value="";
                       document.customForm.email.focus();
                       return true;
                }

        }
}
function chk_email() {
	var emailValue = document.customForm.email.value;
    http.open("GET", url + escape(emailValue), true);
    http.onreadystatechange = handleHttpResponse;
    isWorking = true;
    http.send(null);
}




function getHTTPObject3() {
  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;
}
var httpp = getHTTPObject3(); // We create the HTTP Object

var urll = "find_username.php?param3="; 
function handleHttpResponse3() {

       if (httpp.readyState==4)
        {
                var response = httpp.responseText;
                if(response==1)
                {
                        alert("This usernaame already used ! Please write another username. ");
                        document.customForm.username.value="";                       
                        document.customForm.username.focus();
                        return true;
                }
        }
}
function chk_username() {
    var usernameValue = document.customForm.username.value;
    httpp.open("GET", urll + escape(usernameValue), true);
    httpp.onreadystatechange = handleHttpResponse3;
    isWorking = true;
    httpp.send(null);
}
