function addSubscriber(){
	var email_address = document.getElementById('email_address').value;
	str = email_address;		
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
		alert("Invalid email")
		document.getElementById("email_address").focus();
		error = true;
		return false
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		alert("Invalid email")
		document.getElementById("email_address").focus();
		error = true;
		return false
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Invalid email")
		document.getElementById("email_address").focus();
		error = true;
		return false
	}
	if (str.indexOf(at,(lat+1))!=-1){
		alert("Invalid email")
		error = true;
		return false
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Invalid email")
		document.getElementById("email_address").focus();
		error = true;
		return false
	}
	if (str.indexOf(dot,(lat+2))==-1){
		alert("Invalid email")
		document.getElementById("email_address").focus();
		error = true;
		return false
	}
	if (str.indexOf(" ")!=-1){
		alert("Invalid email")
		document.getElementById("email_address").focus();
		error = true;
		return false
	}
	if(error){
		xmlHttp = GetXmlHttpObject()
		if (xmlHttp==null){
			alert("Browser does not support HTTP Request")
			return
		}
		var url="../add-subscriber.php?email_address="+email_address
		xmlHttp.onreadystatechange=function(){
			commentStateChanged()
		};
		xmlHttp.open("GET", url, true)
		xmlHttp.send(null)
	}
}
function commentStateChanged() {
	if (xmlHttp.readyState==1){ 
		document.getElementById("msg").innerHTML = xmlHttp.responseText;
	}
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("msg").innerHTML = xmlHttp.responseText;
	}
}
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;
}