// construct Flash object and embed tags// FlashVars should be a string of name/value pairs separated by ampersands	function get_flash_tags(filename, width, height, bgcolor, flashvars) {		name = filename;		if (name.indexOf("/")) { name = name.substring(name.lastIndexOf("/") + 1); }		if (name.indexOf(".")) { name = name.substring(0, name.indexOf(".")); }				output = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';		output += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';		output += ' WIDTH="' + String(width) + '" HEIGHT="' + String(height) + '" id="' + name + '" name="' + name + '" ALIGN="">';		output += '<PARAM NAME=movie VALUE="' + filename + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=' + bgcolor + '> <EMBED src="' + filename + '" quality=high bgcolor=' + bgcolor + ' WIDTH="' + String(width) + '" HEIGHT="' + String(height) + '" NAME="' + name + '" ALIGN=""';		output += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" swLiveConnect="true"';		output += ' FlashVars="' + flashvars + '"></EMBED>';		output += '<PARAM NAME="FlashVars" VALUE="' + flashvars + '">';		output += '</OBJECT>';		return output;	}	// decide whether we've been flattened or not	function is_flattened() {		return ((location.href.indexOf("flattened") != -1)&&(location.href.indexOf(".html") != -1));	}// return a path to a page, given a page name, in either a flattened or unflattened format// change script_extension depending on what version of Contemplate we're using	function format_page_name(page_name) {		script_extension = "asp";		if (is_flattened()) {			page_name_formatted = "../flattened/" + page_name + ".html";		} else {			page_name_formatted = "../contemplate/assembler." + script_extension + "?page=" + page_name;		}		return page_name_formatted;	}			// gets the name of the current page, even if we're rewriting URLs	function get_page_name() {		if (location.href.indexOf("page=") != -1) {			page_name = location.href.substring(location.href.indexOf('page=') + 5, location.href.length);		} else {			page_name = location.href.substring(location.href.lastIndexOf('/') + 1, location.href.indexOf('.htm'));		}		return page_name;	}	// open a popup window, specifying source, width, and height, and optionally a name; if no name, choose a random one	function popup(source,width,height,window_name) {		if (! window_name) { 			now = new Date()			window_name = now.getTime()		} else {			window_name = window_name.replace(/ /g, "_");		}		popup_window = window.open(source,window_name,"width="+String(width)+",height="+String(height)+",location=no,menubar=no,directories=no,toolbar=no,scrollbars=no,resizable=no,status=yes");		popup_window.focus()	}// popup window with same width and height across all browsers	function popup_same_size(source,width,height,window_name) {		if (navigator.appVersion.indexOf("Mac")!=-1) {			// Mac IE : Mac other			resize_height = (document.all) ? 10 : 30;			resize_width = (document.all) ? 15 : 14;		} else {			if (document.layers) {				// Netscape 4				resize_height = 0;				resize_width = 0;			} else {				// Netscape 6+ : IE				resize_height = (navigator.userAgent.indexOf("Netscape")!=-1) ? 15 : 15;				resize_width = (navigator.userAgent.indexOf("Netscape")!=-1) ? 16 : 13;			}		}		new_width = width + resize_width;		new_height = height + resize_height;		popup(source,new_width,new_height,window_name);	}	// 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// - this version makes on and off states and is most often used for button rollovers// names - a comma-delimited list of button names (e.g. "home,about,contact")// path - the path to the graphics; defaults to "../graphics" if not set (e.g. "../graphics/menus/home")// extension - the file extension of the graphics files; defaults to "gif" if not set (e.g. "jpg")	function preload_buttons(names, path, extension) {		names = names.split(",");		path = (path) ? path : "../graphics" ;		extension = (extension) ? extension : "gif" ;		for (n=0; n < names.length; n++) {			this_name = names[n];			this_path = path + "/" + this_name;			eval(this_name + "_0 = new Image()");			eval(this_name + "_0.src = '" + this_path + "_0." + extension + "'");			eval(this_name + "_1 = new Image()");			eval(this_name + "_1.src = '" + this_path + "_1." + extension + "'");		}	}	// figure out whether a variable has been set or not without generating an undefined error if it hasn't	function isset(variable) {		eval("result = (typeof(" + variable + ") != 'undefined')");		return result;	}	// returns the index of an array element, something that ought to be built into JavaScript but isn't!// returns -1 if not present	function get_position(string, array) {		for (n=0; n < array.length; n++) {			if (array[n] == string) {				return n;				break;			}		}		return -1;	}// show or hid a div	function show_hide_div(id,show_div) {		if (show_div == "1") {			if (document.layers) 				document.layers[''+id+''].visibility = "show"			else if (document.all) 				document.all[''+id+''].style.visibility = "visible"			else if (document.getElementById) 				document.getElementById(''+id+'').style.visibility = "visible"		} else if (show_div == "0"){			if (document.layers) 				document.layers[''+id+''].visibility = "hide"			else if (document.all) 				document.all[''+id+''].style.visibility = "hidden"			else if (document.getElementById) 				document.getElementById(''+id+'').style.visibility = "hidden"		}	}	// navigate to the next page in this section of the page definitions file	function navigate_next() {		top.location = format_page_name(page_next);	}// navigate to the previous page in this section of the page definitions file	function navigate_previous() {		top.location = format_page_name(page_previous);	}// navigate to the previous page in this section of the page definitions file	function navigate_start() {		top.location = format_page_name(page_start);	}			// this is handy for preventing the Return key from submitting forms (set form action to "JavaScript:nothing()")		function nothing() {}		