/*****************************************************************************
** Copyright (C) 2002, Stephen Gould 
**
** FILENAME:	contactus.js
** AUTHOR:		Stephen Gould
** COMMENCED:	08 Jun 2002
** MODIFIED:	03 Jul 2002
** DESCRIPTION:	javascript for dymanic menus in web pages for CWC
**
*****************************************************************************/

var sideHeading = "Contact Details";

var sideMenuArray = new Array(
	"Rhomberg", "Electronics", "../contactus/contact_electronics.html",
	"Rhomberg", "Instrumentation", "../contactus/contact_instrumentation.html",
	"Contact Form", "", "../contactus/contactform.html"
);

var sideSubMenu = new Array();

sideSubMenu[0] = new Array();
sideSubMenu[1] = new Array();
sideSubMenu[2] = new Array();

/* Functions ****************************************************************/

function validate() {
	if (document.contactform.firstname.value == "") {
		alert("Your first name has not been entered.\n" +
			"Please complete this field before re-submitting.");
		document.contactform.firstname.focus();
		return (false);
	}

	if (document.contactform.lastname.value == "") {
		alert("Your last name has not been entered.\n" +
			"Please complete this field before re-submitting.");
		document.contactform.lastname.focus();
		return (false);
	}

	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(document.contactform.email.value))) { 
		alert("You have entered an invalid email address.\n" +
			"Please ensure that this field is\n" +
			"correct before re-submitting.");
		document.contactform.email.focus();
		return (false);
	}

	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	if (document.contactform.email.value.match(illegalChars)) {
		alert("You have entered an invalid email address.\n" +
			"Please ensure that this field is\n" +
			"correct before re-submitting.");
		document.contactform.email.focus();
		return (false);
	}

 	return (true);
}

/*****************************************************************************
** END OF FILE:	contactus.js
*****************************************************************************/
