// 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>");
	}
	
// grab name/value pairs from the URL and set JavaScript variables accordingly
// - PHP does this automatically

	function getVars() {
	
		if (document.URL.indexOf('?') != -1) {
		
			queryString = document.URL.substring(document.URL.indexOf('?') + 1, document.URL.length);
			queryPairs = queryString.split("&")
			
			for (i=0; i < queryPairs.length; i++) {
				pair = queryPairs[i].split("=")
				key = pair[0]
				value = pair[1]
				eval(key + " = '" + value + "'")
			}
			
			if (queryString.indexOf("args=") != -1 ){
				argsPieces = args.split(",")
				for (i=0; i < argsPieces.length; i++) {
					j = i + 1
					eval("arg" + j + " = '" + argsPieces[i] + "'")
				}
			}
		
		} else {
			queryString = ""; queryPairs = ""; template = ""; args = ""
		}
			
	}
	
	
// 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()
	}

// 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 = 'graphics/"+thisName+"_0.gif'")
			eval(thisName+"_1 = new Image()")
			eval(thisName+"_1.src = 'graphics/"+thisName+"_1.gif'")
		}
	}
	

		

