<!--

/***********************************************************

This code is copyright (c) 2002 by Exit1, Incorporated.
All rights reserved. Unauthorized reproduction, modification,
or distribution of this code is expressly prohibited.

Authorization is granted if:
a) it is used for personal or non-commercial use, and
b) this copyright notice is included.

Please direct any questions about the use of Exit1's scripts
to: techsupport@exit1.com.

***********************************************************/

//list of all image names to be used, in any order
names = new Array(
		"btn_about_up",			"btn_about_over",
        "btn_contact_up",		"btn_contact_over",
        "btn_directors_up",		"btn_directors_over",
        "btn_education_up",		"btn_education_over",
        "btn_events_up",		"btn_events_over",
        "btn_grantawards_up",	"btn_grantawards_over",
        "btn_home_up",			"btn_home_over",
        "btn_novhome_up",		"btn_novhome_over",
        "btn_oldnew_up",		"btn_oldnew_over",
        "btn_publications_up",	"btn_publications_over",
        "btn_research_up",		"btn_research_over",
        "btn_sitemap_up",		"btn_sitemap_over",
        "btn_staff_up",			"btn_staff_over",
        "btn_whatsnew_up",		"btn_whatsnew_over" );

//crap 'cause some browsers (MSIE) do not support image.src!
if (parseInt(navigator.appVersion) >= 3)
        Browser = true;
        else Browser = false;

//pre-load images
if (Browser) {
        button = new Array(names.length);
        for (i = 0; i < names.length; i++){
                b = names[i];
                button[b] = new Image();
                button[b].src = "./images/nav/" + b + ".gif";
        } // end for
} // end if

//change images
function wiggle(n,s) {
        if (Browser) {
                index = n + "_" + s;
                document[n].src = button[index].src;
        } // end if
        return true;
 } // end wiggle

function checkform() {  // check form elements
	var t = "";
	var allValid = true;
	var vp = "() -0123456789ext.";
	with (document.form) {

	t += (last_name.value) ? "" : "The 'Last Name' field is empty\n";
	t += (first_name.value) ? "" : "The 'First Name' field is empty\n";

	//validate email address
	if (email.value.indexOf("@") == -1){
		t += "Please enter a valid email address\n";
	}
	else {
		ea = email.value.split("@");
			if (ea[1].indexOf(".") == -1){
				t += "Please enter a valid email address\n";
			}
			else {
				dom = ea[1].split(".");
					if ((!dom[0])||(dom[0].length <= 0))
					t += "Please enter a valid domain name in your email address\n";
					else if ((!dom[01])||(dom[1].length <= 1))
					t += "Please enter a valid domain name in your email address\n";
			}
	}
	//end of email address validation

	if (t != "") {
		t = "The information you entered could not be submitted because of the following errors:\n\n" + t;
		alert(t);
		return false;
	}
	else return true;

	} // end with
} // end checkform
//-->
