// JavaScript Document

function isEmailAddr (s){ 
	var rv = false
	if ((s == null) || (s.length == 0)) 
       	rv = false;
 	 else {
		var reEmail =/([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		//reEmail = /.+\@.+\..+$/
		
		rv = reEmail.test(s)
    }
	if(rv){
		return rv
	}else{
		return false
	}
}
 
function validation(theForm){
	if (theForm.firstname.value == ""){
    	alert("Please enter your name.");
    	theForm.firstname.focus();
    	return (false);
  	}
	if (theForm.surname.value == ""){
    	alert("Please enter your surname.");
    	theForm.surname.focus();
    	return (false);
  	}
	if (theForm.jobtitle.value == ""){
    	alert("Please enter your job title.");
    	theForm.jobtitle.focus();
    	return (false);
  	}
	if (theForm.company.value == ""){
    	alert("Please enter your company.");
    	theForm.company.focus();
    	return (false);
  	}
	if (theForm.Country.value == ""){
    	alert("Please select your country.");
    	theForm.Country.focus();
    	return (false);
  	}
	if (theForm.telephone.value == ""){
    	alert("Please enter your telephone number.");
    	theForm.telephone.focus();
    	return (false);
  	}
  	if (!isEmailAddr(theForm.email_from.value)){
    	alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    	theForm.email_from.focus();
    	return (false);
 	}
	return (true);
}
