
	var httpObj = false;
		try {
			  httpObj = new XMLHttpRequest();
		} catch (trymicrosoft) {
		  try {
				httpObj = new ActiveXObject("Msxml2.XMLHTTP");
		  } catch (othermicrosoft) {
			try {
			  httpObj = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (failed) {
			  httpObj = false;
			}
	  }
	}

	function SendExistRequest(Url,FieldName,Title){
		var SendUrl = Url+"&r="+Math.random(); 
		httpObj.open("GET", SendUrl, true);
		httpObj.onreadystatechange = function RecieveExistRequest(){
			if (httpObj.readyState == 4) {
				if(httpObj.responseText==1) {	 
					alert(Title + " already exists in database.Please enter another !!");
					document.getElementById(FieldName).select();
					return false;
				} else if(httpObj.responseText==0) {	 
					document.forms[0].submit();
				}else {
					alert("Error occur : " + httpObj.responseText);
					return false;
				}
			}
		};
		httpObj.send(null);
	}
	
	function LoginSend(Url){
		var SendUrl = Url+"&r="+Math.random(); 
		httpObj.open("GET", SendUrl, true);
		httpObj.onreadystatechange = function LoginRecieve(){
			if (httpObj.readyState == 4) {
				if(httpObj.responseText==1) {	 
					location.href = 'index.php';
					return false;
				} else if(httpObj.responseText==0) {	 
					alert("Invalid Email / Password !!");
					return false;
				}else {
					alert("Error occur : " + httpObj.responseText);
					return false;
				}
			}
		};
		httpObj.send(null);
	}
	
	function LogoutSend(){
		 if (document.getElementById("xMousePosition").value > 600 && document.getElementById("yMousePosition").value < 90){
			var SendUrl = '../logout.php?r='+Math.random(); 
			httpObj.open("GET",SendUrl, true);
			httpObj.onreadystatechange = function LogoutRecieve(){
				if (httpObj.readyState == 4) {
					//alert("You are logged out successfully !!");
				}
			};
			httpObj.send(null);
		 }
	}
	
	function ForgotPasswordSend(frm){
		if( ValidateForEmail(frm.forgotEmail, "Email")
			&& isEmail(frm.forgotEmail)
		){
			var SendUrl = 'ajax_member.php?forgotEmail='+frm.forgotEmail.value+"&r="+Math.random(); 
			httpObj.open("GET", SendUrl, true);
			httpObj.onreadystatechange = function ForgotPasswordRecieve(){
				if (httpObj.readyState == 4) {
					if(httpObj.responseText==1) {	 
						document.getElementById("MainDiv").innerHTML = '<Div class="greentxt">Your Login details are sent successfully !!</Div>';
					} else if(httpObj.responseText==0) {	 
						alert("Invalid Email, Please Enter a registered Email Id !!");
					}else {
						alert("Error occur : " + httpObj.responseText);
					}
					return false;
				}
			};
			httpObj.send(null);
			return false;
		}else{
			return false;
		}
	}
	


	