
// This function is used for the Suckerfish (flyout) menus

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);



// menuExpandable.js - implements an expandable menu based on a HTML list
// Author: Dave Lindquist (http://www.gazingus.org)

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    //if (window.opera) return; // I'm too tired

   actuator.parentNode.style.background = "url(../img/arrow-down-sm.gif) 90% 10px no-repeat";
    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.background =
            (display == "block") ? "url(../img/arrow-down-sm.gif) 90% 10px no-repeat" : "url(../img/arrow-up-sm.gif) 90% 10px no-repeat";
        menu.style.background = "url(/images/square.gif)";
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
}


// Preload images

function Preload() {
 	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++) {
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
   }
   
   

function gotoUrl(url) {
  if (url == "")
    return;
  location.href = url;
}


function printFlash(source, width, height, id, bg_color) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8" ');
	document.write('width="'+width+'" height="'+height+'" id="'+id+'" align="top">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+source+'" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="'+bg_color+'" />');
	document.write('<embed src="'+source+'" menu="false" quality="high" bgcolor="'+bg_color+'" width="'+width+'" height="'+height+'" name="'+id+'" align="top" ');
	document.write('allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}


function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}