// JavaScript Document

	function doContactLoad()
	{
		document.frmContact.elements['txtOther'].disabled = true;
		responseValue = "NO";
	}

	function checkOtherLocked()
	{
		slctBox = document.frmContact.elements['slctSubject'];
	
		if (slctBox.options[slctBox.selectedIndex].value == 'Other')
		{
			document.frmContact.elements['txtOther'].disabled = false;
		}	else
		{
			document.frmContact.elements['txtOther'].disabled = true;
		}
	}

	function checkContact()
	{
		box = document.frmContact.elements['txtOther'];
		slctBox = document.frmContact.elements['slctSubject'];
		if (slctBox.options[slctBox.selectedIndex].value == 'other' && (box.value == "Please type the subject of your message here." || box.value == ''))
		{
			alert('Please enter your Subject Header in the "Other" box.');
			box.style.backgroundColor='#AADDDD';
			box.focus();
			return false;
		};	
		
		slctBox = document.frmContact.elements['slctSubject'];
		if (slctBox.options[slctBox.selectedIndex].value == 'pleaseSelect')
		{
			alert('Please select a subject');
			slctBox.style.backgroundColor='#AADDDD';
			slctBox.focus();
			return false;
		};

		box = document.frmContact.elements['txtEmail'];
		rBox = document.frmContact.elements['rdoResponse'];
		if (responseValue == "YES")
		{
			if (box.value == "" || box.value == "Please type your email address here. This will enable us to respond to your message.")
			{
				alert('You must enter your EMail if you want a response');
				box.style.backgroundColor='#AADDDD';
				box.focus();
				return false;
			} else if((box.value.indexOf(".") < 2) || (box.value.indexOf("@") == 0))
			{
				alert('Your email address is invalid');
				box.style.backgroundColor='#AADDDD';
				box.focus();
				return false;				
			}
		}
		
		box = document.frmContact.elements['txtName'];
		if (box.value == "" || box.value == "Please type your name here. This will help to personalise responses.")
		{
			alert('Please enter your Name');
			box.style.backgroundColor='#AADDDD';
			box.focus();
			return false;
		};
		
		box = document.frmContact.elements['txtMessage'];
		if (box.value == "" || box.value == "Please type your message in this box.")
		{
			alert('Please enter your Message');
			box.style.backgroundColor='#AADDDD';
			box.focus();
			return false;
		};		
	}
	
