<!-- begin
function validateDate( strValue ) {
/************************************************
DESCRIPTION: Validates that a string contains only 
    valid dates with 2 digit day, 2 digit month, 
    4 digit year. Date separator can be / only
    Uses combination of regular expressions and 
    string parsing to validate date.
    Ex. dd/mm/yyyy
    
PARAMETERS:
   strValue - String to be tested for validity
   
RETURNS:
   True if valid, otherwise false.
   
REMARKS:
   Avoids some of the limitations of the Date.parse()
   method such as the date separator character.
*************************************************/
  var objRegExp = /^\d{2}(\/)\d{2}\1\d{4}$/;
 
  //check to see if in correct format
  if(!objRegExp.test(strValue))
    return false; //doesn't match pattern, bad date
  else{
    var arrayDate = strValue.split(RegExp.$1); //split date into month, day, year
	var intDay = parseInt(arrayDate[0],10); 
	var intMonth = parseInt(arrayDate[1],10);
	var intYear = parseInt(arrayDate[2],10);
    
	//check for valid day
	if(intDay > 31 || intDay < 1) {
		return false;
	}
	
	//check for valid month
	if(intMonth > 12 || intMonth < 1) {
		return false;
	}
	
	//check for valid year
	if(intYear > 2100 || intYear < 2001) {
		return false;
	}
	
    //create a lookup for months not equal to Feb.
    var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31,
                        '08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31}
  
    //check if month value and day value agree
    if(arrayLookup[arrayDate[1]] != null) {
      if(intDay <= arrayLookup[arrayDate[1]] && intDay != 0)
        return true; //found in lookup table, good date
    }
		
    //check for February
	var booLeapYear = (intYear % 4 == 0 && (intYear % 100 != 0 || intYear % 400 == 0));
    if( ((booLeapYear && intDay <= 29) || (!booLeapYear && intDay <=28)) && intDay !=0)
      return true; //Feb. had valid number of days
  }
  return false; //any other values, bad date
}



function checkPromotions() {

incorrectEntry	= "";

promotionsHeadline		= document.form.promotionsHeadline.value;
promotionsArticle			= document.form.promotionsArticle.value;
promotionsDate			= document.form.promotionsDate.value;


//property must have an address
if (promotionsHeadline == "") 
{
	incorrectEntry += "\n - Enter the Headline for the promotion";
}

//property must have an associated town
if (promotionsArticle == "") 
{
	incorrectEntry += "\n - Enter the Text for the promotion";
}

if (promotionsArticle.length >= 2000) 
{
	infoLength = (promotionsArticle.length - 2000);
	incorrectEntry += "\n - Reduce Article Text by "+ infoLength +" characters";
}

if (promotionsDate == "") 
{
	incorrectEntry += "\n     -  Enter the job Closing Date";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
// end of checkPromotions()
}




function checkNews() {

incorrectEntry	= "";

newsHeadline		= document.form.newsHeadline.value;
newsArticle			= document.form.newsArticle.value;
newsDate			= document.form.newsDate.value;


//property must have an address
if (newsHeadline == "") 
{
	incorrectEntry += "\n - Enter the Headline for the news";
}

//property must have an associated town
if (newsArticle == "") 
{
	incorrectEntry += "\n - Enter the Text for the news";
}

if (newsArticle.length >= 2000) 
{
	infoLength = (newsArticle.length - 2000);
	incorrectEntry += "\n - Reduce Article Text by "+ infoLength +" characters";
}

if(!newsDate == "")
	{
	//validate the dates
	if (!validateDate(newsDate) == true)
		incorrectEntry += "\n - Enter a date in the format requested (dd/mm/yyyy)";
	}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
// end of checkNews()
}

function checkLinks() {

incorrectEntry	= "";

linkTitle		= document.form.linkTitle.value;
linkURL			= document.form.linkURL.value;



//property must have an address
if (linkTitle == "") 
{
	incorrectEntry += "\n - Enter the Title for the link";
}

//property must have an associated town
if (linkURL == "") 
{
	incorrectEntry += "\n - Enter the URL for the link";
}

if (linkTitle.length >= 60) 
{
	infoLength = (linkTitle.length - 60);
	incorrectEntry += "\n - Reduce Title by "+ infoLength +" characters";
}

if (linkURL.length >= 60) 
{
	infoLength = (linkURL.length - 60);
	incorrectEntry += "\n - Reduce URL by "+ infoLength +" characters";
}


if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
// end of checkNews()
}




function checkVacancies() {

incorrectEntry	= "";

jobRef = document.form.jobRef.value;
jobTitle = document.form.jobTitle.value;
jobSalary = document.form.jobSalary.value;
jobClosingDate = document.form.jobClosingDate.value;
jobMainDuties = document.form.jobMainDuties.value;

if (jobRef == "") 
{
	incorrectEntry += "\n     -  Enter the job Ref";
}

if (jobTitle == "") 
{
	incorrectEntry += "\n     -  Enter the job Title";
}

if (jobSalary == "") 
{
	incorrectEntry += "\n     -  Enter the job Salary";
}

if(!jobClosingDate == "")
	{
	//validate the dates
	if (!validateDate(jobClosingDate) == true)
		incorrectEntry += "\n - Enter a date in the format requested (dd/mm/yyyy)";
	}

if (jobMainDuties == "") 
{
	incorrectEntry += "\n     -  Enter the job Main Duties";
}

if (jobMainDuties.length >= 2000) 
{
	infoLength = (jobMainDuties.length - 2000);
	incorrectEntry += "\n - Reduce Main Duties Text by "+ infoLength +" characters";
}


if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditMISSIONSTATEMENT() {

incorrectEntry	= "";

MISSIONSTATEMENT = document.form.MISSIONSTATEMENT.value;

if (MISSIONSTATEMENT == "") 
{
	incorrectEntry += "\n     -  Enter the MISSION STATEMENT text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditPROFILE() {

incorrectEntry	= "";

PROFILE = document.form.PROFILE.value;

if (PROFILE == "") 
{
	incorrectEntry += "\n     -  Enter the PROFILE text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditDEPOTLOCATIONS() {

incorrectEntry	= "";
count = 0;

for(var i=0; i < document.form.elements.length; i++)
	{
		e = document.form.elements[i];
		if (e.type == "text" && e.value == "")
			{
				count ++;
			}
	}
	
if (count != 0) 
{
	alert("\n Please Ensure a telephone number is entered in all boxes\n");
	return false;
}
else return true;
}

function checkEditDOMESTIC() {

incorrectEntry	= "";

DOMESTIC = document.form.DOMESTIC.value;

if (DOMESTIC == "") 
{
	incorrectEntry += "\n     -  Enter the DOMESTIC text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditCOMMERCIAL() {

incorrectEntry	= "";

COMMERCIAL = document.form.COMMERCIAL.value;

if (COMMERCIAL == "") 
{
	incorrectEntry += "\n     -  Enter the COMMERCIAL text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditAGRICULTURAL() {

incorrectEntry	= "";

AGRICULTURAL = document.form.AGRICULTURAL.value;

if (AGRICULTURAL == "") 
{
	incorrectEntry += "\n     -  Enter the AGRICULTURAL text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditLUBRICANTS() {

incorrectEntry	= "";

LUBRICANTS = document.form.LUBRICANTS.value;

if (LUBRICANTS == "") 
{
	incorrectEntry += "\n     -  Enter the LUBRICANTS text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditMARINE() {

incorrectEntry	= "";

MARINE = document.form.MARINE.value;

if (MARINE == "") 
{
	incorrectEntry += "\n     -  Enter the MARINE text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditPETROL() {

incorrectEntry	= "";

PETROL = document.form.PETROL.value;

if (PETROL == "") 
{
	incorrectEntry += "\n     -  Enter the PETROL text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditFUELCARDS() {

incorrectEntry	= "";

FUELCARDS = document.form.FUELCARDS.value;

if (FUELCARDS == "") 
{
	incorrectEntry += "\n     -  Enter the FUELCARDS text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditCOSTSAVERS() {

incorrectEntry	= "";

COSTSAVERS = document.form.COSTSAVERS.value;

if (COSTSAVERS == "") 
{
	incorrectEntry += "\n     -  Enter the COSTSAVERS text";
}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkEditPrices() {

incorrectEntry	= "";
count = 0;

for(i=0; i<=document.forms[0].elements.length; i++)
	{
		if (document.forms[0].elements[i].value == "")
			count ++;
	}
	
if (count == 0) 
	incorrectEntry += "\n Please Ensure a value is entered in all boxes";

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkExtractDataDate() {

incorrectEntry	= "";

dateRecordEdited			= document.form.dateRecordEdited.value;

if (dateRecordEdited == "") 
{
	incorrectEntry += "\n     -  Enter a date";
}

if(!dateRecordEdited == "")
	{
	//validate the dates
	if (!validateDate(dateRecordEdited) == true)
		incorrectEntry += "\n - Enter a date in the format requested (dd/mm/yyyy)";
	}

if (incorrectEntry != "") 
{
	incorrectEntry = "Please amend the following fields and submit again :-\n" + 	
					"___________________________________________\n" + incorrectEntry + 	
					"\n___________________________________________" ;
	alert(incorrectEntry);
	return false;
}
else return true;
}

function checkExistingLogin() 
{
var testEmail  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;

email = document.forms[0].email.value;
password = document.forms[0].password.value;
incorrectEntry = "";

//check if user has entered an e-mail address
if (email.length == 0) 
	{
		incorrectEntry += "\n   Please enter an e-mail address.";
	}

//check if user has entered a password
if (password.length == 0) 
	{
		incorrectEntry += "\n   Please enter your password.";
	}

//if e-mail address has been entered then check that it is valid
if (email.length != 0) 
	{
		if (testEmail.test(email) == false)
		{
			incorrectEntry += "\n   Please enter a valid e-mail address.";
		}
	}
	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkNewLogin() 
{
var testPostcode2 = /[a-zA-Z0-9]{3}/;
var testEmail  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;

email = document.forms[1].email.value;
postcode =document.forms[1].postcode.selectedIndex;
postcode2 = document.forms[1].postcode2.value;
fullName = document.forms[1].fullName.value;

incorrectEntry = "";

//check if user has entered their full Name
if (fullName.length == 0) 
	{
		incorrectEntry += "\n   Please enter your Name.";
	}

if (email.length == 0) 
	{
		incorrectEntry += "\n   Please enter an e-mail address.";
	}

//if e-mail address has been entered then check that it is valid
if (email.length != 0) 
	{
		if (testEmail.test(email) == false)
		{
			incorrectEntry += "\n   Please enter a valid e-mail address.";
		}
	}
	
if (document.forms[1].postcode.options[postcode].value == "select") {
incorrectEntry += "\n     Select the first part of your delivery postcode";
}

//check if user has entered second part of postcode
if (postcode2.length == 0) 
	{
		incorrectEntry += "\n   Please enter the second part of your delivery postcode.";
	}

if (postcode2.length != 0) 
	{
		if (testPostcode2.test(postcode2) == false)
		{
			incorrectEntry += "\n   Please ensure the second part of your postcode is valid.";
		}
	}
	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkSelectProduct() 
{



product =document.forms[0].product.selectedIndex;
loadSizeLitres =document.forms[0].loadSizeLitres.selectedIndex;

incorrectEntry = "";

	
if (document.forms[0].product.options[product].value == "select") {
incorrectEntry += "\n     Select the product";
}

if (document.forms[0].loadSizeLitres.options[loadSizeLitres].value == "select") {
incorrectEntry += "\n     Select the Quantity";
}
	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkCheckPrice() 
{
var testEmail  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;
var is_checked = document.forms[0].DUPLICATEADDRESS.checked;

customerName =document.forms[0].customerName.value;
//accountNumber =document.forms[0].accountNumber.value;
invoiceAddress1 =document.forms[0].invoiceAddress1.value;
invoiceAddress2 =document.forms[0].invoiceAddress2.value;
invoiceAddress3 =document.forms[0].invoiceAddress3.value;
invoiceCity =document.forms[0].invoiceCity.value;
invoicePostcode =document.forms[0].invoicePostcode.value;
deliveryAddress1A =document.forms[0].deliveryAddress1A.value;
deliveryAddress2A =document.forms[0].deliveryAddress2A.value;
deliveryAddress3A =document.forms[0].deliveryAddress3A.value;
deliveryCityA =document.forms[0].deliveryCityA.value;
deliveryPostcodeA =document.forms[0].deliveryPostcodeA.value;
telephone =document.forms[0].telephone.value;
mobile =document.forms[0].mobile.value;
email =document.forms[0].email.value;
deliveryDate =document.forms[0].deliveryDate.value;
password =document.forms[0].password.value;
password2 =document.forms[0].password2.value;

incorrectEntry = "";
count = 0;

if (email.length == 0) 
	{
		incorrectEntry += "\n   Please enter an e-mail address.";
	}

//if e-mail address has been entered then check that it is valid
if (email.length != 0) 
	{
		if (testEmail.test(email) == false)
		{
			incorrectEntry += "\n   Please enter a valid e-mail address.";
		}
	}
	
if (customerName.length == 0) 
	{
		incorrectEntry += "\n   Please enter your name";
	}
	
if (invoiceAddress1.length == 0) 
	{
		incorrectEntry += "\n   Please enter your invoice address.";
	}
	
if (invoiceCity.length == 0) 
	{
		incorrectEntry += "\n   Please enter your invoice city.";
	}
	
if (invoicePostcode.length == 0) 
	{
		incorrectEntry += "\n   Please enter your invoice Postcode.";
	}
	
if (password.length == 0) 
	{
		incorrectEntry += "\n   Please enter a password.";
	}
	
if (password2.length == 0) 
	{
		incorrectEntry += "\n   Please confirm your password.";
	}
	
if (deliveryDate.length == 0) 
	{
		incorrectEntry += "\n   Please enter a delivery Date.";
	}
	
if (telephone.length == 0 && mobile.length == 0 )
	{
		incorrectEntry += "\n   Please enter a telephone contact.";
	}
	
//for(i=0; i<document.forms[0].PAYMENTMETHOD.length; i++)
//	{
//		if (document.forms[0].PAYMENTMETHOD[i].checked)
//			count ++;
//	}
	
//if (count == 0) 
//	incorrectEntry += "\n Please Select a Payment Type";
	
	
	
if (is_checked == false)

{

if (deliveryAddress1A.length == 0) 
	{
		incorrectEntry += "\n   Please enter your delivery address.";
	}
	
if (deliveryCityA.length == 0) 
	{
		incorrectEntry += "\n   Please enter our delivery City.";
	}
	
if (deliveryPostcodeA.length == 0) 
	{
		incorrectEntry += "\n   Please enter your delivery Postcode.";
	}
}

	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkFeedback() 
{
var testEmail  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;

email = document.forms[0].email.value;
fullName = document.forms[0].fullName.value;
postcode = document.forms[0].postcode.value;
incorrectEntry = "";

//check if user has entered their Name
if (fullName.length == 0) 
	{
		incorrectEntry += "\n   Please enter your Name.";
	}
	
//check if user has entered their Postcode
if (postcode.length == 0) 
	{
		incorrectEntry += "\n   Please enter your Postcode.";
	}

//check if user has entered an e-mail address
if (email.length == 0) 
	{
		incorrectEntry += "\n   Please enter an e-mail address.";
	}

//if e-mail address has been entered then check that it is valid
if (email.length != 0) 
	{
		if (testEmail.test(email) == false)
		{
			incorrectEntry += "\n   Please enter a valid e-mail address.";
		}
	}
	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkWellcallyou() 
{
var testEmail  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;

fullName = document.forms[0].fullName.value;
email = document.forms[0].email.value;
telephone = document.forms[0].telephone.value;
incorrectEntry = "";

//check if user has entered their name
if (fullName.length == 0) 
	{
		incorrectEntry += "\n   Please enter Your name.";
	}

//check if user has entered a telephone number
if (telephone.length == 0) 
	{
		incorrectEntry += "\n   Please enter telephone number.";
	}
	
//check if user has entered an e-mail address
if (email.length == 0) 
	{
		incorrectEntry += "\n   Please enter an e-mail address.";
	}

//if e-mail address has been entered then check that it is valid
if (email.length != 0) 
	{
		if (testEmail.test(email) == false)
		{
			incorrectEntry += "\n   Please enter a valid e-mail address.";
		}
	}
	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkForgotPassword() 
{
var testEmail  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;

email = document.forms[0].email.value;

incorrectEntry = "";

//check if user has entered an e-mail address
if (email.length == 0) 
	{
		incorrectEntry += "\n   Please enter an e-mail address.";
	}

//if e-mail address has been entered then check that it is valid
if (email.length != 0) 
	{
		if (testEmail.test(email) == false)
		{
			incorrectEntry += "\n   Please enter a valid e-mail address.";
		}
	}
	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkEditAccount() 
{
var testEmail  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;


customerName =document.forms[0].customerName.value;
accountNumber =document.forms[0].accountNumber.value;
invoiceAddress1 =document.forms[0].invoiceAddress1.value;
invoiceAddress2 =document.forms[0].invoiceAddress2.value;
invoiceAddress3 =document.forms[0].invoiceAddress3.value;
invoiceCity =document.forms[0].invoiceCity.value;
invoicePostcode =document.forms[0].invoicePostcode.value;
deliveryAddress1A =document.forms[0].deliveryAddress1A.value;
deliveryAddress2A =document.forms[0].deliveryAddress2A.value;
deliveryAddress3A =document.forms[0].deliveryAddress3A.value;
deliveryCityA =document.forms[0].deliveryCityA.value;
deliveryPostcodeA =document.forms[0].deliveryPostcodeA.value;
telephone =document.forms[0].telephone.value;
mobile =document.forms[0].mobile.value;
email =document.forms[0].email.value;
password =document.forms[0].password.value;
password2 =document.forms[0].password2.value;

incorrectEntry = "";


if (email.length == 0) 
	{
		incorrectEntry += "\n   Please enter an e-mail address.";
	}

//if e-mail address has been entered then check that it is valid
if (email.length != 0) 
	{
		if (testEmail.test(email) == false)
		{
			incorrectEntry += "\n   Please enter a valid e-mail address.";
		}
	}
	
if (customerName.length == 0) 
	{
		incorrectEntry += "\n   Please enter your name";
	}
	
if (invoiceAddress1.length == 0) 
	{
		incorrectEntry += "\n   Please enter your invoice address.";
	}
	
if (invoiceCity.length == 0) 
	{
		incorrectEntry += "\n   Please enter your invoice city.";
	}
	
if (invoicePostcode.length == 0) 
	{
		incorrectEntry += "\n   Please enter your invoice Postcode.";
	}
	
if (deliveryAddress1A.length == 0) 
	{
		incorrectEntry += "\n   Please enter your delivery address.";
	}
	
if (deliveryCityA.length == 0) 
	{
		incorrectEntry += "\n   Please enter our delivery City.";
	}
	
if (deliveryPostcodeA.length == 0) 
	{
		incorrectEntry += "\n   Please enter your delivery Postcode.";
	}
	
if (password.length == 0) 
	{
		incorrectEntry += "\n   Please enter a password.";
	}
	
if (password2.length == 0) 
	{
		incorrectEntry += "\n   Please confirm your password.";
	}
	
if (telephone.length == 0) 
	{
		incorrectEntry += "\n   Please enter your telephone.";
	}
	
	
if (incorrectEntry != "") {
incorrectEntry ="_____________________________\n" +
"Please amend the following fields :-\n" +
incorrectEntry + "\n_____________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}

function checkCompetition() {


competitionText = document.forms[0].competitionText.value;
competitionQuestion = document.forms[0].competitionQuestion.value;
competitionAnswer1 = document.forms[0].competitionAnswer1.value;
competitionAnswer2 = document.forms[0].competitionAnswer2.value;
competitionAnswer3 = document.forms[0].competitionAnswer3.value;

incorrectEntry	= "";
infoLength	= "";
count = 0;

for(i=0; i<document.forms[0].correctAnswerID.length; i++)
	{
		if (document.forms[0].correctAnswerID[i].checked)
			count ++;
	}
	
if (count == 0) 
	incorrectEntry += "\n Please choose an answer by selecting a radio button";

if (competitionText == "") 
{
	incorrectEntry += "\n - Enter the text for the competiton";
}

if (competitionText.length >= 1000) 
{
	infoLength = (competitionText.length - 2000);
	incorrectEntry += "\n - Reduce Text by "+ infoLength +" characters";
}

if (competitionQuestion == "") 
{
	incorrectEntry += "\n - Enter the Question";
}

if (competitionAnswer1 == "") 
{
	incorrectEntry += "\n - Enter answer 1";
}

if (competitionAnswer2 == "") 
{
	incorrectEntry += "\n - Enter answer 2";
}

if (competitionAnswer3 == "") 
{
	incorrectEntry += "\n - Enter answer 3";
}


if (incorrectEntry != "") {
incorrectEntry ="_____________________________________________\n" +
incorrectEntry + "\n_____________________________________________" +
"\n  Please re-enter and submit again!";
alert(incorrectEntry);
return false;
}
else return true;
}



// End -->

