// JavaScript Document
var email = /^([\w.-]+)@(([\w.-]+\.)+\w+)$/;
var phone = /^0[\d]{9,11}$/;
$(document).ready(function() {
	$('#contactform').submit(function(){
		if($('#contactname').val()==''){
			$('#errorDiv').html('You must enter a Contact Name').show('slow');
			return false;
		}else if($('#companyname').val()==''){
			$('#errorDiv').html('You must enter a Company Name').show('slow');
			return false;
		}else if($('#position').val()==''){
			$('#errorDiv').html('You must enter a Position').show('slow');
			return false;
		}else if($('#telephonenumber').val()==''){
			$('#errorDiv').html('You must enter a Contact Telephone Number').show('slow');
			return false;
		}else if($('#emailaddress').val()==''){
			$('#errorDiv').html('You must enter a Contact Email Address').show('slow');
			return false;
		}else if(email.test($('#emailaddress').val())==false){
			$('#errorDiv').html('Contact Email Address is not a vaild email address').show('slow');
			return false;
		}else if(phone.test($('#telephonenumber').val())==false){
			$('#errorDiv').html('Contact Telephone Number is not a vaild email telephone number').show('slow');
			return false;
		}else{
			return true;
		}
	});
});