function loadurl(email,opt) {
try {
    xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
    // browser doesn't support ajax. handle however you want
}

xmlhttp.onreadystatechange = triggered;
// open takes in the HTTP method and url.
var email_link = "/jscript/email_ajax_checker.php?e="+document.getElementById(email).value+"&opt="+opt+"&tbox="+email;
//window.alert(email_link);
xmlhttp.open("GET", email_link, true);
xmlhttp.send(null);
}

function triggered() {
if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
    // xmlhttp.responseText object contains the response.
	//results = xmlhttp.responseText.split("-");
	results = xmlhttp.responseText.split("[space]");
	if(results[0] == "Registered")
		{
		//ShowContent_alert('pop_alert','We have found your details in our database. Please login.','login','login.php');
		//document.getElementById('pop_alert').focus();
		window.alert("You are rgistered with us. Please use retrive password option.\n Login again with your user name and password.\t");
		location.href='/services/cvdistribution/cvdistribution_login.php';
		}
	else if(results[0] == "Invalid")
		{
		//ShowContent_alert('pop_alert','This e-mail ("'+ results[1] +'") is invalid.',results[2]);
		//document.getElementById('pop_alert').focus();
		window.alert("This e-mail ("+ results[1] +") is invalid.\t");
		document.getElementById(results[2]).focus();
		document.getElementById(results[2]).select();
		}
	}
} 