/*-------------------------------------------------------------------------
	-- File: contact_validate.js
	-- Purpose: contact form client-side validation 
	-- Note:						
	--
	--  History:
			Date				By				Comments
		----------- 			----------	-------------------------------------
	-- 27 FEB 2008		S Martin	Created
	-- --------------------------------------------------------------------
*/

function validator(form)
{
	//Validate name
	if(notEmpty(form.name.value)==false)
	{
		alert("Please enter your name.");
		form.name.focus();
		return false;
	}

	//Validate contact email
	if(notEmpty(form.email.value)==false)
	{
		alert("Please enter your email address (i.e. 'yourname@yourdomain.com').");
		form.email.focus();
		return false;
	}else{
		//form.email.value = strip(" \n\r\t",form.email.value); 
		if(validateEMail(form.email.value)==false)
		{
			alert("Please enter a valid email address (i.e. 'yourname@yourdomain.com').");
			form.email.focus();
			return false;
		}
	}
	
	return true;
}


