// Enable hover for IE6
var currItem;
doHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover = function() {
			this.className += " over";
			currItem = null;
		}
		sfEls[i].onmouseout = function() {
			currItem = this;
			//setTimeout("delayHideMenu()", 900);
			currItem.className = currItem.className.replace(new RegExp(' over\\b'), "");
		}
	}
}

if( window.external && (typeof window.XMLHttpRequest == "undefined") ) { window.onload = doHover; }

/**
 * Opens a new window with the specified parameters.
 *
 * @param {String} href		The url to load in the new window.
 * @param {Integer} width	The width of the new window.
 * @param {Integer} height	The height of the new window.
 * @param {String} opts		The window options as a string.
 * @return {Object} win		The new window object.
 */
function newWin( href, width, height, opts ) {
	if( !width ) {
		width = 800;
	}
	if( !height ) {
		height = 600;
	}
	if( opts ) {
		var winOpts = opts + ', width=' + width + ', height=' + height;
	} else {
		var winOpts = 'toolbar=yes, location=yes, menubar=yes, scrollbars=yes, resizable=yes, width=' + width + ', height=' + height;
	}
	var win = window.open(href, null, winOpts);
	return win;
}

/**
 * Function to protect emails from spambots.
 *
 * @param {String} name			The name portion of the address.
 * @param {String} domain		The domain portion of the address.
 * @param {String} ext			The domain extension.
 * @param {String} text			The link text.
 * @param {String} subject		The email subject.
 * @return {String} retval		The new window object.
 */
function noSpam( name, domain, ext, text, subject ) {
	var href = 'mailto:' + name + '@' + domain + '.' + ext;
	if( subject ) {
		href = href + '?subject=' + subject;
	}
	if( !text ) {
		text = name + '@' + domain + '.' + ext;
	}
	var retval = '<a href="' + href + '">' + text + '</a>';
	return retval;
}
function checkform(){
	if (document.signup.name.value.length < 4){
		 alert("Please enter your full name")
		 return false}
		 if ((document.signup.email2.value.length < 9) || (document.signup.email2.value.indexOf('@') == -1) || (document.signup.email2.value.indexOf('.') == -1)){
		 		 alert("Please enter a valid email address like you@domain.com")
		 return false}
		 if (document.signup.comments.value.length < 1){
		 alert("Please enter your comments")
		 return false}
		 if (document.signup.checkit.value != 4){
		 alert("Please answer the multiplication question of 2 x 2")
		 return false}
	}
function checkformDemo(){
	if (document.signupdemo.name.value.length < 4){
		 alert("Please enter your full name")
		 return false}
		 if (document.signupdemo.phone.value.length < 10){
		 		 alert("Please enter your phone number as 555-555-5555")
		 return false}
		 if ((document.signupdemo.email2.value.length < 9) || (document.signupdemo.email2.value.indexOf('@') == -1) || (document.signupdemo.email2.value.indexOf('.') == -1)){
		 		 alert("Please enter a valid email address like you@domain.com")
		 return false}
		 if (document.signupdemo.library.value.length < 4){
		 alert("Please enter your library")
		 return false}
		 if (document.signupdemo.state.value.length < 2){
		 alert("Please enter your state")
		 return false}
		 if (document.signupdemo.checkit.value != 4){
		 alert("Please answer the multiplication question of 2 x 2")
		 return false}
	}