//
//  JavaScript for contact page
//
function EnableSubmit()
	{
	//
	//  Enables and disables the submit button depending on whether entries have been made
	//
		if (document.frmContact["name"].value.length == 0 || document.frmContact["emailAddress"].value.length == 0 || document.frmContact["details"].value.length == 0)
		{
		document.frmContact["cmdSubmit"].disabled = true;
		document.frmContact["cmdSubmit"].title = "Please enter name, email address and your message";
		}
	else
		{
		document.frmContact["cmdSubmit"].disabled = false;
		document.frmContact["cmdSubmit"].title = "";
		}	
	}
	
function CheckEmail()
	{
  //
  //  Check contact address is valid
  //
	if (document.frmContact["emailAddress"].value.length > 0)
		{
		if (!emailCheck(document.frmContact["emailAddress"].value))
			{
			setTimeout('document.frmContact["emailAddress"].focus()',100);
			return false;
			}	
		}
  }

function OnLoad(strControlinError)
	{
	//
	//  Sets focus to the specified field
	//
	if (strControlinError.length > 0)
		document.frmContact[strControlinError].focus();
		
	}

