var xmlHttp;

function validateSendEmail(emailAddress){ 
	xmlHttp = GetXmlHttpObject();
	
	if(xmlHttp==null){
		alert("Browser does not support HTTP Request");
		return false;
	}
	var url="remember_Pass.php?emailAddress="+emailAddress;
	
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}

function stateChanged(){ 
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById('table_Msg').style.display = '';
		
		if(xmlHttp.responseText == "ERROR"){
			document.getElementById('table_Msg').className = 'msg errorMail';
			document.getElementById('msg_text').innerHTML = 'Error, email address not found. Please try again.';
			document.getElementById('msg_image').src = 'system/images/error.gif';
		}else{
			document.getElementById('table_Msg').className = 'msg sendMail';
			document.getElementById('msg_text').innerHTML = 'Your login information has been sent to your email address.';
			document.getElementById('msg_image').src = 'system/images/ok.gif';
		}
	} 
}

function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		xmlHttp = new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
	}catch(e){
		//Internet Explorer
		try{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}