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;

}

// function for filter table




//-------------------------temp fav--------------------
function chkemail(email)

 {	
 if(email == ""){

		document.getElementById("email_chk").innerHTML = "Please Enter e-mail";

	}
 if(email != ""){

		
	  	var filter=/^.+@.+\..{2,3}$/;

		if(!filter.test(email)){

			document.getElementById("email_chk").innerHTML = "Please Enter Valid e-mail";

		}else{

	var query='action=chkemail&mail='+email;

	var i=0;

	xmlhttp=getxmlhttpobject();
   //query=query+"type="+type+"&rec="+i;

	document.getElementById("email_chk").innerHTML="<img src='images/icon_loading.gif' height='20' width='20' />";

	xmlhttp.onreadystatechange=function()

	{

		if (xmlhttp.readyState==4)
			  { 
				chck = xmlhttp.responseText;
				if(chck == 1)
				{ 
					 document.getElementById("email_chk").innerHTML = 'Already taken Choose another';
					 alert('Already taken Choose another.');
					 document.getElementById("m__Email").value ='';
					 document.getElementById("m__Email").focus();
					 return false;
				}
				document.getElementById("email_chk").innerHTML = '';
				
			  }

	}

	//alert("pass.php?"+query);

	xmlhttp.open("GET","pass.php?"+query,true);

	xmlhttp.send(null);

	return false;
		}

}
 }
function linkkex(id){
	//alert(id);
	//exit;
	xmlhttp = getxmlhttpobject();
	var query="link1="+id;
	//document.getElementById("ajaxrep").innerHTML='Restoring Database...';
	xmlhttp.onreadystatechange=function(){
  		if (xmlhttp.readyState==4){
			//document.getElementById("ajaxrep").innerHTML=xmlhttp.responseText;
   			parent.location.reload(true);
   			
  		}
 	}
	//alert(query);
 		xmlhttp.open("GET","pass.php?action=link12&"+query,true);
 		xmlhttp.send(null);
 		return false;
	
}




