// JavaScript Document
	var xmlHttp;
	var ResponseDivID;
	var ActionCode = 0;
	var SiteURL = "http://www.beitcertified.com/";
	var loading='please wait...<img src="images/loading.gif" />';
	function AjaxFn(RequestURL, DivId){
		ResponseDivID=DivId;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null){
			alert ("Browser does not support HTTP Request");
			return;
		}
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",RequestURL,true);
		xmlHttp.send(null);
	}
	
	function stateChanged(){
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			if(ActionCode==1 && xmlHttp.responseText=='true'){
				document.getElementById(ResponseDivID).innerHTML='<span id="yes"><b>Congratualation!!!</b></span><br />Sign up successfully done. Now redirecting '+loading;
				setTimeout('window.location="'+document.FrmSignup.RedirectTo.value+'";',2000);
			}
			else if(ActionCode==1 && xmlHttp.responseText=='false'){
				document.getElementById(ResponseDivID).innerHTML='<span id="no">Already registered!</span>';
			}//Sign up response checking
			else if(ActionCode==2 && xmlHttp.responseText=='true'){
				document.getElementById(ResponseDivID).innerHTML='<span id="yes">Successfully sign in!!!</span><br />Now redirecting '+loading;
				setTimeout('window.location="'+document.FrmSignin.RedirectTo.value+'";',2000);
			}
			else if(ActionCode==2 && xmlHttp.responseText=='false'){
				document.getElementById(ResponseDivID).innerHTML='<span id="no">Invalid signin information!!!</span>';
			}//Sign in response checking
			else if(ActionCode==3 && xmlHttp.responseText=='true'){
				document.getElementById(ResponseDivID).innerHTML='<span id="yes">Successfully sign up!!!</span><br />Now redirecting '+loading;
				setTimeout('window.location="'+document.FrmAffSignup.RedirectTo.value+'";',2000);
			}
			else if(ActionCode==3 && xmlHttp.responseText=='false'){
				document.getElementById(ResponseDivID).innerHTML='<span id="no">Sign up does not completed sucessfully.!!!</span>';
			}//Affiliate Sign up response checking
			else if(ActionCode==4 && xmlHttp.responseText=='true'){
				document.getElementById(ResponseDivID).innerHTML='<span id="yes">Successfully sign in!!!</span><br />Now redirecting '+loading;
				setTimeout('window.location="'+document.FrmSignin.RedirectTo.value+'";',2000);
			}
			else if(ActionCode==4 && xmlHttp.responseText=='false'){
				document.getElementById(ResponseDivID).innerHTML='<span id="no">Invalid signin information!!!</span>';
			}//Affiliate Sign in response checking
			else
				document.getElementById(ResponseDivID).innerHTML=xmlHttp.responseText;

			ActionCode=0;
		}
	}	
	
	function GetXmlHttpObject(){
		var objXMLHttp=null;
		if (window.XMLHttpRequest){
			objXMLHttp=new XMLHttpRequest();
		}
		else if (window.ActiveXObject){
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		return objXMLHttp;
	}
