// MAILING LIST

function validateEmail(theEmail){
 
 
    var atLoc = theEmail.indexOf("@",1);
    var dotLoc = theEmail.indexOf(".",atLoc+2);
    var len = theEmail.length;
	
			if(theEmail == "") {
		
		window.alert("E-mail address is empty");
		return false;
		
		}
	
	
	
    if (atLoc > 0 && dotLoc > 0 && len > dotLoc+2){
        return true;
    	}
	if (len == 0){
		return true;
		}
	
 
		
    else{
        window.alert("Please enter a valid e-mail address.");
        return false;
    	}   
	}
 
 
 
 
 
function mailingList() {
 
var email = document.getElementById('email').value;
 
if(validateEmail(email)) { 
 
alert("Thanks all messages will now be sent to: "+email); 
return false;
} else {
return false;
 
}
}

