//FUNCTION: validateEmail
//Contains a least one character procedding the @
//Contains a "@" following the procedding character(s)
//Contains at least one character following the @, followed by a dot (.), 
//	followed by either a two character or three character string 
//	(a two character country code or the standard three character US code, such as com, edu etc)
function validateEmail(sEmailAddress){
	//create the regexp to test the email address text
	var oEmailRegExp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	//perform the test and return success as appropriate
	if (oEmailRegExp.test(sEmailAddress)){
		return true;
	}else{
		return false;
	}
}

function validateRegistrationForm(){
	var oEmail = document.getElementById("email");
	var oCv = document.getElementById("attachCV");
	
	if(validateEmail(oEmail.value) == false){
		alert("Please enter a valid email address");
		oEmail.focus();
		return false;
	}

	if(oCv.value == ""){
		alert("Please select your CV.");
		oCv.focus();
		return false;
	}
	return true;
}
