// 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'")
		}
	}
	
	function makePreloads2(names) {
		names = names.split(",")
		for (i=0; i < names.length; i++) {
			thisName = names[i]
			eval(thisName+"_0 = new Image()")
			eval(thisName+"_0.src = 'graphics/button_"+thisName+"_0.gif'")
			eval(thisName+"_1 = new Image()")
			eval(thisName+"_1.src = 'graphics/button_"+thisName+"_1.gif'")
		}
	}

// Write a mouseover button
	function makeButton(page,section) {
		document.write("<a href='default.aspx?page=" + page + "&section=" + section + "' onmouseover=\"swap('" + section + "',1)\" onmouseout=\"swap('" + section + "',0)\">");
		document.write("<img src='graphics/button_" + section + "_0.gif' name='" + section + "' border='0'>");
		document.write("</a>");
	}
	
	function makeButton2(section) {
		document.write("<a href='default.aspx?page=" + page + "&section=" + section + "' onmouseover=\"swap('" + section + "',1)\" onmouseout=\"swap('" + section + "',0)\">");
		document.write("<img src='graphics/button_" + section + "_0.gif' name='" + section + "' border='0'>");
		document.write("</a>");
	}
	
	function confirmDelete(ID,section) {
		input = confirm("Are you sure you want to delete this record?");
		if (input == true) {
			location='?delete='+ID;
		}
	}
	
// 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("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' ");
			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("<embed src='" + path + "' quality=high bgcolor='" + bgcolor + "' width=" + width + " height=" + height + " ");
			document.write("type='application/x-shockwave-flash' ");
			document.write("menu='false'");
			document.write("PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>");
		document.write("</embed>");
		document.write("</object>");
	}