var xmlHttp;
var hide = new Array();
function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest;
	} 
} 
function GetData(t,d,l,V) {
 var lk = t ? t : 'ajdetails';
 var Vd = V ? V : 'data_type';
  if (hide[Vd] == 1 && Vd != 'data_type') { document.getElementById(Vd).innerHTML=""; hide[Vd] = 0;}
   else { 
	createXMLHttpRequest();
	var url="index.php?a="+lk+"&do="+d;
        if(l){ url += "&lid="+l; }
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange= function() {
	if (xmlHttp.readyState==1) {
		document.getElementById(Vd).innerHTML="<center>Loading...</center>";
	} 
	if (xmlHttp.readyState==4 && xmlHttp.status==200) {
		document.getElementById(Vd).innerHTML="";
		document.getElementById(Vd).innerHTML=xmlHttp.responseText;
                hide[Vd] = 1;
	} 
};
	xmlHttp.send(null);
  }
 } 

checkEmail = function(email) {
  if (!email)
  {
    return 1;
  }
  else
  {
    a = email.indexOf('@');
    b = email.indexOf('@', a+1);
    c = email.lastIndexOf('.');
    if (a == -1 || b != -1 || c <= a + 2 || a < 1 || c + 2 >= email.length || c + 5 < email.length)
    {
      return 2;
    }
  }
  return 0;
}
