// Checks for valid email address
	function echeck(str) {
		 return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	}

// embeds a Flash movie
	function embedFlash(path, width, height, bgcolor) {
		if (! bgcolor) {
			bgcolor = "ffffff";
		}
		document.write("<OBJECT ");
			document.write("classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
			document.write("width=" + width + " height=" + height + ">");
			document.write("<param name=movie value='" + path + "'>");
			document.write("<param name=quality value=high>");
			document.write("<param name=menu value='false'>");
			document.write("<param name=wmode value='transparent'>");
		document.write("<embed src='" + path + "' quality=high bgcolor='" + bgcolor + "' width=" + width + " height=" + height + " ");
			document.write("type='application/x-shockwave-flash' ");
			document.write("menu='false' wmode='transparent'");
			document.write("PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>");
		document.write("</embed>");
		document.write("</object>");
	}
	

// open a generic popup window, specifying source and size

	function popup(source,width,height) {
		popup_window = window.open(source,"popup_window","width="+String(width)+",height="+String(height)+",location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=yes");
		popup_window.focus()
	}


// write a random element from the specified array

	function writeRandom(arrayName) {
		which = (Math.round(Math.random() * (arrayName.length - 1)))
		document.write(arrayName[which])
	}


// the simplest possible rollover function

	function swap(name,state) {
		eval('document.images.' + name + '.src = ' + name + '_' + String(state) + '.src')
	}
	
// write a block of code that preloads a list of graphics
// - used at the top of any page that contains rollovers

	function makePreloads(names) {
		names = names.split(",")
		for (i=0; i < names.length; i++) {
			thisName = names[i]
			eval(thisName+"_0 = new Image()")
			eval(thisName+"_0.src = 'images/button_"+thisName+"_0.png'")
			eval(thisName+"_1 = new Image()")
			eval(thisName+"_1.src = 'images/button_"+thisName+"_1.png'")
		}
	}
	
	function makePreloadsJpg(names) {
		names = names.split(",")
		for (i=0; i < names.length; i++) {
			thisName = names[i]
			eval(thisName+"_0 = new Image()")
			eval(thisName+"_0.src = 'images/"+thisName+"_0.jpg'")
			eval(thisName+"_1 = new Image()")
			eval(thisName+"_1.src = 'images/"+thisName+"_1.jpg'")
		}
	}
	
	function selectedValue(selBox) {
  		return selBox.options[selBox.selectedIndex].value;
	}

