// JavaScript Document Author --> D.Milburn Date --> 24/06/2003
function processForm(frmContactRequest) 
{
var fn = document.frmContactRequest.txtFirstName.value;
var ln = document.frmContactRequest.txtSurname.value;
var email = document.frmContactRequest.txtEmail.value;
var day = document.frmContactRequest.txtDayPhone.value;
var eve = document.frmContactRequest.txtEvePhone.value;
var location = document.frmContactRequest.txtLocation.value;
var call = document.frmContactRequest.lstCallTime.value;
var enquiry = document.frmContactRequest.helpEnquiry.value;  
var emailnotvalid = "";
var errors = "";
var errormsg = "Please fill in the following fields: \n\n"; 

     if (fn == "") 
	 {     errors = true;
     errormsg += "-- Your first name \n";
     }
		if (ln == "") 
		{
        errors = true;
        errormsg += "-- Your last name \n";
     	}

     		if (email == "")
			{
          	errors = true;
          	errormsg += "-- Your e-mail address \n";
     		}
			else {
          		var checkemail = email.match(/^\w+[\.\w+]+@\w+[\.\w+]+\.+\w+$/);
        			if (checkemail == null)
						{
    					errors = true;
        				errormsg += "-- Please enter a valid e-mail address \n";
          				}
				}
				if (day == "")
				{
				errors = true;
				errormsg += "-- Your Daytime Telephone Number \n";
				}
     				if (eve == "")
					{
					errors = true;
					errormsg += "-- Your Evening Telephone Number \n";
					}
						if (location == "")
							{
          					errors = true;
          					errormsg += "-- Your location \n";
     						}
									if (call == "Null")
									{
          							errors = true;
									errormsg += "-- The time you would like us contact you \n";
     								}
										if (enquiry == "") 
											{
          									errormsg += "-- Your enquiry \n";
											}
		    	 					if (errors)
									{
        	  						alert(errormsg);
          							window.event.returnValue = false;
     								}
									else{
          								alert("Thank You. We will get in contact Soon!");
										window.event.returnValue = true;
										}
										
}
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="100%"><H2><center>Please complete the form below and tell us how we can help you.  We shall call you back as soon as possible</center><H2></td></tr></table><form method="post" name="frmContactRequest" action="../../cgi-bin/formmail.cgi"; onSubmit="processForm(); ">');
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="5" class="tablebackground"><tr><td width="40%">First Name</td><td width="60%" colspan="5"><input name="txtFirstName" type="text" id="txtFirstName" size="20" maxlength="40"></td></tr><tr><td>Last Name</td><td colspan="5"><input name="txtSurname" type="text" id="txtSurname" size="20" maxlength="40"></td></tr><tr><td height="22"> &nbsp;</td><td colspan="5">&nbsp;</td></tr><tr><td>Email Address</td><td colspan="5"><input name="txtEmail" type="text" id="txtEmail" size="40" maxlength="80"></td></tr><tr><td>Daytime Phone Number</td><td colspan="5"><input name="txtDayPhone" type="text" id="txtDayPhone"></td></tr><tr><td>Evening Phone Number</td><td colspan="5"><input name="txtEvePhone" type="text" id="txtEvePhone"></td></tr><tr><td>Town/City</td><td colspan="5"><input name="txtLocation" type="text" id="txtLocation"></td></tr><tr><td> Best time to call</td><td colspan="5"><select name="lstCallTime" size="1" id="lstCallTime"><option value="Null" selected>--Select Time--</option><option value="Before 9 am">Before 9am</option><option value="Between 9 am -12 pm">Between 9am - 12pm</option><option value="Between 12 pm - 5 pm">Between 12pm - 5 pm</option><option value="After 5 pm">After 5 pm</option></select></td></tr><tr><td> How can we help you?</td><td colspan="5"><textarea name="helpEnquiry" cols="40" rows="6" id="helpEnquiry"></textarea></td></tr><tr><td colspan="7"><div align="center"><input name="btnSubmit"type="submit"value="Submit"></div></td></tr></table></form>');