/* JavaScript Document */

/*
 * PopUp -- Creates a javascript popup window
 *
 * object PopUp ( string url[, int height, int width, string windowname, string options] ) 
 *
 * PARAMETERS
 * url = The URL to be opened in the popup
 * height = number of pixels high the window should be. Default is 480.
 * width = number of pixels wide the window should be. Default is 640.
 * windowname = the name of the popup window. Default is popup.
 * options = the options for the popup window.  Default is all off.
 *
 */
function PopUp (url, height, width, windowname, options)
{
	height = (isDefined(height)) ? height : 480;
	width = (isDefined(width)) ? width : 640;
	windowname = (isDefined(windowname)) ? windowname : 'popup';
	options = (isDefined(options)) ? options : 'status=0,menubar=0,resizable=0,toolbar=0,scrollbars=1';
	options += ',height=' + height + ',width=' + width;
	window.open(url, windowname, options);
}

/*
 * HideShow -- Shows or hides a pageLayer based on the layer's current condition
 *
 * object HideShow ( string pageLayer[, string state] )
 *
 * PARAMETERS
 * pageLayer = This is the id of the element that is to be manipulated.
 *
 */
function HideShow (pageLayer, state)
{
	if (document.getElementById) { // DOM3 = IE5, NS6
		state = (isDefined(state)) ? state :
			(document.getElementById(pageLayer).style.visibility == 'visible') ? 'hidden' : 'visible';
		document.getElementById(pageLayer).style.visibility = state;
	} else if (document.layers) { // Netscape 4
		state = (isDefined(state)) ? state :
			(eval("document." + pageLayer + ".visibility") == 'visible') ? 'hidden' : 'visible';
		document.pageNavigationSearchPopup.visibility = state;
	} else { // IE 4
		state = (isDefined(state)) ? state :
			(eval("document.all." + pageLayer + ".visibility") == 'visible') ? 'hidden' : 'visible';
		document.all.pageNavigationSearchPopup.style.visibility = state;
	}
}

/*
 * isDefined -- Finds whether a variable is defined
 *
 * bool isDefined ( mixed variable ) 
 *
 * PARAMETERS
 * variable = The variable being evaluated
 *
 * Returns TRUE if a variable is defined.
 *
 */
function isDefined (variable)
{
	return (typeof(variable) == "undefined") ?  false : true;
}

/*
 * ImageState -- Take information from image map and put it into a hidden form for processing
 *
 * null ImageState ( string state )
 *
 * PARAMETERS
 * state = The two letter abbreviation of the State clicked on
 *
 */
function ImageState (state)
{
	document.byimage.state.value = state;
	document.byimage.submit();
}

 
