// JavaScript Document
function validate()
{
	
	if(document.frmQuote.name.value=="")
	{
		alert("Name cannot be empty");
		document.frmQuote.name.focus();
		return false;
	}
	
	if(document.frmQuote.position.value=="")
	{
		alert("Position cannot be empty");
		document.frmQuote.position.focus();
		return false;
	}
	
	if(document.frmQuote.organisation.value=="")
	{
		alert("Organisation name cannot be empty");
		document.frmQuote.organisation.focus();
		return false;
	}
	
	if(document.frmQuote.business.value=="")
	{
		alert("Business type cannot be empty");
		document.frmQuote.business.focus();
		return false;
	}
	
	if(document.frmQuote.email.value=="")
	{
		alert("Email cannot be empty");		
		document.frmQuote.email.focus();
		return false;		
	}

	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(document.frmQuote.email.value))) 
	{ 
		  alert("Please enter a valid email address.\n");
		  document.frmQuote.email.focus();
		  return false;	
	}	

	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
	if (document.frmQuote.email.value.match(illegalChars)) 
	{
		 alert("The email address contains illegal characters");
	     document.frmQuote.email.focus();
		  return false;	
	}
	
	
	if(document.frmQuote.phone.value=="")
	{
		alert("Phone cannot be empty");
		document.frmQuote.phone.focus();
		return false;
	}	
	
//	alert(document.frmQuote.txtcaptcha.value);
	if(document.frmQuote.txtcaptcha.value!="5")
	{

		//alert("Type the number that repeats twice");
		//document.frmQuote.txtcaptcha.focus();
		//return false;
	}
	
	return true;
}