function check_form() {
	for (i = 0; i < document.contact.elements.length; i++) { 
		oElem = document.contact.elements[i]; 
		if (oElem.type != "submit") { 
			oElem.style.borderColor='';	
		} 
	}
	var error_field=document.getElementById('error');					

	if (document.contact.email.value!='')
	{
		var pattern = '^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$';
		if (!document.contact.email.value.match(new RegExp(pattern)))
		{
			document.contact.email.style.borderColor='red';
			document.contact.email.focus();						
			error_field.innerHTML = "Invalid E-mail address format.";
			return false;				
		}					
	 }
	 else
	 {
			document.contact.email.style.borderColor='red';
			document.contact.email.focus();
			error_field.innerHTML = 'E-mail address is required.';
			return false;
	 }
	if (document.contact.name.value=='')
	{
		document.contact.name.style.borderColor='red';
		document.contact.name.focus();
		error_field.innerHTML = 'Full Name is required.';
		return false;											
	}	
	return true;					 
} 
