/* javascript/contact.js 
 */ 

function validEmail(ema){
	if(ema.match(/^[A-Za-z0-9_\+-]+(\.[A-Za-z0-9_\+-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.([A-Za-z]{2,4})$/)){
		return true;
	}else{
		return false;
	}
}
 
function contact(frm){
	if(frm.name.value=""||frm.email.value==""||frm.subject.value==""||frm.message.value==""){
		alert('All information on the contact us form is required so that we may help you.'+"\n\n"+'Please enter all information and submit the form.'+"\n\n");
		return false;
	}else{
		if(!validEmail(frm.email.value)){
			alert('The email address you entered is not valid.'+"\n\n"+'Please enter you email address and then submit the form.');
			return false;
		}else{
			frm.action.value='contact';
			return true;
		}
	}
}

