
	var report = true;
	var btnDeleteClick = false;
	var btnAddClick = false;
	var btnDeleteAllClick = false;
	var btnUpdateClick = false;
	var btnRenameClick = false;
	var btnAddExistingClick = false;
	var btnNewRootClick = false;
	var btnCopyClick = false;
	var btnPasteNewClick = false;
	var btnOtherClick = false;
	var btnLogOn = false;
	var extraInfo = "";
	var NSEvent;
	var gToggle = true;
	var gPublic = true;
	var gOverRide = true;
	
	function newFunction()
	{
		try
		{
			return (true);
		}
		catch (e)
		{
			reportError("newFunction()",e);
		}
	}
	
	function test()
	{
		alert("hello");
	}
	
	function reportError(fn,e)
	{
		
		if (report)
			alert ("Sorry - an error has occured...\n\n" + fn + ": >> " + e.description);
		
	}
	
	function checkVisValForm()
	{
		try
		{
			if (!(document.form2Email.Q1[0].checked || document.form2Email.Q1[1].checked || document.form2Email.Q1[2].checked || document.form2Email.Q1[3].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 1.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q2a[0].checked || document.form2Email.Q2a[1].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 2.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q3a[0].checked || document.form2Email.Q3a[1].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 3.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q4a[0].checked || document.form2Email.Q4a[1].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 4.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q6[0].checked || document.form2Email.Q6[1].checked || document.form2Email.Q6[2].checked || document.form2Email.Q6[3].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 6.");
			    return (false);	
			}
			
			return(true);
		}
		catch (e)
		{
			reportError("checkVisValForm()",e);
		}
	}
	
	function checkInsightForm()
	{
		try
		{
			if (!(document.form2Email.Q1[0].checked || document.form2Email.Q1[1].checked || document.form2Email.Q1[2].checked || document.form2Email.Q1[3].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 1.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q2a[0].checked || document.form2Email.Q2a[1].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 2.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q3a[0].checked || document.form2Email.Q3a[1].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 3.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q4a[0].checked || document.form2Email.Q4a[1].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 4.");
			    return (false);	
			}
			
			if (!(document.form2Email.Q6[0].checked || document.form2Email.Q6[1].checked || document.form2Email.Q6[2].checked || document.form2Email.Q6[3].checked))
			{
				alert ("Sorry - you need to enter an answer for Question 6.");
			    return (false);	
			}
			
			return(true);
		}
		catch (e)
		{
			reportError("checkInsightForm()",e);
		}
	}
	
	function setNewsExpiryDate()
	{
		try
		{
			if (document.addEdit.articleExpandedTypeId[document.addEdit.articleExpandedTypeId.selectedIndex].value != 3)
			{
				document.addEdit.articleDateTo.value = "";	
			}
		}
		catch (e)
		{
			reportError("setNewsExpiryDate()",e);
		}
	}
	
	function DHTMLSetup()
	{
		try
		{
			if (!document.all && document.getElementById)
			{
				document.getElementById("HTMLBody").addEventListener("contextmenu",NetscapeEvent,false);
			}
		}
		catch (e)
		{
			reportError("DHTMLSetup()",e);
		}
	}
	
	function showNews()
	{
		try
		{
			show("articleTable");
			hide("PAKNewsTable");
			hide("eventsTable");
			hide("legistlationTable");
			hide("indexTable");
		}
		catch (e)
		{
			reportError("showNews()",e);
		}
	}
		
	function showEvents()
	{
		try
		{
			show("eventsTable");
			hide("PAKNewsTable");
			hide("articleTable");
			hide("legistlationTable");
			hide("indexTable");
		}
		catch (e)
		{
			reportError("showEvents()",e);
		}
	}
		
	function showLegistlation()
	{
		try
		{
			show("legistlationTable");
			hide("PAKNewsTable");
			hide("eventsTable");
			hide("articleTable");
			hide("indexTable");
		}
		catch (e)
		{
			reportError("showLegistlation()",e);
		}
	}
		
	function showIndex()
	{
		try
		{
			show("indexTable");
			hide("PAKNewsTable");
			hide("eventsTable");
			hide("legistlationTable");
			hide("articleTable");
		}
		catch (e)
		{
			reportError("showIndex()",e);
		}
	}

	function showPAKNews()
	{
		try
		{
			show("PAKNewsTable");
			hide("indexTable");
			hide("eventsTable");
			hide("legistlationTable");
			hide("articleTable");
		}
		catch (e)
		{
			reportError("showPAKNews()",e);
		}
	}
	
	function showVeoliaIntro()
	{
		try
		{
			show2("introGen");
			show2("intro");

			hide2("introVes");
			hide2("ves");
			hide2("introWater");
			hide2("water");
			hide2("introDalkia");
			hide2("dalkia");
			hide2("introTrans");
			hide2("trans");
		}
		catch (e)
		{
			reportError("showVeoliaIntro()",e);
		}
	}
	
	function showVeoliaVes()
	{
		try
		{
			show2("introVes");
			show2("ves");
			
			hide2("introGen");
			hide2("intro");
			hide2("introWater");
			hide2("water");
			hide2("introDalkia");
			hide2("dalkia");
			hide2("introTrans");
			hide2("trans");
		}
		catch (e)
		{
			reportError("showVeoliaVes()",e);
		}
	}
	
	function showVeoliaWater()
	{
		try
		{
			show2("introWater");
			show2("water");
			
			hide2("introGen");
			hide2("intro");
			hide2("introVes");
			hide2("ves");
			hide2("introDalkia");
			hide2("dalkia");
			hide2("introTrans");
			hide2("trans");
		}
		catch (e)
		{
			reportError("showVeoliaWater()",e);
		}
	}
	
	function showVeoliaDalkia()
	{
		try
		{
			show2("introDalkia");
			show2("dalkia");
			
			hide2("introGen");
			hide2("intro");
			hide2("introVes");
			hide2("ves");
			hide2("introWater");
			hide2("water");
			hide2("introTrans");
			hide2("trans");
		}
		catch (e)
		{
			reportError("showVeoliaDalkia()",e);
		}
	}
	
	function showVeoliaTrans()
	{
		try
		{
			show2("introTrans");
			show2("trans");
			hide2("introGen")
			hide2("intro");
			hide2("introVes");
			hide2("ves");
			hide2("introWater");
			hide2("water");
			hide2("introDalkia");
			hide2("dalkia");
		}
		catch (e)
		{
			reportError("showVeoliaTrans()",e);
		}
	}
		
	function displayTab(tab,doneSearch,jumpToIndex)
	{
		try
		{
			if ((tab == "article" || tab == "") && !jumpToIndex)
			{
				if (doneSearch)
					showNews();
			}
			else if (tab == "PAKNews")
			{
				showPAKNews();
			}
			else if (tab == "event")
			{
				showEvents();
			}
			else if (tab == "legistlation")
			{
				showLegistlation();
			}
			else if (tab == "index" || jumpToIndex)
			{
				showIndex();
			}
				
			return (true);
		}
		catch (e)
		{
			reportError("displayTab(tab)",e);
		}
	}
	
	function NetscapeEvent(e)
	{
		try
		{
			NSEvent = e;
		}
		catch (e2)
		{
			reportError("NetscapeEvent(e)",e2);
		}
	}
	
	function rightClick()
	{
		try
		{
			if (!report)
			{
				//if (document.all)
					//alert ("IE: " + window.event.clientX + " " + window.event.clientY);
				//else if (document.getElementById)
					//alert ("NS: " + NSEvent.clientX + " " + NSEvent.clientY);
			}
		}
		catch (e)
		{
			reportError("rightClick()",e);
		}
	}
	
	function checkEditViewCatForm()
	{
		try
		{
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				return (checkSure("Are you REALLY SURE you wish to DELETE this CATEGORY ?"));
			}
			
			if (btnAddClick)
			{
				btnAddClick = false;
				
				if (document.editView.addCategoryName.value == "")
				{
					document.editView.addCategoryName.focus();
					alert ("Sorry - you need to enter a category name.");
					return (false);
				}
			}
			
			if (btnRenameClick)
			{
				btnRenameClick = false;
	
				if (document.editView.categoryName.value == "")
				{
					document.editView.categoryName.focus();
					alert ("Sorry - you need to enter a category name.");
					return (false);
				}
			}
			
			if (btnUpdateClick)
			{
				btnUpdateClick = false;
	
				if (document.editView.categoryName.value == "")
				{
					document.editView.categoryName.focus();
					alert ("Sorry - you need to enter a category name.");
					return (false);
				}
			}
				
			if (btnPasteNewClick)
			{
				btnPasteNewClick = false;
	
				return (true);
			}
					
			return (true);
		}
		catch (e)
		{
			reportError("checkEditViewCatForm()",e);
			
			return (false);
		}
	}
	
	function checkAddEditMsgForm()
	{
		try
		{	
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				if (onlyOne)
					extraInfo = "This is the ORIGINAL webMessage.\n\n";
					
				return (checkSure(extraInfo + "Are you REALLY SURE you wish to DELETE the WEBMESSAGE from THIS category ?"));
			}
			else if (btnDeleteAllClick)
			{
				btnDeleteAllClick = false;
				
				return (checkSure("This will DELETE the ORIGINAL WEBMESSAGE.\n\nAre you REALLY SURE you wish to DELETE the WEBMESSAGE from EVERY category ?"));
			}
			else if (btnAddExistingClick)
			{
				btnAddExistingClick = false;
				
				if (document.addEdit.existingWebMessageId[document.addEdit.existingWebMessageId.selectedIndex].value == -1)
				{
					document.addEdit.existingWebMessageId.focus();
					alert ("Sorry - no existing webMessages available.");
					return (false);
				}
			}
			else
			{
				if (document.addEdit.webMessageName.value == "")
				{
					document.addEdit.webMessageName.focus();
					alert ("Sorry - you need to enter a webMessage name.");
					return (false);
				}
			
				if (document.addEdit.webMessageValue.value == "")
				{
					document.addEdit.webMessageValue.focus();
					alert ("Sorry - you need to enter a webMessage value.");
					return (false);
				}
			}
			
			return (true);
		}
		catch (e)
		{
			reportError("checkAddEditMsgForm()",e);
			
			return (false);
		}
	}
	
	
	
	function checkCreateNewAccountStep1()
	{
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
		
		try
		{
			document.add.accountEmailAddress.value = trim(document.add.accountEmailAddress.value);
			
			if (!emailFilter.test(document.add.accountEmailAddress.value))
			{
				document.add.accountEmailAddress.focus();
				alert ("Sorry - you need to enter a valid email address.");
				return (false);
			}
			
			if (document.add.accountTypeId[document.add.accountTypeId.selectedIndex].value == -1)
			{
				document.add.accountTypeId.focus();
				alert ("Sorry - you need to select an account type.");
				return (false);
			}
			
			return (true);
		}
		catch (e)
		{
			reportError("checkCreateNewAccountStep1()",e);
		}
	}
	
	function checkAddIndividualAccount()
	{
		try
		{
			var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
			
			document.add.accountEmailAddress1.value = trim(document.add.accountEmailAddress1.value);
			document.add.accountEmailAddress2.value = trim(document.add.accountEmailAddress2.value);
			
			if (document.add.accountFirstName.value == "")
			{
				document.add.accountFirstName.focus();
				alert ("Sorry - you need to enter your First Name.");
				return (false);
			}
			
			if (document.add.accountLastName.value == "")
			{
				document.add.accountLastName.focus();
				alert ("Sorry - you need to enter your Last Name.");
				return (false);
			}
			
			if (!emailFilter.test(document.add.accountEmailAddress1.value))
			{
				document.add.accountEmailAddress1.focus();
				alert ("Sorry - you need to enter a valid email address.");
				return (false);
			}
			
			if (document.add.accountEmailAddress1.value != document.add.accountEmailAddress2.value)
			{
				document.add.accountEmailAddress2.focus();
				alert ("Sorry - you need to reenter your Email Address.");
				return (false);
			}
			
			if (document.add.accountPassword1.value.length < 5)
			{
				document.add.accountPassword1.focus();
				alert ("Sorry - your password needs to be at least 5 characters long.");
				return (false);
			}
			
			if (document.add.accountPassword1.value != document.add.accountPassword2.value)
			{
				document.add.accountPassword2.focus();
				alert ("Sorry - you need re-enter your password.");
				return (false);
			}
			
			if (document.add.accountOnyxAccountNumber.value == "" && document.add.accountOnyxPakMemberNumber.value == "")
			{
				document.add.accountOnyxAccountNumber.focus();
				alert ("Sorry - you need to enter either your Onyx Account Number or your OnyxPak Membership Number.");
				return (false);
			}
			
			//if (document.add.accountCompanyName.value == "")
			//{
			//	document.add.accountCompanyName.focus();
			//	alert ("Sorry - you need to enter your Company Name.");
			//	return (false);
			//}
			
			//if (document.add.accountAddress1.value == "")
			//{
			//	document.add.accountAddress1.focus();
			//	alert ("Sorry - you need to enter the First Line of your address.");
			//	return (false);
			//}
			
			//if (document.add.accountTownCity.value == "")
			//{
			//	document.add.accountTownCity.focus();
			//	alert ("Sorry - you need to enter your Town / City.");
			//	return (false);
			//}
			
			//if (document.add.accountCountyState.value == "")
			//{
			//	document.add.accountCountyState.focus();
			//	alert ("Sorry - you need to enter your County / State.");
			//	return (false);
			//}
			
			//if (document.add.accountPostCodeZip.value == "")
			//{
			//	document.add.accountPostCodeZip.focus();
			//	alert ("Sorry - you need to enter your Post Code.");
			//	return (false);
			//}
			
			//if (document.add.accountCountryId[document.add.accountCountryId.selectedIndex].value == -1)
			//{
			//	document.add.accountCountryId.focus();
			//	alert ("Sorry - you need to enter your Country.");
			//	return (false);
			//}
			
			return (true);
		}
		catch (e)
		{
			reportError("checkAddIndividualAccount()",e);
		}
	}
	
	function checkEditUpgradeAccount()
	{
		try
		{
			var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
		
			document.edit.accountAlterEmailAddress1.value = trim(document.edit.accountAlterEmailAddress1.value);
			document.edit.accountAlterEmailAddress2.value = trim(document.edit.accountAlterEmailAddress2.value);
			
			if (!emailFilter.test(document.edit.accountAlterEmailAddress1.value))
			{
				document.edit.accountAlterEmailAddress1.focus();
				alert ("Sorry - you need to enter a valid email address.");
				return (false);
			}
			
			if (document.edit.accountAlterEmailAddress1.value != document.edit.accountAlterEmailAddress2.value)
			{
				document.edit.accountAlterEmailAddress2.focus();
				alert ("Sorry - you need to re-enter your email address.");
				return (false);
			}
			
			if (document.edit.accountPassword1.value == "")
			{
				document.edit.accountPassword1.focus();
				alert ("Sorry - you need to enter a Password.");
				return (false);
			}
			
			if (document.edit.accountPassword1.value.length < 5)
			{
				document.edit.accountPassword1.focus();
				alert ("Sorry - you need to enter a Password at least 5 characters long.");
				return (false);
			}
			
			if (document.edit.accountPassword1.value != document.edit.accountPassword2.value)
			{
				document.edit.accountPassword2.focus();
				alert ("Sorry - you need to re-enter your password.");
				return (false);
			}
			
			if (document.edit.accountOnyxAccountNumber.value == "" && document.edit.accountOnyxPakMembershipNumber.value == "")
			{
				document.edit.accountOnyxAccountNumber.focus();
				alert ("Sorry - you need to enter either your Veolia Environmental Services Account No or your Packaging Scheme Member No.");
				return (false);
			}
			
			//if (document.edit.accountCompanyName.value == "")
			//{
			//	document.edit.accountCompanyName.focus();
			//	alert ("Sorry - you need to enter your Company Name.");
			//	return (false);
			//}
			
			return (true);
		}
		catch (e)
		{
			reportError("checkEditUpgradeAccount()",e);
		}
	}
	
	
	function checkEditAddContact()
	{
		try
		{
			if (btnAddExistingClick)
			{
				btnAddExistingClick = false;
				
				if (document.addEdit.existingContactId[document.addEdit.existingContactId.selectedIndex].value == -1)
				{	
					document.addEdit.existingContactId.focus();
					alert ("Sorry - there are no existing contacts available to add.");
					return (false);
				}
			}
			else if (btnAddClick || btnUpdateClick)
			{
				btnAddClick = false;
				btnUpdateClick = false;
				
				if (document.addEdit.contactFirstName.value == "")
				{
					document.addEdit.contactFirstName.focus();
					alert ("Sorry - you need to enter your First Name.");
					return (false);
				}
			
				if (document.addEdit.contactLastName.value == "")
				{
					document.addEdit.contactLastName.focus();
					alert ("Sorry - you need to enter your Last Name.");
					return (false);
				}
			
				if (document.addEdit.contactLine1.value == "")
				{
					document.addEdit.contactLine1.focus();
					alert ("Sorry - you need to enter the first line of your address.");
					return (false);
				}
			
				if (document.addEdit.contactTownCity.value == "")
				{
					document.addEdit.contactTownCity.focus();
					alert ("Sorry - you need to enter your Town / City.");
					return (false);
				}
			
				if (document.addEdit.contactCountyState.value == "")
				{
					document.addEdit.contactCountyState.focus();
					alert ("Sorry - you need to enter your County / State.");
					return (false);
				}
			
				//if (document.addEdit.contactCountryId[document.addEdit.contactCountryId.selectedIndex].value == -1)
				//{
				//	document.addEdit.contactCountryId.focus();
				//	alert ("Sorry - you need to enter your Country.");
				//	return (false);
				//}
				
				if (document.addEdit.contactPostCodeZip.value == "")
				{
					document.addEdit.contactPostCodeZip.focus();
					alert ("Sorry - you need to enter your Post Code.");
					return (false);
				}
			
				return (true);
			}	
			else
				return (true);
		}
		catch (e)
		{
			reportError("checkEditAddContact()",e);
		}
	}
	
	function checkLogon()
	{
		try
		{
			var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
			
			if (btnLogOn)
			{
				if (!emailFilter.test(document.logon.accountEmailAddress.value))
				{
					document.logon.accountEmailAddress.focus();
					alert ("Sorry - you need to enter a valid email address.");
					return (false);
				}
			
				if (!document.logon.checkPassword.checked)
				{
					if (document.logon.accountPassword.value == "")
					{
						document.logon.accountPassword.focus();
						alert ("Sorry - you need to enter your Password.");
						return (false);
					}
				}
				
				btnLogOn = false;
			}
			
			return (true);
		}
		catch (e)
		{
			reportError("checkLogon()",e);
			return(false);
		}
	}
	
	function showErrMsg(eventId)
	{

		if (eventId == "1")
			alert ("Sorry, you have been unable to log into the members area.");
		else if (eventId == "2")
			alert ("We have sent password notification to your registered email address.");
		else if (eventId == "3")
			alert ("You have requested an account renewal, you will be notified by email when your account has been re-activated.");
	}
	
	function checkAddUpdateNewsForm()
	{
		try
		{
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				return (checkSure("Are you REALLY SURE you wish to DELETE this NEWS ARTICLE ?"));
			}
			
			if (document.addEdit.articleHeadline.value == "")
			{
				document.addEdit.articleHeadline.focus();
				alert ("Sorry - you need to enter a Headline.");
				return (false);
			}
			
			//if (document.addEdit.articleSummary.value == "")
			//{
			//	document.addEdit.articleSummary.focus();
			//	alert ("Sorry - you need to enter a Summary.");
			//	return (false);
			//}
			
			if (document.addEdit.articleDate.value == "")
			{
				document.addEdit.articleDate.focus();
				alert ("Sorry - you need to enter the Article Date.");
				return (false);
			}
			
			if (document.addEdit.articleText.value == "")
			{
				document.addEdit.articleText.focus();
				alert ("Sorry - you need to enter the main Text.");
				return (false);
			}
			
		}
		catch (e)
		{
			reportError("checkAddUpdateNewsForm()",e);
		}
	}
	
	function checkAddUpdateLegistlationForm()
	{
		try
		{
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				return (checkSure("Are you REALLY SURE you wish to DELETE this LEGISTLATION ?"));
			}
			
			//if (document.addEdit.legistlationMemberTypeId[document.addEdit.legistlationMemberTypeId.selectedIndex].value == -1)
			//{
			//	document.addEdit.legistlationMemberTypeId.focus();
			//	alert ("Sorry - you need to enter the Member Type.");
			//	return (false);
			//}
			
			if (document.addEdit.legistlationHeadline.value == "")
			{
				document.addEdit.legistlationHeadline.focus();
				alert ("Sorry - you need to enter a Headline.");
				return (false);
			}
			
			if (document.addEdit.legistlationSummary.value == "")
			{
				document.addEdit.legistlationSummary.focus();
				alert ("Sorry - you need to enter a Summary.");
				return (false);
			}
			
			if (document.addEdit.legistlationDate.value == "")
			{
				document.addEdit.legistlationDate.focus();
				alert ("Sorry - you need to enter the Headline Date.");
				return (false);
			}
			
			//if (document.addEdit.legistlationTypeId[document.addEdit.legistlationTypeId.selectedIndex].value == -1)
			//{
			//	document.addEdit.legistlationTypeId.focus();
			//	alert ("Sorry - you need to enter the Legistlation Type.");
			//	return (false);
			//}
			
			if (document.addEdit.legistlationText.value == "")
			{
				document.addEdit.legistlationText.focus();
				alert ("Sorry - you need to enter the main Text.");
				return (false);
			}
			
		}
		catch (e)
		{
			reportError("checkAddUpdateLegistlationForm()",e);
		}
	}
	
	function checkAddUpdateEventForm()
	{
		try
		{
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				return (checkSure("Are you REALLY SURE you wish to DELETE this EVENT ?"));
			}
			
			//if (document.addEdit.eventMemberTypeId[document.addEdit.eventMemberTypeId.selectedIndex].value == -1)
			//{
			//	document.addEdit.eventMemberTypeId.focus();
			//	alert ("Sorry - you need to enter the Member Type.");
			//	return (false);
			//}
			
			if (document.addEdit.eventName.value == "")
			{
				document.addEdit.eventName.focus();
				alert ("Sorry - you need to enter an Event Name.");
				return (false);
			}
			
			//if (document.addEdit.eventLocation.value == "")
			//{
			//	document.addEdit.eventLocation.focus();
			//	alert ("Sorry - you need to enter a Location.");
			//	return (false);
			//}
			
			if (document.addEdit.eventDate.value == "")
			{
				document.addEdit.eventDate.focus();
				alert ("Sorry - you need to enter the Headline Date.");
				return (false);
			}
			
			//if (document.addEdit.eventEventTypeId[document.addEdit.eventEventTypeId.selectedIndex].value == -1)
			//{
			//	document.addEdit.eventEventTypeId.focus();
			//	alert ("Sorry - you need to enter the Event Type.");
			//	return (false);
			//}
			
			//if (document.addEdit.eventDescription.value == "")
			//{
			//	document.addEdit.eventDescription.focus();
			//	alert ("Sorry - you need to enter the main Description.");
			//	return (false);
			//}
			
		}
		catch (e)
		{
			reportError("checkAddUpdateEventForm()",e);
		}
	}
	
	function checkAddUpdateNewsletter()
	{
		try
		{
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				return (checkSure("Are you REALLY SURE you wish to DELETE this NEWSLETTER ?"));
			}
			
			//if (document.addEdit.newsletterMemberTypeId[document.addEdit.newsletterMemberTypeId.selectedIndex].value == -1)
			//{
			//	document.addEdit.newsletterMemberTypeId.focus();
			//	alert ("Sorry - you need to enter the Member Type.");
			//	return (false);
			//}
			
			if (document.addEdit.newsletterName.value == "")
			{
				document.addEdit.newsletterName.focus();
				alert ("Sorry - you need to enter the Newsletter Name.");
				return (false);
			}
			
			//if (document.addEdit.newsletterIssue.value == "")
			//{
			//	document.addEdit.newsletterIssue.focus();
			//	alert ("Sorry - you need to enter the Newsletter Issue.");
			//	return (false);
			//}
			
			if (document.addEdit.newsletterDate.value == "")
			{
				document.addEdit.newsletterDate.focus();
				alert ("Sorry - you need to enter the Newsletter Date.");
				return (false);
			}
			
			if (document.addEdit.newsletterExistingFilename.value == "" && document.addEdit.newFile.value == "")
			{
				document.addEdit.newFile.focus();
				alert ("Sorry - you need to enter a filename to upload the newsletter.");
				return (false);
			}
			
		}
		catch (e)
		{
			reportError("checkAddUpdateNewsletter()",e);
		}
	}
	
	function checkAddUpdateBulletin()
	{
		try
		{
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				return (checkSure("Are you REALLY SURE you wish to DELETE this BULLETIN ?"));
			}
			
			//if (document.addEdit.bulletinMemberTypeId[document.addEdit.bulletinMemberTypeId.selectedIndex].value == -1)
			//{
			//	document.addEdit.bulletinMemberTypeId.focus();
			//	alert ("Sorry - you need to enter the Member Type.");
			//	return (false);
			//}
			
			if (document.addEdit.bulletinName.value == "")
			{
				document.addEdit.bulletinName.focus();
				alert ("Sorry - you need to enter the Bulletin Name.");
				return (false);
			}
			
			//if (document.addEdit.bulletinIssue.value == "")
			//{
			//	document.addEdit.bulletinIssue.focus();
			//	alert ("Sorry - you need to enter the Bulletin Issue.");
			//	return (false);
			//}
			
			if (document.addEdit.bulletinDate.value == "")
			{
				document.addEdit.bulletinDate.focus();
				alert ("Sorry - you need to enter the Bulletin Date.");
				return (false);
			}
			
			if (document.addEdit.bulletinExistingFilename.value == "" && document.addEdit.newFile.value == "")
			{
				document.addEdit.newFile.focus();
				alert ("Sorry - you need to enter a filename to upload the bulletin.");
				return (false);
			}
			
		}
		catch (e)
		{
			reportError("checkAddUpdateBulletin()",e);
		}
	}
	
	function checkAdministerAccount()
	{
		try
		{
			if (btnDeleteClick)
			{
				btnDeleteClick = false;
				
				return (checkSure("Are you REALLY SURE you wish to DELETE this ACCOUNT ?"));
			}
			
			if (document.editView.accountExpiryDate.value == "")
			{
				document.editView.accountExpiryDate.focus();
				alert ("Sorry - you need to enter the Expiry Date.");
				return (false);
			}
			
			//if (document.editView.accountMembershipId[document.editView.accountMembershipId.selectedIndex].value == "-1")
			//{
			//	document.editView.accountMembershipId.focus();
			//	alert ("Sorry - you need to enter the Membership Type.");
			//	return (false);
			//}
			
			return (true);
		}
		catch (e)
		{
			reportError("checkAdministerAccount()",e);
		}
	}
	
	
	function checkAddEditFileLink()
	{
		try
		{
			if (btnDeleteClick)
			{
				
				btnDeleteClick = false;
				
				return (checkSure("Are you sure that you want to DELETE this FILE LINK ENTRY from the event ?"));
			
			}
			else
			{
				if (document.addEditFileLink.eventAssociatedFilename.value == "" && document.addEditFileLink.newFile.value == "")
				{
					document.addEditFileLink.eventAssociatedFilename.focus();
					alert ("Sorry - you need to enter a filename into the 'Existing File' textbox OR select a file to upload by clicking the 'Browse' button.");
					return (false);
				}
			
				if (document.addEditFileLink.eventFileDescription.value == "")
				{
					document.addEditFileLink.eventFileDescription.focus();
					alert ("Sorry - you need to enter a description for the file link.");
					return (false);
				}
			}
		}
		catch (e)
		{
			reportError("checkAddEditFileLink()",e);
		}
	}
	
	function highlight(object)
	{
	
		try
		{
			var links = document.getElementsByTagName("A");

			if (document.all)
			{
				if (document.all(object).className == 'highlighted')
					gToggle = true;
				else
					gToggle = false;
			}
			else if (document.getElementById)
			{
				if (document.getElementById(object).className == 'highlighted')
					gToggle = true;
				else
					gToggle = false;
			}
			
			for (var i=0;i < links.length;i++)
				links[i].className = 'unHighlighted';
		
			// IE+
			if (document.all)
			{
				document.all(object).className = 'highlighted';
			}
			// NS6+
			else if (document.getElementById)
			{
				document.getElementById(object).className = 'highlighted';
			}
		}
		catch (e)
		{
			reportError("highlight(object)",e);
		}
	
	}

	function show(object)
	{
		try
		{
			// IE4+
			if (document.all)
			{
				document.all(object).className = 'showMe';
			}
			// NS6+
			else if (document.getElementById)
			{
				document.getElementById(object).className = 'showMe';
			}
		}
		catch (e)
		{
			reportError("show(object)",e);
		}
	}

	function hide(object)
	{
		try
		{
			// IE4+
			if (document.all)
			{
				document.all(object).className = 'hideMe';
			}
			// NS6+
			else if (document.getElementById)
			{
				document.getElementById(object).className = 'hideMe';
			}
		}
		catch (e)
		{
			reportError("hide(object)",e);
		}
	}
	
	function show2(object)
	{
		try
		{
			// IE4+
			if (document.all)
			{
				document.all(object).className = 'showMe2';
			}
			// NS6+
			else if (document.getElementById)
			{
				document.getElementById(object).className = 'showMe2';
			}
		}
		catch (e)
		{
			reportError("show2(object)",e);
		}
	}

	function hide2(object)
	{
		try
		{
			// IE4+
			if (document.all)
			{
				document.all(object).className = 'hideMe2';
			}
			// NS6+
			else if (document.getElementById)
			{
				document.getElementById(object).className = 'hideMe2';
			}
		}
		catch (e)
		{
			reportError("hide2(object)",e);
		}
	}
	
	function toggle(object, toggleGraphix)
	{
		try
		{
			var imgId;
			var linkId;
			
			imgId = object.replace ("node","img");
			linkId = "link" + object;
		
			// If in public mode, then check that the node is physical (not root) before toggling
		
			// IE4+
			if (document.all)
			{
				if ((gToggle || gPublic) || (gOverRide && !gPublic))
				{
					if (document.all(object).className == 'showMe')
					{
						if	((document.all(linkId).name == 'physical' && gPublic) || document.all(linkId).className == 'highlighted')
						{
							document.all(object).className = 'hideMe';
		
							if (toggleGraphix)
							{
								document.all(imgId).src = "/images/plus.gif";
							}
						}
					}
					else
					{
						document.all(object).className = 'showMe';
					
						if (toggleGraphix)
						{
							document.all(imgId).src = "/images/minus.gif";
						}
					}
				}
			}
			// NS6+
			else if (document.getElementById)
			{
				if ((gToggle || gPublic) || (gOverRide && !gPublic))
				{
					if (document.getElementById(object).className == 'showMe')
					{
						if ((document.getElementById(linkId).name == 'physical' && gPublic) || document.getElementById(linkId).className == 'highlighted')
						{
							document.getElementById(object).className = 'hideMe';
					
							if (toggleGraphix)
							{
								document.getElementById(imgId).src = "/images/plus.gif";
							}
						}
					}
					else
					{
						document.getElementById(object).className = 'showMe';
					
						if (toggleGraphix)
						{
							document.getElementById(imgId).src = "/images/minus.gif";
						}
					}
				}
			}
		}
		catch (e)
		{
			reportError("toggle(object,toggleGraphix)" + object,e);
		}
	}
	
	function popUp(where,what,x,y)
	{
		try
		{
		
			var param;
			
			if (where == "worldpay")
				param = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + x + ",height=" + y;
			else
				param = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + x + ",height=" + y;

			window.open (what,where,param);
		}
		catch (e)
		{
			reportError("popUp(where,what,x,y)",e);
		}
	}

	function showProductUpdateNav(viewerPage,navPage)
	{
		try
		{
			displayIFrame("viewer",viewerPage);
			displayIFrame("nav",navPage);
		}
		catch (e)
		{
			reportError("showProductUpdateNav(viewerPage,navPage)",e);
		}
	}

	function displayIFrame(iFrame,url)
	{
		try
		{
			window.parent[iFrame].document.location.href = url;
		}
		catch (e)
		{
			reportError("displayIFrame(iFrame,url)",e);
		}
	}

	function displayPage(url)
	{
		try
		{
			document.location.href = url;
		}
		catch (e)
		{
			reportError("displayPage(url)",e);
		}
	}

	function checkSure(msg)
	{
		try
		{
			var ok;
		
			ok = confirm (msg);
	
			if (ok)
			{
				return (true);
			}
			else
			{
				return (false);
			}
		}
		catch (e)
		{
			reportError("checkSure()",e);
		}
	}
	
	function refreshMainWindow(page,queryString)
	{
		try
		{
			if (flagId != "")
			{
				window.opener.document.location.href = page + queryString;
			}
			else
			{
				window.opener.document.location.href = page;
			}
		
			window.close();
		}
		catch (e)
		{
			reportError("refreshMainWindow(page,queryString)",e);
		}
	}
	
	function hideMsgNav(page)
	{
		try
		{
			
			displayIFrame("viewer",page);
			displayIFrame("nav","clear.asp");
			
		}
		catch (e)
		{
			reportError("hideMsgNav(page)",e);
		}
	}
	
	function trim(what)
	{
		try
		{
			if (what != "")
			{
				while(what.charAt(0)==' ')
					what = what.substring(1,what.length);
		
				while(what.charAt(what.length-1)==' ')
					what = what.substring(0,what.length-1);
			}
			
			return (what);
		}
		catch (e)
		{
			reportError("trim(what)",e);
		}
	}
	
	function checkInteger(what)
	{
		try
		{
			var valid = "0123456789";
		
			what = trim(what);
		
			if (what == "")
			{
				return (false);
			}
		
			for (outer = 0; outer <= what.length-1; outer++)
			{
				if (valid.indexOf(""+what.charAt(outer)) == -1)
				{
					return (false);
				}
			}
		
			return (true);
		}
		catch (e)
		{
			reportError("checkInteger(what)",e);
		}
	}
	
	function getInteger(what)
	{
		try
		{
			var valid = "0123456789";
		
			what = trim(what);
		
			if (what == "")
			{
				return (NaN);
			}
		
			for (outer = 0; outer <= what.length-1; outer++)
			{
				if (valid.indexOf(""+what.charAt(outer)) == -1)
				{
					return (NaN);
				}
			}
		
			return (parseInt(what));
		}
		catch (e)
		{
			reportError("getInteger(what)",e);
		}
	}
	
	function showDIVs(path,admin)
	{
		try
		{
			var nodeList = path;
	
			gPublic = !admin;
			gOverRide = admin;
	
			if (nodeList != "")
			{
				var splitList = nodeList.split(";");
			
				for (i=0;i<=splitList.length -1;i++)
				{
					if (splitList[i] != "")
					{
						toggle(splitList[i],true);
						
						if (!gPublic)
							highlight("link" + splitList[i]);
					}
				}
			}
			
			gOverRide = false;
			
		}
		catch (e)
		{
			reportError("showDIVs(path,admin)",e);
		}
	}
	
	function bringWindowForward()
	{
		try
		{
			window.focus();
		}
		catch (e)
		{
			reportError("bringWindowForward()",e);
		}
	}
	
	function addBookmark()
	{
		window.external.addFavorite (window.location,document.title);
	}
	
	function checkContactForm()
	{
	
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	
		try
		{
		
			if (!emailFilter.test(document.form2Email.Email.value))
			{
				document.form2Email.Email.focus();
				alert ("Sorry - you need to enter your email address");
				return (false);
			}
			
			return (true);
			
		}
		catch (e)
		{
			reportError("checkContactForm()",e);
			return (false);
		}
		
	}
	
	function checkWEEEForm()
	{
	
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	
		try
		{
		
			if (document.form2Email.Name.value == "")
			{
				document.form2Email.Name.focus();
				alert ("Sorry - you need to enter your Name");
				return (false);
			}
			
			if (document.form2Email.CompanyName.value == "")
			{
				document.form2Email.CompanyName.focus();
				alert ("Sorry - you need to enter your Company Name");
				return (false);
			}
			
			if (document.form2Email.Address1.value == "")
			{
				document.form2Email.Address1.focus();
				alert ("Sorry - you need to enter the first line of your address");
				return (false);
			}
			
			if (document.form2Email.Postcode.value == "")
			{
				document.form2Email.Postcode.focus();
				alert ("Sorry - you need to enter your Postcode");
				return (false);
			}
			
			if (!emailFilter.test(document.form2Email.Email.value))
			{
				document.form2Email.Email.focus();
				alert ("Sorry - you need to enter your email address");
				return (false);
			}
			
			if (document.form2Email.BusinessType.value == "")
			{
				document.form2Email.BusinessType.focus();
				alert ("Sorry - you need to enter your Business Type");
				return (false);
			}
			
			return (true);
			
		}
		catch (e)
		{
			reportError("checkWEEEForm()",e);
			return (false);
		}
		
	}

	function checkNewsForm()
	{
	
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
		
		try
		{
		
			if (document.form2Email.name.value == "")
			{
				document.form2Email.name.focus();
				alert ("Sorry - you need to enter your Name");
				return (false);
			}
		
			if (document.form2Email.publication.value == "")
			{
				document.form2Email.publication.focus();
				alert ("Sorry - you need to enter your Publication");
				return (false);
			}
		
			if (document.form2Email.company.value == "")
			{
				document.form2Email.company.focus();
				alert ("Sorry - you need to enter your Company");
				return (false);
			}
		
			if (document.form2Email.address1.value == "")
			{
				document.form2Email.address1.focus();
				alert ("Sorry - you need to enter the first line of your address");
				return (false);
			}
		
			if (document.form2Email.postCode.value == "")
			{
				document.form2Email.postCode.focus();
				alert ("Sorry - you need to enter your postcode");
				return (false);
			}
			
			if (document.form2Email.telephone.value == "")
			{
				document.form2Email.telephone.focus();
				alert ("Sorry - you need to enter your telephone number");
				return (false);
			}
		
			if (!emailFilter.test(document.form2Email.email.value))
			{
				document.form2Email.email.focus();
				alert ("Sorry - you need to enter a valid email address");
				return (false);
			}
		
			return (true);
			
		}	
		catch (e)
		{
			reportError("checkNewsForm()",e);
			return (false);
		}
	}
	
	function checkMediaForm()
	{
	
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	
		try
		{
	
			if (document.form2Email.imageName.value == "")
			{
				document.form2Email.imageName.focus();
				alert ("Sorry - you need to enter an Image Name / Reference");
				return (false);
			}
		
			if (document.form2Email.name.value == "")
			{
				document.form2Email.name.focus();
				alert ("Sorry - you need to enter your Name");
				return (false);
			}
		
			if (document.form2Email.publication.value == "")
			{
				document.form2Email.publication.focus();
				alert ("Sorry - you need to enter your Publication");
				return (false);
			}
		
			if (document.form2Email.company.value == "")
			{
				document.form2Email.company.focus();
				alert ("Sorry - you need to enter your Company");
				return (false);
			}
		
			if (document.form2Email.address1.value == "")
			{
				document.form2Email.address1.focus();
				alert ("Sorry - you need to enter the first line of your address");
				return (false);
			}
		
			if (document.form2Email.postCode.value == "")
			{
				document.form2Email.postCode.focus();
				alert ("Sorry - you need to enter your postcode");
				return (false);
			}
			
			if (document.form2Email.telephone.value == "")
			{
				document.form2Email.telephone.focus();
				alert ("Sorry - you need to enter your telephone number");
				return (false);
			}
		
			if (!emailFilter.test(document.form2Email.email.value))
			{
				document.form2Email.email.focus();
				alert ("Sorry - you need to enter a valid email address");
				return (false);
			}
		
			return (true);
				
		}	
		catch (e)
		{
			reportError("checkMediaForm()",e);
			return (false);
		}

	}
	
	function checkPubLitForm()
	{
	
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
		
		try
		{
		
			if (document.form2Email.name.value == "")
			{
				document.form2Email.name.focus();
				alert ("Sorry - you need to enter your Name");
				return (false);
			}
		
			if (document.form2Email.publication.value == "")
			{
				document.form2Email.publication.focus();
				alert ("Sorry - you need to enter the publication");
				return (false);
			}
		
			if (document.form2Email.company.value == "")
			{
				document.form2Email.company.focus();
				alert ("Sorry - you need to enter your Company");
				return (false);
			}
		
			if (document.form2Email.address1.value == "")
			{
				document.form2Email.address1.focus();
				alert ("Sorry - you need to enter the first line of your address");
				return (false);
			}
		
			if (document.form2Email.postCode.value == "")
			{
				document.form2Email.postCode.focus();
				alert ("Sorry - you need to enter your postcode");
				return (false);
			}
		
			if (document.form2Email.telephone.value == "")
			{
				document.form2Email.telephone.focus();
				alert ("Sorry - you need to enter your telephone number");
				return (false);
			}
		
			if (!emailFilter.test(document.form2Email.email.value))
			{
				document.form2Email.email.focus();
				alert ("Sorry - you need to enter a valid email address");
				return (false);
			}
		
			return (true);
			
		}
		catch (e)
		{
			reportError("checkPubLitForm()",e);
			return (false);
		}
	}
	
	function checkCustSatForm()
	{
	
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	
		try
		{
			
			if (!emailFilter.test(document.form2Email.Email.value))
			{
				document.form2Email.Email.focus();
				alert ("Sorry - you need to enter your email address");
				return (false);
			}
		
			return (true);
			
		}
		catch (e)
		{
			reportError("checkCustSatForm()",e);
			return (false);
		}
	
	}
	
	function checkSearch()
	{
		
		if (document.searchForm.searchCriteria.value == "")
		{
			document.searchForm.searchCriteria.focus();
			alert ("Sorry - you need to enter your search criteria.");
		}
		else
			document.searchForm.submit();

	}

	function checkSearch2()
	{
		
		if (document.searchForm.searchCriteria.value == "")
		{
			document.searchForm.searchCriteria.focus();
			alert ("Sorry - you need to enter your search criteria.");
			return (false);
		}
		
		return (true);

	}
	
	function checkBookingForm()
	{
	
		var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	
		if (document.bookOnline.bookFirstName.value == "")
		{
			document.bookOnline.bookFirstName.focus();
			alert ("Sorry - you need to enter your First Name.");
			return (false);
		}
		
		if (document.bookOnline.bookLastName.value == "")
		{
			document.bookOnline.bookLastName.focus();
			alert ("Sorry - you need to enter your Last Name.");
			return (false);
		}
		
		if (!emailFilter.test(document.bookOnline.bookEmailAddress.value))
		{
			document.bookOnline.bookEmailAddress.focus();
			alert ("Sorry - you need to enter your Email Address.");
			return (false);
		}
		
		if (document.bookOnline.bookCompanyName.value == "")
		{
			document.bookOnline.bookCompanyName.focus();
			alert ("Sorry - you need to enter your Company Name.");
			return (false);
		}
		
		if (document.bookOnline.bookOnyxAccountNumber.value == "")
		{
			document.bookOnline.bookOnyxAccountNumber.focus();
			alert ("Sorry - you need to enter your Veolia Account Number");
			return (false);
		}
		
		//if (document.bookOnline.bookOnyxAccountNumber.value == "" && document.bookOnline.bookOnyxPakMembershipNumber.value == "")
		//{
		//	document.bookOnline.bookOnyxAccountNumber.focus();
		//	alert ("Sorry - you need to enter either your Veolia Account Number OR your OnyxPak Member Number.");
		//	return (false);
		//}
		
		if (document.bookOnline.bookAddress1.value == "")
		{
			document.bookOnline.bookAddress1.focus();
			alert ("Sorry - you need to enter the First Line of your address.");
			return (false);
		}
		
		if (document.bookOnline.bookTown.value == "")
		{
			document.bookOnline.bookTown.focus();
			alert ("Sorry - you need to enter your Town.");
			return (false);
		}
		
		if (document.bookOnline.bookCounty.value == "")
		{
			document.bookOnline.bookCounty.focus();
			alert ("Sorry - you need to enter your County.");
			return (false);
		}
		
		if (document.bookOnline.bookPostCode.value == "")
		{
			document.bookOnline.bookPostCode.focus();
			alert ("Sorry - you need to enter your Post Code.");
			return (false);
		}
		
		return (true);
	}
	