// JavaScript Document
	function checkForm()
	{	
		// list the fields that require a value
		var fields = new Array("firstName",
							   "lastName",
		                       "email");
		// list the field names that correspond to the list or required fields
		var fieldNames = new Array("First Name",
								   "Last Name",
								   "Email");
//		alert("["+document.getElementById(fields[0]).value)+"]";
		if (!checkRequiredFieldsForValues(fields,fieldNames))
		{
			return false;
		}
		
		if(document.contactus.email.value!='')
		{
			var myRegxp = /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/;
			if(!myRegxp.test(document.contactus.email.value))
			{
				alert("The email address you have entered is not valid.");
				document.contactus.email.select();
				return false;
			}
		}
		
		
//		return false;
	}
	
	function checkRequiredFieldsForValues(fields,fieldNames)
	{
		for (var i = 0; i < fields.length; i++)
		{
			if (document.getElementById(fields[i]).value == '' || document.getElementById(fields[i]).value == null)
			{
				alert("You must enter a value for " + fieldNames[i] + ".");
				setFocus(fields[i]);
				return false;
			}
		}		
		return true;
	}
	
	function setFocus(id)
	{
		document.getElementById(id).focus();
	}
	
	function showHide(targetID,className,headerID,showMessage,hideMessage)
	{
		if (document.getElementById)
		{
			var x = document.getElementById(targetID);
			var y = document.getElementById(headerID);
			if (x.className == className + " show")
			{
				x.className = className + " hide";
				y.innerHTML = hideMessage;
			}
			else
			{
				x.className = className + " show";
				y.innerHTML = showMessage;
			}
		}
	}

	function validateUSZip( strValue )
	{
		/************************************************
			DESCRIPTION: Validates that a string a United
			States zip code in 5 digit format or zip+4
			format. 99999 or 99999-9999
			
			PARAMETERS:
			strValue - String to be tested for validity
			
			RETURNS:
			True if valid, otherwise false.
			
		*************************************************/
		var objRegExp  = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
		
		//check for valid US Zipcode
		return objRegExp.test(strValue);
	}
	
	function validateUSPhone( strValue )
	{
		/************************************************
		DESCRIPTION: Validates that a string contains valid
		US phone pattern.
		Ex. (999) 999-9999 or (999)999-9999
		
		PARAMETERS:
		strValue - String to be tested for validity
		
		RETURNS:
		True if valid, otherwise false.
		*************************************************/
		var objRegExp  = /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/;
		
		//check for valid us phone with or without space between
		//area code
		return objRegExp.test(strValue);
	}

