// JavaScript Document


 function isEmailAddr(email){
    var result = false
    var theStr = new String(email)
    var index = theStr.indexOf("@");
    if (index > 0){
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
    result = true;

    }
	else{
	window.alert("You entered a non-valid email address, please try again");	
	}
    return result;
	
    }

    //Name and Email Validation.
    function join(){
        var check=true;
        var error="You failed to complete the following compulsory fields;\n\n";
        if (document.forms[0].elements['email'].value=="") { error+="EMAIL\n";check=false;}
        if (document.forms[0].elements['email'].value==""){alert("Please enter all your details.");return(false);}
        if (!isEmailAddr(document.forms[0].elements['email'].value)){alert("Please enter a complete email address in the form: yourname@yourdomain.com");return(false);}
        
        if (error!="You failed to complete the following compulsory fields;\n\n"){alert(error);}
        return check;           
        }
        
  