// Title: validateContactFormMSP.js
// JavaScript Document

// Written by David Balfour Feb 2004
// Version history
// 18/03/04		Ver 1  DB	
// 20/04/06             Ver 1.1 WM
//
// Adapted by Bill MacTaggart Apr 2006


function validateForm()
{
  // Checks that mandatory fields are not empty.

	var allValid = true;

	if ( contactForm.sendersName.value.length <= 0 )
	{
                // Sender's name has not been entered.
		alert("Please enter your name.");
		contactForm.sendersName.focus();
		allValid = false;
	}
	else if ( contactForm.sendersAddress.value.length <= 0 )
	{
                // Sender's address has not been entered.
		alert("Please enter your address.");
		contactForm.sendersAddress.focus();
		allValid = false;
	}
	else if ( contactForm.sendersPostcode.value.length <= 0 )
	{
                // Sender's post code has not been entered.
		alert("Please enter your postcode.");
		contactForm.sendersPostcode.focus();
		allValid = false;
	}
	else if ( contactForm.sendersEmail.value.length <= 0 )
	{
                // Sender's email address has not been entered.
		alert("Please enter your email address.");
		contactForm.sendersEmail.focus();
		allValid = false;
	}
	else if ( contactForm.sendersMessage.value.length <= 0 )
	{
                // Sender's message has not been entered.
		alert("Please enter your message.");
		contactForm.sendersMessage.focus();
		allValid = false;
	}
	return allValid;
}
