var xmlHttp;

function sendInfo(email) {

    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null) {
        alert ("Could not retrieve xmlHttp object!");
        return;
    } 

    if (!echeck(email)) {
	alert("Invalid Email");
	return false;
    }
    else {
        var url="sendInfo.php";
        url=url+"?email="+email;
        xmlHttp.onreadystatechange=stateChanged;
        xmlHttp.open("GET",url,true);
        xmlHttp.send(null);
    }
} 

function stateChanged() { 

    if (xmlHttp.readyState==4) { 
        var responseText = xmlHttp.responseText;
	if (responseText == "success") {
	    alert("Your registration information has been re-sent to you.");
	}
	else {
	    alert("There was an error re-sending your registration information. Please ensure you entered the correct email address.");	
	}
    }
}

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;
}


