function checkAcupunctureFields() {
missinginfo = "";

if (document.form.M_App_Firstname.value == "") {
missinginfo += "\n     -  Applicants First Name";
}
if (document.form.M_App_Surname.value == "") {
missinginfo += "\n     -  Applicants Surname";
}
if(document.form.M_App_Address.value == "") {
missinginfo += "\n     -  Applicants Address";
}
if(document.form.M_App_Town.value == "") {
missinginfo += "\n     -  Applicants Town";
}
if(document.form.M_App_Telephone.value == "") {
missinginfo += "\n     -  Applicants Telephone";
}
if(document.form.email.value == "") {
missinginfo += "\n     -  Applicants Email";
}


if(document.form.M_Business_Name.value == "") {
missinginfo += "\n     -  Name of Business";
}
if(document.form.M_Premises_Address.value == "") {
missinginfo += "\n     -  Premises Address";
}
if(document.form.M_Premises_Town.value == "") {
missinginfo += "\n     -  Premises Town";
}
if(document.form.M_Premises_Telephone.value == "") {
missinginfo += "\n     -  Premises Telephone";
}
if(document.form.M_PrevRegd[0].checked && document.form.M_District_Council.value == "") {
missinginfo += "\n     -  Which District Council";
}
if(document.form.M_Convicted[0].checked && document.form.M_Offences.value == "") {
missinginfo += "\n     -  Please give details of offences";
}


if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else

 if (document.form.M_chkConfirm.checked == false )
	{
		alert('Tick box to confirm you have read and understood our declaration.');
		return false;
	}else
		return confirm('About to transfer you to WorldPay for secure payment\n\nContinue?') ;
	
}
onsubmit="return checkAcupunctureFields()"

function CopyAcupuncturefields() {
	document.form.M_Premises_Address.value = document.form.M_App_Address.value;
	document.form.M_Premises_Town.value = document.form.M_App_Town.value;
	document.form.M_Premises_Postcode.value = document.form.M_App_Postcode.value;
	document.form.M_Premises_Telephone.value = document.form.M_App_Telephone.value;
	document.form.M_Premises_Email.value = document.form.email.value;
	
	
}

function BlankAcupunctureFields() {
	document.form.M_Premises_Address.value = '';
	document.form.M_Premises_Town.value = '';
	document.form.M_Premises_Postcode.value = '';
	document.form.M_Premises_Telephone.value = '';
	document.form.M_Premises_Email.value = '';
	
}
function DisableAcupunctureFields() {
	document.form.M_District_Council.disabled = true;
	document.form.M_District_Council.className = 'disable';
	
	
}

function EnableAcupunctureFields() {
	document.form.M_District_Council.disabled = false;
	document.form.M_District_Council.className = 'enable';
	
}

function DisableAcupunctureFields2() {
	document.form.M_Offences.disabled = true;
	document.form.M_Offences.className = 'disable';
	
	
}

function EnableAcupunctureFields2() {
	document.form.M_Offences.disabled = false;
	document.form.M_Offences.className = 'enable';
	
}

function checkSkinFields() {
missinginfo = "";

if (document.form.M_App_Firstname.value == "") {
missinginfo += "\n     -  Applicants First Name";
}
if (document.form.M_App_Surname.value == "") {
missinginfo += "\n     -  Applicants Surname";
}
if(document.form.M_App_Address.value == "") {
missinginfo += "\n     -  Applicants Address";
}
if(document.form.M_App_Town.value == "") {
missinginfo += "\n     -  Applicants Town";
}
if(document.form.M_App_Telephone.value == "") {
missinginfo += "\n     -  Applicants Telephone";
}
if(document.form.email.value == "") {
missinginfo += "\n     -  Applicants Email";
}

if(document.form.M_Business_Name.value == "") {
missinginfo += "\n     -  Name of Business";
}
if(document.form.M_Premises_Address.value == "") {
missinginfo += "\n     -  Premises Address";
}
if(document.form.M_Premises_Town.value == "") {
missinginfo += "\n     -  Premises Town";
}
if(document.form.M_Premises_Telephone.value == "") {
missinginfo += "\n     -  Premises Telephone";
}
if(document.form.M_PrevRegd[0].checked && document.form.M_District_Council.value == "") {
missinginfo += "\n     -  Which District Council";
}
if(document.form.M_Convicted[0].checked && document.form.M_Offences.value == "") {
missinginfo += "\n     -  Please give details of offences";
}


if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
 if (document.form.M_chkTatooing.checked == false && document.form.M_chkEar.checked == false && document.form.M_chkElectro.checked == false)
	{
		alert('Tick 1 or more of the boxes to confirm you have read and understood our declaration.');
		return false;
	}else
		return confirm('About to transfer you to WorldPay for secure payment\n\nContinue?') ;
		
}
onsubmit="return checkSkinFields()"

function CopySkinfields() {
	document.form.M_Premises_Address.value = document.form.M_App_Address.value;
	document.form.M_Premises_Town.value = document.form.M_App_Town.value;
	document.form.M_Premises_Postcode.value = document.form.M_App_Postcode.value;
	document.form.M_Premises_Telephone.value = document.form.M_App_Telephone.value;
	document.form.M_Premises_Email.value = document.form.M_App_Email.value;
	
	
}

function BlankSkinFields() {
	document.form.M_Premises_Address.value = '';
	document.form.M_Premises_Town.value = '';
	document.form.M_Premises_Postcode.value = '';
	document.form.M_Premises_Telephone.value = '';
	document.form.M_Premises_Email.value = '';
	
}

function DisableSkinFields() {
	document.form.M_District_Council.disabled = true;
	document.form.M_District_Council.className = 'disable';
	
	
}

function EnableSkinFields() {
	document.form.M_District_Council.disabled = false;
	document.form.M_District_Council.className = 'enable';
	
}
function DisableSkinFields2() {
	document.form.M_Offences.disabled = true;
	document.form.M_Offences.className = 'disable';
	
	
}

function EnableSkinFields2() {
	document.form.M_Offences.disabled = false;
	document.form.M_Offences.className = 'enable';
	
}


function checkSocietyFields() {
missinginfo = "";


if(document.form.M_Firstname.value == "") {
missinginfo += "\n     -  Firstname";
}
if(document.form.M_Surname.value == "") {
missinginfo += "\n     -  Surname";
}
if(document.form.M_Society.value == "") {
missinginfo += "\n     -  Full Name of Society";
}

if(document.form.M_Address.value == "") {
missinginfo += "\n     -  Address of Society";
}
if(document.form.M_Town.value == "") {
missinginfo += "\n     -  Town ";
}
if(document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if(document.form.M_Telephone.value == "") {
missinginfo += "\n     -  Telephone";
}

if(document.form.M_Years.value == "") {
missinginfo += "\n     -  Number of lotteries held over last year";
}

if(document.form.M_Dates.value == "") {
missinginfo += "\n     -  Dates of lotteries";
}


if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
		return confirm('About to transfer you to WorldPay for secure payment\n\nContinue?') ;
	 
}
//onsubmit="return checkSocietyFields()"

function checkHealthFields() {
missinginfo = "";

if (document.form.App_Name.value == "") {
missinginfo += "\n     -  Name";
}
if(document.form.App_Address.value == "") {
missinginfo += "\n     -  Address";
}
if(document.form.App_Town.value == "") {
missinginfo += "\n     -  Town";
}
if(document.form.App_Telephone.value == "") {
missinginfo += "\n     -  Telephone";
}
if(document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if(document.form.Description.value == "") {
missinginfo += "\n     -  Description of Request";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
onsubmit="return checkFields()"

function checkPestFields() {
missinginfo = "";

if (document.form.App_Name.value == "") {
missinginfo += "\n     -  Name";
}
if(document.form.App_Address.value == "") {
missinginfo += "\n     -  Address";
}
if(document.form.App_Town.value == "") {
missinginfo += "\n     -  Town";
}
if(document.form.App_Telephone.value == "") {
missinginfo += "\n     -  Telephone";
}
if(document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if(document.form.Description.value == "") {
missinginfo += "\n     -  Description of Request";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
onsubmit="return checkPestFields()"

function checkBulkRefFields() {
missinginfo = "";

if (document.form.App_Name.value == "") {
missinginfo += "\n     -  Name";
}
if(document.form.App_Address.value == "") {
missinginfo += "\n     -  Address";
}
if(document.form.App_Town.value == "") {
missinginfo += "\n     -  Town";
}
if(document.form.App_Telephone.value == "") {
missinginfo += "\n     -  Telephone";
}
if(document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if(document.form.Description.value == "") {
missinginfo += "\n     -  Items to be collected";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
onsubmit="return checkBulkRefFields()"

function checkCompostFields() {
missinginfo = "";


if (document.form.name.value == "") {
missinginfo += "\n     -  Full Name";
}
if (document.form.address.value == "") {
missinginfo += "\n     -  Address";
}
if (document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if (document.form.tel.value == "") {
missinginfo += "\n     -  Telephone";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return confirm('About to transfer you to WorldPay for secure payment\n\nContinue?') ;
}
onsubmit="return checkCompostFields()"

function changeCompostdetails()
{
	document.form.MC_name2.value = document.form.name.value;
	document.form.MC_address2.value = document.form.address.value;
	document.form.MC_postcode2.value = document.form.postcode.value;
	document.form.MC_tel2.value = document.form.tel.value;
	document.form.MC_email2.value = document.form.email.value;
}
function clearCompostdetails()
{
	document.form.name2.value = ' ';
	document.form.address2.value = ' ';
	document.form.postcode2.value = ' ';
	document.form.tel2.value = ' ';	
	document.form.email2.value = ' ';
}

function CalcCompostFee(ThisVal) {
	var FeeAmount;
	if (document.form.M_Deliver[0].checked == true)
	
		document.form.Del_Charge.value = '7.00';
	else
		document.form.Del_Charge.value = '0';
	FeeAmount = eval(ThisVal * document.form.M_NumBins.value);
	FeeAmount = FeeAmount + eval(document.form.Del_Charge.value);
	document.form.M_Total_Amount.value = FeeAmount;
	document.form.amount.value = FeeAmount;
}

function CalcCompostFee2(ThisVal) {
	var FeeAmount;
	if (document.form.M_Deliver[0].checked == true)
		{
		document.form.Del_Charge.value = '7.00';
		FeeAmount = eval(ThisVal * document.form.M_NumBins.value);
		FeeAmount = FeeAmount + eval(document.form.Del_Charge.value);
		}
	else
		{
		document.form.Del_Charge.value = '0';
		FeeAmount = eval(ThisVal * document.form.M_NumBins.value);
		FeeAmount = FeeAmount + eval(document.form.Del_Charge.value);
		}
	document.form.desc.value = 'Compost Bins - ' + document.form.M_NumBins.value  + ' x Bin(s)';
	document.form.M_Total_Amount.value = FeeAmount;
	document.form.amount.value = FeeAmount;
}

function checkWheelieFields() {
missinginfo = "";


if (document.form.name.value == "") {
missinginfo += "\n     -  Full Name";
}
if (document.form.address.value == "") {
missinginfo += "\n     -  Address";
}
if (document.form.tel.value == "") {
missinginfo += "\n     -  Telephone";
}
if (document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if (document.form.postcode.value == "") {
missinginfo += "\n     -  PostCode";
}

if (document.form.name2.value == "") {
missinginfo += "\n     -  Delivery Full Name";
}
if (document.form.address2.value == "") {
missinginfo += "\n     -  Delivery Address";
}
if (document.form.tel2.value == "") {
missinginfo += "\n     -  Delivery Telephone";
}
if (document.form.email2.value == "") {
missinginfo += "\n     -  Delivery Email";
}
if (document.form.postcode2.value == "") {
missinginfo += "\n     -  Delivery PostCode";
}
if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
{
var sltStatus = false;
var chkLength = document.form.M_Bin_Type.length;
if (chkLength > 0){
 chkLength--;
 for (i=0; i<=chkLength; i++){
  if (document.form.M_Bin_Type[i].checked == true) sltStatus = true;
 }
}else{
 if (document.form.M_Bin_Type.checked == true) sltStatus = true; 
}
 
 if (!sltStatus) {
  alert("Please tick at least one Bin Type to order");
  return false;
 }else{
 	
    return true;
	
;
 }
}
}
onsubmit="return checkWheelieFields()"

function changeWheeliedetails()
{
	document.form.name2.value = document.form.name.value;
	document.form.address2.value = document.form.address.value;
	document.form.postcode2.value = document.form.postcode.value;
	document.form.tel2.value = document.form.tel.value;
	document.form.email2.value = document.form.email.value;
}
function clearWheeliedetails()
{
	document.form.name2.value = ' ';
	document.form.address2.value = ' ';
	document.form.postcode2.value = ' ';
	document.form.tel2.value = ' ';	
	document.form.email2.value = ' ';
}
function DisableWheelieType() {
						document.form.M_Bin_Type[0].disabled = true;
}				

function EnableWheelieType() {
	document.form.M_Bin_Type[0].disabled = false;
}	

function checkWheelie2Fields() {
missinginfo = "";

if (document.form.M_Total_Amount.value == "") {
missinginfo += "Please Select the Size of Bin you would Like";
}
if (missinginfo != "") {
alert(missinginfo);
return false;
}
else return confirm('About to transfer you to WorldPay for secure payment\n\nContinue?') ;
}
onsubmit="return checkWheelie2Fields()"

function changedWheelieetails()
{
	document.form.areadyselected.value = 1;
}
function clearWheeliedetails()
{
	document.form.areadyselected.value = 2;
}

function SetWheelieValue(BinName, BinPrice) {
	var TotalAmount;
	TotalAmount = eval(document.form.M_NumBins.value * BinPrice);
	TotalAmount = TotalAmount + eval(document.form.Del_Charge.value);
	document.form.amount.value = TotalAmount;
	document.form.M_Total_Amount.value = TotalAmount;
	document.form.M_Bin_Size_Text.value = BinName;
	document.form.desc.value = 'Wheelie Bin Sale - ' + document.form.M_NumBins.value + ' x ' + document.form.M_Bin_Type.value + ' Bin :' + BinName;
	
}

function UpdateWheelieValue(ThisVal) {
	var TotalAmount;
	if (document.form.M_Bin_Size_Text.value != "")
	{
		for(var i = 0 ; i < document.form.M_Bin_SizeThisVal.length ; ++i) {
			if (document.form.M_Bin_SizeThisVal[i].checked == true)
			TotalAmount = eval(document.form.M_NumBins.value * document.form.M_Bin_SizeThisVal[i].value);
		}
		
		TotalAmount = TotalAmount + eval(document.form.Del_Charge.value);
		document.form.amount.value = TotalAmount;
		document.form.M_Total_Amount.value = TotalAmount;
		document.form.desc.value = 'Wheelie Bin Sale - ' + document.form.M_NumBins.value + ' x ' + document.form.M_Bin_Type.value + ' Bin :' + document.form.M_Bin_Size_Text.value;
	}
} 
function SetWheelieValue2(BinName, BinPrice, BinType) {
	var TotalAmount;
	var BlueAmount;
	var GreenAmount;
	GreenAmount = 0;
	BlueAmount = 0;
	if (BinType == "Blue") document.form.M_Bin_Size_TextBlue.value = BinName;
	else document.form.M_Bin_Size_TextGreen.value = BinName;
	
	for(var i = 0 ; i < document.form.M_Bin_SizeBlue.length ; ++i) {
			if (document.form.M_Bin_SizeBlue[i].checked == true)
			{
			BlueAmount = eval(document.form.M_Bin_SizeBlue[i].value);
			}
		}
	
	for(var i = 0 ; i < document.form.M_Bin_SizeGreen.length ; ++i) {
			if (document.form.M_Bin_SizeGreen[i].checked == true)
			{
			GreenAmount = eval(document.form.M_Bin_SizeGreen[i].value);
			
			}
		}
	
	if (BlueAmount != 0 && GreenAmount != 0)
	{
	TotalAmount = eval(BlueAmount + GreenAmount);
	TotalAmount = TotalAmount + eval(document.form.Del_Charge.value);
	document.form.amount.value = TotalAmount;
	document.form.M_Total_Amount.value = TotalAmount;
	//document.form.M_Bin_Size_Text.value = BinName;
	document.form.desc.value = 'Wheelie Bin Sale - ' + document.form.M_NumBins.value + ' x ' + document.form.M_Bin_Type.value + '(' + document.form.M_Bin_Size_TextBlue.value + ',' + document.form.M_Bin_Size_TextGreen.value + ')';
	}
}	

function checkReWheelieFields() {
missinginfo = "";


if (document.form.name.value == "") {
missinginfo += "\n     -  Full Name";
}
if (document.form.address.value == "") {
missinginfo += "\n     -  Address";
}
if (document.form.tel.value == "") {
missinginfo += "\n     -  Telephone";
}
if (document.form.email.value == "") {
missinginfo += "\n     -  Email";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
onsubmit="return checkReWheelieFields()"	

function EnableReWheelieAll() {
	document.form.name.disabled = false;
	document.form.address.disabled = false;
	document.form.postcode.disabled = false;
	document.form.tel.disabled = false;
	document.form.email.disabled = false;
	document.form.M_NumBins.disabled = false;
	document.form.M_Premises.disabled = false;
	document.form.M_Deliver.disabled = false;
	document.form.btnSubmit.disabled = false;
	
	document.form.name.className = 'enable';
	document.form.address.className = 'enable';
	document.form.postcode.className = 'enable';
	document.form.tel.className = 'enable';
	document.form.email.className = 'enable';
	document.form.M_NumBins.className = 'enable';
	document.form.M_Premises.className = 'enable';
	document.form.M_Deliver.className = 'enable';
}

function DisableReWheelieAll() {
	alert('If you cannot return your old or damaged bin, you will have to purchase a bin at full sale price\n\nClick the link Wheelie Bin Sales to Order Online!');
	
	document.form.name.disabled = true;
	document.form.address.disabled = true;
	document.form.postcode.disabled = true;
	document.form.tel.disabled = true;
	document.form.email.disabled = true;
	document.form.M_NumBins.disabled = true;
	document.form.M_Premises.disabled = true;
	document.form.M_Deliver.disabled = true;
	document.form.btnSubmit.disabled = true;
	
	document.form.name.className = 'disable';
	document.form.address.className = 'disable';
	document.form.postcode.className = 'disable';
	document.form.tel.className = 'disable';
	document.form.email.className = 'disable';
	document.form.M_NumBins.className = 'disable';
	document.form.M_Premises.className = 'disable';
	document.form.M_Deliver.className = 'disable';
}

function checkReWheelieFields2() {
missinginfo = "";

if (document.form.M_Total_Amount.value == "") {
missinginfo += "Please Select the Size of Bin you would Like";
}
if (missinginfo != "") {
alert(missinginfo);
return false;
}
else return confirm('About to transfer you to WorldPay for secure payment\n\nContinue?') ;
}
onsubmit="return checkReWheelieFields2()"

function SetReWheelieValue(BinName, BinPrice) {
	var TotalAmount;
	TotalAmount = eval(document.form.M_NumBins.value * BinPrice);
	TotalAmount = TotalAmount + eval(document.form.Del_Charge.value);
	document.form.amount.value = TotalAmount;
	document.form.M_Total_Amount.value = TotalAmount;
	document.form.M_Bin_Size_Text.value = BinName;
	document.form.desc.value = 'Wheelie Bin Sale - ' + document.form.M_NumBins.value + ' x ' + ' Bin :' + BinName;
	
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
   
function IsNonAlpha(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }



function checkBillPayFields() {
missinginfo = "";


if (document.form.M_invoice_number.value.length < 5) {
missinginfo += "\n     -  Invoice Number (must be made of 5 digits or more)";
}
if (document.form.M_cust_number.value.length != 6) {
missinginfo += "\n     -  Customer Number (must be 6 digits long)";
}
if (document.form.name.value == "") {
missinginfo += "\n     -  Full Name";
}
if (document.form.address.value == "") {
missinginfo += "\n     -  Address";
}
if (document.form.tel.value == "") {
missinginfo += "\n     -  Telephone";
}
if (document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if (document.form.amount.value == "") {
missinginfo += "\n     -  Total Amount";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}


else 


	{
	if (IsNumeric(document.form.M_invoice_number.value) == false) 
		{
			alert('Please enter only numeric values for Invoice Number');
			return false;
		}
		
		
		
		if (IsNumeric(document.form.M_cust_number.value) == false) 
			{
				alert('Please enter only numeric values for Customer Number');
				return false;
			}
			
			
			if (IsNonAlpha(document.form.amount.value) == false) 
				{
					alert('Please make sure Total Amount is formatted as follows\n\n65.00\n\nNOTE: you DONT need to include the pound sign (£)');
					return false;
				}
				else	return confirm('About to transfer you to WorldPay for secure payment\n\nContinue?') ;
	}		

}
onsubmit="return checkBillPayFields()"

function SetBillPayDesc() {
	document.form.cartId.value = 'BILLINVOICEPAYMENT-' + document.form.M_invoice_number.value;
	document.form.desc.value = 'Online Bill/Invoice Payment - ' + document.form.M_invoice_number.value;
}

function checkCastleparkFields() {
missinginfo = "";


if (document.form.M_CPCCat_Key.value == "") {
missinginfo += "\n     -  Select Category You Would Like To Book";
}
if (document.form.M_CPCAct_Key.value == "") {
missinginfo += "\n     -  Which Room/Activity";
}
if (document.form.Book_Date.value == "") {
missinginfo += "\n     -  Date";
}
if (document.form.End_Time.value == "") {
missinginfo += "\n     -  End Time";
}
if (document.form.Contactname.value == "") {
missinginfo += "\n     -  Contact Name";
}
if (document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if(document.form.telephone.value == "") {
missinginfo += "\n     -  Telephone";
}



if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
	{
		
		if (eval(document.form.End_Time.value) < eval(document.form.Start_Time.value)) {
			alert('Please Select an End Time that is after your Start Time');
			return false;
			}
		else return true;
	
	
	}
}
onsubmit="return checkCastleparkFields()"

function jumptoCastlePark() {
	if (document.form.M_CPCCat_Key.value != "") {
		document.form.submit();
		}							
}

function OpeningclosingCastlePark(){
if (document.form.Start_Time.value !=0){
 
var App = (document.form.Start_Time.value);
App=eval(App)+1;
 
document.form.End_Time.value=App
 
  }else{
   document.form.End_Time.value=0
  
  }
}

function checkLakelandFields() {
missinginfo = "";

if (document.form.M_FLFCat_Key.value == "") {
missinginfo += "\n     -  Select Category You Would Like To Book";
}
if (document.form.M_FLFAct_Key.value == "") {
missinginfo += "\n     -  Which Room/Activity";
}
if (document.form.Book_Date.value == "") {
missinginfo += "\n     -  Date";
}
if (document.form.End_Time.value == "") {
missinginfo += "\n     -  End Time";
}
if (document.form.Contactname.value == "") {
missinginfo += "\n     -  Contact Name";
}
if (document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if(document.form.telephone.value == "") {
missinginfo += "\n     -  Telephone";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
	{
		
		if (eval(document.form.End_Time.value) < eval(document.form.Start_Time.value)) {
			alert(document.form.End_Time.value + 'end ' +  document.form.Start_Time.value + 'start Please Select an End Time that is after your Start Time');
			return false;
			}
		else 
			return true;
	
	}
}
onsubmit="return checkLakelandFields()"

function jumptoLakeland() {
if (document.form.M_FLFCat_Key.value != "") {
	document.form.submit();
	}
}
function OpeningclosingLakeland(){
if (document.form.Start_Time.value !=0){
 
var App = (document.form.Start_Time.value);
App=eval(App)+1;
 
document.form.End_Time.value=App
 
  }else{
   document.form.End_Time.value=0
  
  }
}

function checkLengthLakeland() {
  var arr=checkLength.arguments;
  var l=255;
  var f=document.form;
  var o;
  for (i=0; i < arr.length; i++) {
    s=new String(arr[i]);
    if (s == arr[i]) {
      arTmp = s.split('=');
      if (arTmp.length==1) continue;
      eval(arTmp[0] + "='" + arTmp[1] + "'");
    }
  }

  if (!o) o=f.Special_Requests;
  if (!o) return false;
  cnt = f.cnt;
  len = o.value.length;
  if(cnt) {
    cnt.value = l - len;
    if (parseInt(cnt.value) <= 0) cnt.value = '0';
  }
  if (len > l) {
    o.value = o.value.substr(0, l);
    alert('Maximum length exceeded.');
    return false;
  }
  return true;
}

function checkBawnacreFields() {
missinginfo = "";


if (document.form.M_BAWNCat_Key.value == "") {
missinginfo += "\n     -  Select Category You Would Like To Book";
}
if (document.form.M_BAWNAct_Key.value == "") {
missinginfo += "\n     -  Which Room/Activity";
}
if (document.form.Book_Date.value == "") {
missinginfo += "\n     -  Date";
}
if (document.form.End_Time.value == "") {
missinginfo += "\n     -  End Time";
}
if (document.form.email.value == "") {
missinginfo += "\n     -  Email";
}

if (document.form.Contactname.value == "") {
missinginfo += "\n     -  Contact Name";
}
if(document.form.telephone.value == "") {
missinginfo += "\n     -  Telephone";
}



if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
	{
		
		if (eval(document.form.End_Time.value) < eval(document.form.Start_Time.value)) {
			alert('Please Select an End Time that is after your Start Time');
			return false;
			}
		else return true;
	
	
	}
}
onsubmit="return checkBawnacreFields()"

function jumptoBawnacre() {
	if (document.form.M_BAWNCat_Key.value != "") {
		document.form.submit();
		}							
}

function OpeningclosingBawnacre(){
if (document.form.Start_Time.value !=0){
 
var App = (document.form.Start_Time.value);
App=eval(App)+1;
 
document.form.End_Time.value=App
 
  }else{
   document.form.End_Time.value=0
  
  }
}

function checkEnnisCastleFields() {
missinginfo = "";


if (document.form.Book_Date.value == "") {
missinginfo += "\n     -  Date";
}
if (document.form.Duration.value == "") {
missinginfo += "\n     -  Duration";
}

if (document.form.Programme[7].checked == true && document.form.OtherProgramme.value == "") {
missinginfo += "\n     -  You selected other, so please specify in box provided";
}
if (document.form.Groupname.value == "") {
missinginfo += "\n     -  Group Name";
}
if(document.form.address.value == "") {
missinginfo += "\n     -  Address";
}

if(document.form.email.value == "") {
missinginfo += "\n     -  Email";
}
if (document.form.Contactname.value == "") {
missinginfo += "\n     -  Contact Name";
}
if(document.form.telephone.value == "") {
missinginfo += "\n     -  Telephone";
}
if(document.form.NumVisitors.value == "") {
missinginfo += "\n     -  Number of Visitors";
}



if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
	{
			return true;
	
	}
}
onsubmit="return checkEnnisCastleFields()"


function checkMajorEmployersFields() {
missinginfo = "";

if (document.form.MajorEmployers_CompanyName.value == "") {
missinginfo += "\n     -  Company Name";
}
if (document.form.MajorEmployers_BusinessType.value == "") {
missinginfo += "\n     -  Business Type";
}
if(document.form.MajorEmployers_ManagingDirector.value == "") {
missinginfo += "\n     -  Managing Director";
}
if(document.form.MajorEmployers_Address1.value == "") {
missinginfo += "\n     -  Address Line 1";
}
if(document.form.MajorEmployers_Town.value == "") {
missinginfo += "\n     -  Town";
}
if(document.form.MajorEmployers_Telephone.value == "") {
missinginfo += "\n     -  Telephone";
}
if(document.form.MajorEmployers_Description.value == "") {
missinginfo += "\n     -  Description";
}
if(document.form.MajorEmployers_EmployeeNumber.value == "") {
missinginfo += "\n     -  Employee Number";
}
if(document.form.MajorEmployers_Products.value == "") {
missinginfo += "\n     -  Products/Services Sold";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
onsubmit="return checkMajorEmployersFields()"

function checkEventSubmissionFields() {
missinginfo = "";

if (document.form.Event_Name.value == "") {
missinginfo += "\n     -  Event Name";
}
if (document.form.Start_Date.value == "") {
missinginfo += "\n     -  Start Date";
}
if(document.form.Event_Address.value == "") {
missinginfo += "\n     -  Event Address/Venue";
}
if(document.form.Event_Organiser.value == "") {
missinginfo += "\n     -  Organiser/Contact Name";
}
if(document.form.Telephone.value == "") {
missinginfo += "\n     -  Telephone";
}
if(document.form.Event_Desc.value == "") {
missinginfo += "\n     -  Description about event";
}

if (missinginfo != "") {
missinginfo ="You failed to correctly fill in the following details:\n" +
missinginfo + "\n_________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
onsubmit="return checkEventSubmissionFields()"
