/**
$Id: pint_commonDEBUG.js,v 1.19 2004/01/14 18:14:37 cducker Exp $

Description:
	PINT Commonly used JavaScript functions and constants.

Dependencies:
	Inward:
		pint_initcleanup.js
	
	Outward:
		none	
	
Usage:
	n/a		
*/

/* ******** Constants *********************************** */
windowStatus = "";
/* ******** Common Window Settings ********************** */
defaultStatus = "";
var rootDirectory = "";
/**
 * PINT_GetEventSource()
 * Takes as an argument the first argument to an event handler, and 
 * returns a reference to the object that generated the event
 *
 * @param e - first argument to an event handler
 *
 * @return reference to object that triggered event
 */
function PINT_GetEventSource(e)
{
	if ( e && e.target )
		{
		// HACK for NN 6 because NN 6 trigger event from text node 
		var event = e && e.target;
		while (event && event.nodeType == 3)
			event = event.parentNode

		return (event);
		}
		
	if (window && window.event && window.event.srcElement)
		return (window && window.event && window.event.srcElement);
	
	return false;		
}

/**
 * PINT_GetElementById()
 * Tries to find an element in the document 
 * by its id or name
 *
 * @param idname - id of element to locate
 */
function PINT_GetElementById(idname)
{
	var handle;

	if (document.getElementById) {
		handle = document.getElementById(idname);
		if (handle) return handle;
	}

	if (document.getElementByName) {
		handle = document.getElementByName(idname)[0];
		if (handle) return handle;
	}

	handle = document[idname];
	if (handle) return handle;

	if (document.all) {
		handle = document.all[idname];
		if (handle) return handle;
	}
	
	if (document.anchors) {
		handle = document.anchors[idname];
		if (handle) return handle;
	}
	
	if (document.links) {
		handle = document.links[idname];
		if (handle) return handle;
	}
	
	if (document.images) {
		handle = document.images[idname];
		if (handle) return handle;
	}
	
	if (document.embeds) {
		handle = document.embeds[idname];
		if (handle) return handle;
	}

	return handle;
}

/**
 * PINT_GetIdByElement()
 * Inverse of PINT_GetElementById, returns the id, 
 * or name, of a given element
 *
 * @param element - object whose id to retrieve
 */
function PINT_GetIdByElement(element)
	{
	if (!(element)) return undefined;
	if (element.id) return element.id;
	if (element.name) return element.name;
	return undefined;
	}

/**
 * PINT_ChangePageTitle()
 * Change title of current page. Use when initial title
 * tag value is optimized for Search Engines, but you 
 * want the title to be more descriptive for the visitor.
 *
 * @param   pageTitle  - new page title
 */	
function PINT_ChangePageTitle( pageTitle )
	{
	if(document.title.readOnly == true) document.title = pageTitle;
	} 	
	
/**
 * PINT_GetCurrentFileName()
 * Get name of current file from path name
 */
function PINT_GetCurrentFileName()
	{
	var URL = unescape( window.location.pathname );
	var start = URL.lastIndexOf( "/" ) + 1;
	var end = ( URL.indexOf( "?" ) > 0 ) ? URL.indexOf( "?" ) : URL.length;
	return( URL.substring( start, end ) );
	}	
/**
 * PINT_GetCurrentFilePath()
 * Get path to current file from path name
 */
function PINT_GetCurrentFilePath()
	{
	var URL = unescape( window.location.pathname );
	var start = URL.lastIndexOf( "/" );
	return( URL.substring( 0, start ) );
	}

/**
 * PINT_GetCurrentDirectory()
 * Get name of current directory from path name
 */			
function PINT_GetCurrentDirectory()
	{
	var filePath = PINT_GetCurrentFilePath();
	var directories = filePath.split("/");
	return directories.length && directories[ directories.length-1 ] != "" ? directories[ directories.length-1 ] : "";
	}
	
/**
 * PINT_IsRootDirectory()
 * Determine if specified directory matches root directory
 *
 * @param directory - directory to check
 */
function PINT_IsRootDirectory( directory )
	{
	return directory.toLowerCase() == PINT_GetRootDirectory().toLowerCase() ? true : false;
	}

/**
 * PINT_IsDefaultFile()
 * Determine if file name is an index file
 *
 * @param fileName - file name to check
 */
function PINT_IsDefaultFile()
	{
	var fileName = typeof(PINT_IsDefaultFile.arguments[0]) != 'undefined' ? PINT_IsDefaultFile.arguments[0] : PINT_GetCurrentFileName();

	if (fileName == "")
		return true;

	// Get the List of Default Files		
	var fileNameList = PINT_GetDefaultFile(); 
	// If the list is an object
	if ( eval( 'typeof(fileNameList)' ) == 'object' )
		{
		// Loop through array looking for filename.
		for (var fileNameListIndex = 0; fileNameListIndex < fileNameList.length; fileNameListIndex++)
			if ((fileName == fileNameList[fileNameListIndex])) return true;
		}
	return false;
	}	

/**
 * PINT_GetDefaultFile()
 * Gets DefaultFile List global variable if defined.
 * 
 * @return		default file name list.
 *
 */	
function PINT_GetDefaultFile()
	{
	if( typeof( defaultFileList ) == 'undefined' )	
		return "";
	else
		return defaultFileList.split(",");
	}	
	
/**
 * PINT_FirstFocus()
 * Set cursor focus to first available form field
 * 
 * @param field - optional: reference to form input, otherwise defaults to the first element of the first form on the page
 */				
function PINT_FirstFocus()	
	{
	var elementref;
	var i=0;
	if (!(elementref = PINT_FirstFocus.arguments[0]))
		{
		if (!(document.forms[0])) return false;
		while ((elementref = document.forms[0].elements[i++]) && ((elementref.type == 'hidden') || (elementref.type == 'radio') || (elementref.disabled))) {};
		}
	else
		{
		var formIndex;
		var formElementIndex;
		var formElementName = PINT_FirstFocus.arguments[0];
		elementref = null;
		
		for (formIndex = 0; formIndex < document.forms.length; formIndex++)
			{
			for (formElementIndex = 0; formElementIndex < document.forms[formIndex].elements.length; formElementIndex++)
				{
				if (document.forms[formIndex].elements[formElementIndex].name == formElementName)
					{
					elementref = document.forms[formIndex].elements[formElementIndex];
					break;
					}
				}
				if (elementref)	break;
			}
		}

	if (!(elementref)) return false;
	elementref.focus();
	return true;
	}

/**
 * PINT_OnMouseOverHandler()
 * Handler for all onmouseover events. Must be explicitly set as 
 * the function handler.
 * 
 * @param e		event
 * @return		True.
 *
 */
function PINT_OnMouseOverHandler(e) 
	{
	e = (e) ? e : ((window.event) ? window.event : "")
	if (e) 
		{
		var eventsource = PINT_GetEventSource(e);
		if( eval( 'typeof(PINT_MenuTriggers)' ) != 'undefined' && 
		    eval( 'typeof(PINT_MenuTriggers[eventsource.id])' ) != 'undefined' )
			PINT_MenuPopUp(e);
		else if( eval( 'typeof(PINT_ROtriggers)' ) != 'undefined' &&  
		    eval( 'typeof(PINT_ROtriggers[eventsource.id])' ) != 'undefined' )
			PINT_RORollover(e);
			
		PINT_SetWindowStatus();	
		}
	return true;	
	}

/**
 * PINT_OnMouseOutHandler()
 * Handler for all onmouseout events. Must be explicitly set as 
 * the function handler.
 * 
 * @param e		event
 * @return		True.
 *
 */	
function PINT_OnMouseOutHandler(e) 
	{
	e = (e) ? e : ((window.event) ? window.event : "")
	if (e) 
		{
		var eventsource = PINT_GetEventSource(e);
		if( eval( 'typeof(PINT_MenuTriggers)' ) != 'undefined' && 
		    eval( 'typeof(PINT_MenuTriggers[eventsource.id])' ) != 'undefined' )
			PINT_MenuPopDown(e);	
		else if( eval( 'typeof(PINT_ROtriggers)' ) != 'undefined' &&  
			eval( 'typeof(PINT_ROtriggers[eventsource.id])' ) != 'undefined' )
			PINT_RORollout(e);
		}
	return true;
	}

/**
 * PINT_SetWindowStatus()
 * Set status bar message from parameter or global variable.
 * 
 * @param e		event
 * @return		True.
 *
 */	
function PINT_SetWindowStatus()
	{
	// if no arguments are passed, look for global windowStatus varible
	if( PINT_SetWindowStatus.arguments.length == 0 )
		{
		if( typeof(windowStatus) != 'undefined' && windowStatus != "" )
			{
			window.status = windowStatus;
			windowStatus = "";
			}
		}	
	else
		window.status = PINT_SetWindowStatus.arguments[0];
	return true;
	}	
	
/**
 * PINT_GetRootDirectory()
 * Gets rootDirectory global variable if defined.
 * 
 * @return		root directory path.
 *
 */	
function PINT_GetRootDirectory()
	{
	if( typeof( rootDirectory ) == 'undefined' )	
		return "";
	else
		return rootDirectory;
	}
	
	
/**
 * PINT_getElementsByClass(name)
 * Gets all elements that belong to a specific class
 * 
 * @param name	string containing name of class
 * @return		array of objects
 *
 */	
function PINT_getElementsByClass(name) 
	{
	var all = document.all ? document.all : document.getElementsByTagName('*');
	var elements = new Array();
	for (var e = 0; e < all.length; e++)
		{
		if((name != '') && (all[e].className.indexOf(name) >= 0)) elements[elements.length] = all[e];
		}
	return elements;
	}
	

/**
 * PINT_getURLParam(name, defaultVal)
 * Gets a parameter's value from the url query string if it exists, 
 * otherwise returns a default value
 *
 * @param name  name of url param
 * @param defaultVal value if the url param does not exist
 * @return string  value of url param
 *
 */	
function PINT_getURLParam(name, defaultVal)
	{
	// default the param's value to the default value
	var paramVal = defaultVal;
	// make a regex for the specific param name
	var regex = new RegExp("\&" + name + "\=([^$\&]+)", "i");
	// check if there are any params in the url
	if(document.URL.indexOf('?') != -1) 
		{
		// extract just the query string (prepend an & so the regex can find the first param)
		var qString = '&' + document.URL.substring((document.URL.indexOf('?') + 1), document.URL.length);
		// match the regex to the query string
		var urlMatches = qString.match(regex);
		// if it found a match, the second array element returned will be the value
		if((urlMatches != null) && (urlMatches.length == 2)) paramVal = urlMatches[1];
		}
	return paramVal;
	}

/*
$Id: pint_printcssDEBUG.js,v 1.3 2003/08/11 20:38:55 cducker Exp $

Creator: C. Ducker

Description:
	Display different style sheets depending upon client browser capabilities.

Dependencies:
	pint_common.js
	
Usage:	
	<head>
	<script src="/javascript/pint_printcss.js" language="JavaScript" type="text/javascript"></script>
	</head>
*/

function PINT_PrintCSS()
	{
	var NS4, IE, DOMstandard, CSScapable;
	NS4 = (document.layers) ? 1 : 0;
	IE = (document.all) ? 1 : 0;
	DOMstandard = (document.getElementById) ? 1 : 0;
	CSScapable = (NS4 || IE || DOMstandard) ? 1 : 0;
	
	if(CSScapable) 
		{
		if(NS4) 
			document.write("<link rel=\"stylesheet\" href=\"" + PINT_GetRootDirectory() + "/css/netscape.css\" type=\"text/css\" media=\"screen\" />");
		else
			document.write("<link rel=\"stylesheet\" href=\"" + PINT_GetRootDirectory() + "/css/dom.css\" type=\"text/css\" media=\"screen\" />");
		}
	}	
	
/*
$Id: pint_rolloverDEBUG.js,v 1.5 2003/07/03 17:01:44 cducker Exp $

Creator: J. Brock

Description:
	This rollover code is supposed to be 
		1. flexible, to accomodate all possible rollover activity
		2. compatible, should work on anything better than IE4, Netscape 4
		3. easy, so that all the rollover information can be inserted into the img tag in a simple way
		4. robust, so that errors, typos, bad DOM support make it degrade gracefully

Dependancies:
	pint_initcleanup.js

Usage:
	In pint_initcleanup.js:
	function init()
		{
		PINT_RORolloverInit('img1', 'img1', 'img1on.png');
		PINT_RORolloverInit('img2', 'img2', 'img2on.png', 'img1', 'img1on.png');
		};
	
	function cleanup()
		{};
	
	In page.htm:
	<head>
	<script src="\script\PINTRolloverDEBUG.js" language="JavaScript" type="text/javascript"></script>
	<script src="\script\PINTInitCleanup.js" language="JavaScript" type="text/javascript"></script>
	</head>

	<!-- rolling over img1 turns img1 on, rolling over img2 turns img1 and img2 on. -->
	<img name="img1" src="img1off.png">
	<img name="img2" src="img2off.png">
*/

/*************** PRIVATE DATA STRUCTURES ****************/

var PINT_ROcapableFlag = true;			// assume this browser is rollover capable, unless it proves otherwise.
var PINT_ROtriggers = new Array();
var PINT_ROtargets = new Array();
var PINT_ROtargetRollovers = new Array();
if ((typeof PINT_ROtriggers) != 'object') PINT_ROcapableFlag = false;


/************** PUBLIC METHODS **********************/


/* PINT_RolloverSubPageImgInit
   Wrapper for PINT_RolloverInit
*/ 
function PINT_RolloverSubPageImgInit( rolloverId, windowStatus )
	{
	PINT_RORolloverInit( rolloverId+"img", windowStatus, (PINT_IsDefaultFile() && PINT_GetCurrentDirectory() == rolloverId ? false : true), rolloverId+"img", PINT_GetRootDirectory() + "/images/SNR_"+rolloverId+".gif", true);
	}

/* PINT_RORolloverImgInit
   Wrapper for PINT_RolloverInit
*/ 
function PINT_RolloverImgInit( rolloverId, windowStatus )
	{
	PINT_RORolloverInit( rolloverId+"img", windowStatus, (PINT_IsDefaultFile() && PINT_GetCurrentDirectory() == rolloverId ? false : true), rolloverId+"img", PINT_GetRootDirectory() + "/images/HNR_"+rolloverId+".gif", true);
	}

// NEW: trigger, window status, set trigger, target, target image, revert, target, target image, revert, target, target image, revert, target, target image, revert, target, target image,

/*	PINT_RORolloverInit()
	Initializes an html entity for image rollover triggering. This function should only be called after the body of the document has finished loading.
	Arguments: (there must be an odd number of arguments)
		1. the name attribute of the entity (usually an <a> or an <img>) which triggers the rollover
		2. the name attribute of the <img> which will be changed
		3. the source url that the image named by arg 2 will rollover to
		4. same as 2...
		5. same as 3...
		...
	Returns: true on success, false on failure
*/

function PINT_RORolloverInit()
	{
	if (!(PINT_ROcapableFlag)) return false;			// if the browser is not rollover capable, fail
	if (!(document.images)) return PINT_ROcapableFlag = false;
	if (PINT_RORolloverInit.arguments.length < 1 ) return true;		//if no arguments
	if (PINT_RORolloverInit.arguments.length < 6 || (PINT_RORolloverInit.arguments.length % 3) != 0) return false;	// There must be at least six arguments and a multiple of three

	if( document.getElementById )
		{
		var setTrigger = typeof(PINT_RORolloverInit.arguments[2]) != 'undefined' ? PINT_RORolloverInit.arguments[2] : true;
		var trigger = document.getElementById( PINT_RORolloverInit.arguments[0] );

		if( setTrigger && trigger )
			{
			if (!(PINT_ROtriggers[trigger.id])) PINT_ROtriggers[trigger.id] = new Array(); // init the target array
			
			var targetIndex, targetImageIndex, revertIndex, target, revert;
			
			for (targetIndex = 3; targetIndex < PINT_RORolloverInit.arguments.length; targetIndex = targetIndex + 3)
				{
				targetImageIndex = targetIndex + 1;
				revertIndex = targetIndex + 2;

				// loop through all targets
				target = document.getElementById( PINT_RORolloverInit.arguments[targetIndex] );
				targetrollover = PINT_RORolloverInit.arguments[targetImageIndex];
				revert = PINT_RORolloverInit.arguments[revertIndex];
	
				// make sure the target is an object
				if (!(target) ) return false;
		
				if (!(target.src)) return false;		// if target is not an image
		
				if(revert) PINT_ROtargets[target.id] = target.src;     // load up the target rollover sources
				PINT_ROtargetRollovers[targetrollover] = new Image();
				PINT_ROtargetRollovers[targetrollover].src = targetrollover; // cache rollover images in associative array
				//PINT_ROtriggers[trigger.name][target.name] = PINT_ROtargetRollovers[targetrollover]; // reference to the cached image
				PINT_ROtriggers[trigger.id][target.id] = PINT_ROtargetRollovers[targetrollover]; // reference to the cached image
				}
			if( typeof(PINT_RORolloverInit.arguments[1]) != 'undefined' )
				PINT_ROtriggers[trigger.id]["window.status"] = PINT_RORolloverInit.arguments[1];
				
			trigger.onmouseover = PINT_OnMouseOverHandler;
			trigger.onmouseout = PINT_OnMouseOutHandler;
			}
		}
	return true;
	}


/********* PRIVATE METHODS ************/
function PINT_RORollover(e)
{
	if (!PINT_ROcapableFlag) return false;
	var eventsource = PINT_GetEventSource(e);	//figure out where the events come in on this browser
	if (!eventsource) return (PINT_ROcapableFlag = false); // if there's no events, can't do rollovers
	PINT_RORolloverById(eventsource.id);
	return true;
}

function PINT_RORollout(e)
{
	if (!PINT_ROcapableFlag) return false;
	var eventsource = PINT_GetEventSource(e);	//figure out where the events come in on this browser
	if (!eventsource) return (PINT_ROcapableFlag = false); // if there's no events, can't do rollovers
	PINT_RORolloutById(eventsource.id);
	return true;
}	
	
	
function PINT_RORolloverById(elementId)
	{
	if(!PINT_ROcapableFlag)return false;
	if(eval('typeof(PINT_ROtriggers[elementId])')!='undefined')
		{
		for (target in PINT_ROtriggers[elementId]) //for this trigger, rollover each of it's targets
			{
			if( typeof( document[target] ) == 'object' )
				document[target].src = PINT_ROtriggers[elementId][target].src;
	
			if( target == "window.status" )
				windowStatus = PINT_ROtriggers[elementId][target];
			}
		}
	return true;
	}

function PINT_RORolloutById(elementId)
	{
	if(!PINT_ROcapableFlag)return false;
	if(eval('typeof(PINT_ROtriggers[elementId])')!='undefined')
		{
		for (target in PINT_ROtriggers[elementId]) //for this trigger, reset the src for each of it's targets
			{
			if( typeof( document[target] ) == 'object' && eval('typeof(PINT_ROtargets[target])')!='undefined')// && PINT_ROtargets[target]["revert"] == 1)
				document[target].src = PINT_ROtargets[target];
			}
		}
	return true;
	}	

/* $Id: init.js,v 1.3 2003/07/17 17:37:45 cducker Exp $

Description:
	Library of functions for initialization of DHTML menus and their 
	respective event handlers
		
Dependencies:
	pint_common.js
	pint_cleanupinit.js
			
Usage:
	In pint_initcleanup.js
	function init()
		{
		PINT_MenuInit( "TriggerName1", "TargetName1", "MenuName1" );
		PINT_MenuInit( "TriggerName2", "TargetName2", "MenuName2" );
		}

	In referencing HTML document
	<html>
	<head>
	...
	<script src="scripts/pint_menus.js" language="JavaScript" type="text/javascript"></script>		
	...
	</head>
	...
	<!-- ** Just before ending <body> tag -->
	<script src="scripts/menus/HM_Loader.js" language="JavaScript" type="text/javascript"></script>		
	</body>
	</html>
*/	

// PRIVATE DATA STRUCTURES
var PINT_MenuCapableFlag = true;			// assume this browser is menu capable, unless it proves otherwise.
var PINT_MenuTriggers = new Array();
var PINT_MenuTargets = new Array();
var PINT_MenuTargetMenus = new Array();
if ((typeof PINT_MenuTriggers) != 'object') PINT_MenuCapableFlag = false;


// PUBLIC METHODS 
/**
 * PINT_MenuInit()
 * Initializes menu trigger handlers.
 * 
 * @return          True if successfull, false if not.
 *
 */
function PINT_MenuInit()
	{
	if (!(PINT_MenuCapableFlag)) return false;			
	if (PINT_MenuInit.arguments.length < 1 ) return true;        //if no arguments
	if ((PINT_MenuInit.arguments.length % 2) != 1) return false; //must be odd number of arguments

	if( document.getElementById )
		{
		var trigger = document.getElementById( PINT_MenuInit.arguments[0] );
		
		if( trigger )
			{
			if (!(PINT_MenuTriggers[trigger.id])) PINT_MenuTriggers[trigger.id] = new Array(); 

			var target, targetMenu;
			target     = document.getElementById( PINT_MenuInit.arguments[1] );
			targetMenu = PINT_MenuInit.arguments[2];
			
			PINT_MenuTriggers[trigger.id] = targetMenu;


			trigger.onmouseover = PINT_OnMouseOverHandler;		
			trigger.onmouseout  = PINT_OnMouseOutHandler;
			}
		}
	return true;
	}


// PRIVATE METHODS 
/**
 * PINT_MenuPopUp()
 * Forwards event and which menu to menu pop up method
 * 
 * @return          True if successfull, false if not.
 *
 */
function PINT_MenuPopUp(e)
	{
	if (!PINT_MenuCapableFlag) return false;
	var eventsource = PINT_GetEventSource(e);	
	if (!eventsource) return (PINT_MenuCapableFlag = false); 
	HM_f_PopUp( PINT_MenuTriggers[eventsource.id], e);
	return true;
	}

/**
 * PINT_MenuPopDown()
 * Forwards event and which menu to menu pop down method
 * 
 * @return          True if successfull, false if not.
 *
 */	
function PINT_MenuPopDown(e)
	{
	if (!PINT_MenuCapableFlag) return false;
	var eventsource = PINT_GetEventSource(e);
	if (!eventsource) return (PINT_MenuCapableFlag = false); 
	HM_f_PopDown( PINT_MenuTriggers[eventsource.id] );
	return true;
	}	

function On(imgName) {
      if (document.images) 
          document.images[imgName].src = eval(imgName + "on.src");
}

function Off(imgName) {
      if (document.images)
             document.images[imgName].src = eval(imgName + "off.src");
}		
	
// BEGIN: PINT_OnChange ================================================================================
var PINT_OnChangeLinkType = new Array();
function PINT_OnChangeHandler(e) 
	{
	var formElement

	e = (e) ? e : ((window.event) ? window.event : "")
	if (e) 
		{
		var eventsource = PINT_GetEventSource(e);
		// Loop through all the forms looking for the onchange Event				
		for (formIndex = 0; formIndex < document.forms.length; formIndex++)
			{
			formElement = document.forms[formIndex];
			// Loop through all the elements of the form looking for the onchange Event
			for (elementIndex = 0; elementIndex < formElement.elements.length; elementIndex++)
				{
				if (eventsource.name == formElement.elements[elementIndex].name)
					{
					if (PINT_OnChangeLinkType[eventsource.id] == "anchor" && formElement.elements[elementIndex].value != "" )
						window.location =  formElement.action + "#" + formElement.elements[elementIndex].value;
					else if (PINT_OnChangeLinkType[eventsource.id] == "page" && formElement.elements[elementIndex].value != "" )
						window.location =  formElement.elements[elementIndex].value;
					}
				}
			}
		}
	return true;	
	}

/**
 * PINT_OnChangeInit()
 * 
 * @pram trigger The name of the element triggering the event
 * @param linkType The type of link you are setting up in the on change
 *		- page, anchor
 * 
 */

function PINT_OnChangeInit()
	{
	if (PINT_OnChangeInit.arguments.length != 2 ) return false
	if( document.getElementById )
		{
		var trigger = document.getElementById( PINT_OnChangeInit.arguments[0] ); // Gets the element that triggers the on change
		if( trigger )
			{
			PINT_OnChangeLinkType[trigger.id] = PINT_OnChangeInit.arguments[1];
			trigger.onchange = PINT_OnChangeHandler;
			}
		}
	return true;
	}	
// END: PINT_OnChange ================================================================================

// BEGIN: PINT_AnchorPopupWindows ================================================================================
// TargetLink, WindowName, Attributes
function popupWindow() { 
	if (popupWindow.arguments.length < 1) return false;

    var popupWin = null; 
    popupWin = window.open(popupWindow.arguments[0],popupWindow.arguments[1],popupWindow.arguments[2]);  
}

function PINT_GetWindowSize(style) {
	var size = 400;
	if (style == "width")
		{
		//Non-IE
		if( typeof( window.innerWidth ) == 'number' ) 
			size = window.innerWidth;
		//IE 6+ in 'standards compliant mode'			
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
			size = document.documentElement.clientWidth;
		//IE 4 compatible			
		else if( document.body && document.body.clientWidth ) 
			size = document.body.clientWidth;
		}
	else if (style == "height")
		{
		//Non-IE
		if( typeof( window.innerWidth ) == 'number' )
			size = window.innerHeight;
		//IE 6+ in 'standards compliant mode'						
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
			size = document.documentElement.clientHeight;
		//IE 4 compatible
		else if( document.body && document.body.clientHeight ) 
			size = document.body.clientHeight;
		}
			
	return size;
}

function PINT_AnchorPopupWindows() 
	{ 
    if(!document.getElementsByTagName) return; 
	
	var anchors = document.getElementsByTagName("a");
	var currentAnchor;

	for (var anchorIndex = 0; anchorIndex < anchors.length; anchorIndex++)
		{
		var targetLink, relArray, relInformation, windowAttributes, javascriptTargetLink, windowName;
		var location, menubar, resizable, scrollbars, status, toolbar
		var width, height, windowType, windowName;
		currentAnchor = anchors[anchorIndex];
		targetLink = currentAnchor.getAttribute("href"); 
        relInformation = currentAnchor.getAttribute("rel"); 
        
		if (relInformation && targetLink)	
			{
			relArray = relInformation.split("|");
			// Make sure there are at least 4 parameters
			if (relArray[0] == "popup" && relArray.length >= 4)
				{
				if (relArray[1] != "null")
					width = parseInt(relArray[1]) ? parseInt(relArray[1]) : 400;
				else
					width = PINT_GetWindowSize("width");
					
				if (relArray[2] != "null")
					height = parseInt(relArray[2]) ? parseInt(relArray[2]) : 400;
				else
					height = PINT_GetWindowSize("height");

				windowType = relArray[3];

				windowAttributes = "width=" + width + ",height=" + height; 
				if (windowType == "custom")
					{
					// IF custom window type
					if (relArray.length < 10) return false;
					location = parseInt(relArray[4]) ? parseInt(relArray[4]): 0;
					menubar = parseInt(relArray[5]) ? parseInt(relArray[5]): 0;
					resizable = parseInt(relArray[6]) ? parseInt(relArray[6]): 0;
					scrollbars = parseInt(relArray[7]) ? parseInt(relArray[7]): 0;
					status = parseInt(relArray[8]) ? parseInt(relArray[8]): 0;
					toolbar = parseInt(relArray[9]) ? parseInt(relArray[9]): 0;
					
					// Determine Window name
					if (relArray.length == 11) windowName = relArray[10];
					else windowName = "popupWindow";								

					// Set attributes						
					windowAttributes += ",location="+ location +",menubar=" + menubar +",resizable=" + resizable + ",scrollbars=" + scrollbars + ",status=" + status + ",toolbar="+ toolbar;
					}
				else 
					{
					// Defined Window Type

					// Determine Window name
					if (relArray.length == 5) windowName = relArray[4];
					else windowName = "popupWindow";				

					// Determine attributes
					if (windowType == "standard") windowAttributes += ",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0";
					else if (windowType == "resize") windowAttributes += ",location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0";
					else if (windowType == "scrollbar") windowAttributes += ",location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0";
					else if (windowType == "blank") windowAttributes = "";					
					else return false; 
					}

				javascriptTargetLink = "javascript:popupWindow('" + targetLink + "','" + windowName + "','" + windowAttributes + "');"; 
				currentAnchor.setAttribute("href", javascriptTargetLink); 
				}
			}
		}
    }
// END: PINT_AnchorPopupWindows ================================================================================

var rot13map;
function rot13init()
	{
    var map = new Array();
    var s   = "abcdefghijklmnopqrstuvwxyz";
    for (i=0; i<s.length; i++) map[s.charAt(i)] = s.charAt((i+13)%26);
    for (i=0; i<s.length; i++) map[s.charAt(i).toUpperCase()] = s.charAt((i+13)%26).toUpperCase();
    return map;
	}

function rot13(a)
	{
    if (!rot13map) rot13map=rot13init();
    var s = "";
    for (i=0; i<a.length; i++)
    {
        var b = a.charAt(i);
        s += (b>='A' && b<='Z' || b>='a' && b<='z' ? rot13map[b] : b);
    }
    return s;
	}
	

// named this for obfuscation
function print_e(user, domain)
	{
	var e = rot13(user) + "@" + rot13(domain);
	var out = '<a href="mailto:' + e + '">';
	out += e;
	out += '</a>';
	document.write(out);
	}

// BEGIN: PINT TEXT SIZE CHANGER FUNCTIONS ==========================================================================
var PINT_CSSStructure = new Object();

var PINT_TOOLS = new Object();
PINT_TOOLS.FONT = new Object();
PINT_TOOLS.FONT.GLOBAL_DIV = "contentdiv";
PINT_TOOLS.FONT.CURRENT = false;
PINT_TOOLS.FONT.PRESERVE = false;
PINT_TOOLS.FONT.DISPLAY_ADVANCE = false;
PINT_TOOLS.FONT.DISPLAY_BASIC = false;

// GLOBAL DIV Functions
function PINT_SetGlobalFontDiv( globalDiv )	{ PINT_TOOLS.FONT.GLOBAL_DIV = globalDiv; }
function PINT_GetGlobalFontDiv() { return PINT_TOOLS.FONT.GLOBAL_DIV; }
function PINT_CheckGlobalFontDiv() { return PINT_GetGlobalFontDiv() == "" ? true: false;}

// GLOBAL FONT Preserve functions
function PINT_GetGlobalFontPreserveSession() {	return PINT_TOOLS.FONT.PRESERVE; }
function PINT_SetGlobalFontPreserveSession(setting) { PINT_TOOLS.FONT.PRESERVE = setting; }

// GLOBAL FONT Current Functions
function PINT_GetGlobalFontCurrentSession() { return PINT_TOOLS.FONT.CURRENT; }
function PINT_SetGlobalFontCurrentSession(setting) { PINT_TOOLS.FONT.CURRENT = setting; }

// GLOBAL FONT Display Advance
function PINT_SetGlobalFontDisplayAdvance(setting) { PINT_TOOLS.FONT.DISPLAY_ADVANCE = setting; }	
function PINT_GetGlobalFontDisplayAdvance() { return PINT_TOOLS.FONT.DISPLAY_ADVANCE; }

// GLOBAL FONT Display Basic
function PINT_SetGlobalFontDisplayBasic(setting){ PINT_TOOLS.FONT.DISPLAY_BASIC = setting;}
function PINT_GetGlobalFontDisplayBasic (){ return PINT_TOOLS.FONT.DISPLAY_BASIC; }		

function PINT_TextSizeChangerBasic()
	{
	if (!PINT_CheckGlobalFontDiv())
		{		
		var contentElement = document.getElementById(PINT_GetGlobalFontDiv());
		var increaseTrigger = document.getElementById("increaseFonta");
		var decreaseTrigger = document.getElementById("decreaseFonta");

		if (contentElement && increaseTrigger && decreaseTrigger)
			{
			increaseTrigger.onclick = PINT_IncreaseFontSize;
			decreaseTrigger.onclick = PINT_DecreaseFontSize;		

			if (PINT_GetGlobalFontCurrentSession() || PINT_GetGlobalFontPreserveSession())
				PINT_SetDefaultFontInformation(PINT_TOOLS.FONT.GLOBAL_DIV);
			}
		}
	}

function PINT_TextSizeChangerAdvance()
	{
	if (!PINT_CheckGlobalFontDiv())
		{		
		var contentElement = document.getElementById(PINT_GetGlobalFontDiv());
		var fontFamilyTrigger = document.getElementById("selectFontFamily");
		var fontSizeTrigger = document.getElementById("selectFontSize");

		if (contentElement && fontFamilyTrigger && fontSizeTrigger)
			{
			fontFamilyTrigger.onchange = PINT_SelectFontFamily;
			fontSizeTrigger.onchange = PINT_SelectFontSize;		
			
			if (PINT_GetGlobalFontCurrentSession() || PINT_GetGlobalFontPreserveSession())
				PINT_SetDefaultFontInformation(PINT_TOOLS.FONT.GLOBAL_DIV);
			}
		}
	}

function PINT_AbortSetFontToolsDisplay()
	{
	PINT_SetGlobalFontDisplayAdvance(false);
	PINT_SetGlobalFontDisplayBasic(false);
	}

function PINT_AllowForFontChanger()
	{
	var returnValue = true;
	if (document.styleSheets == "undefined") returnValue = false;
	if (!document.getElementById) returnValue = false;
	
	if (!returnValue)
		PINT_AbortSetFontToolsDisplay();
	
	return returnValue;
	}

function PINT_BuildCSSStructure() 
	{
	var cssRules;
	var styleInformation;
	if (document.all)
		cssRules = "rules";
	else if (document.getElementById) 
		cssRules = "cssRules";
		
	breakLoop = false;
	// Loop through each of the style Sheets
	for (styleSheetIndex = 0; styleSheetIndex < document.styleSheets.length; styleSheetIndex++)
		{
		// Loop Through Each of the Rules
		for (cssRulesIndex = 0; cssRulesIndex < document.styleSheets[styleSheetIndex][cssRules].length; cssRulesIndex++) 
			{
			className = document.styleSheets[styleSheetIndex][cssRules][cssRulesIndex].selectorText.toLowerCase();				
		
			/// Because the Browsers render the name differently
			if (className.indexOf("div." + PINT_GetGlobalFontDiv().toLowerCase()) != -1)
				{
				PINT_CSSStructure = document.styleSheets[styleSheetIndex][cssRules][cssRulesIndex];
				breakLoop = true;	
				break;
				}
			}
		if (breakLoop)
			break;
		}
	}
	
function PINT_GetCurrentFontInformation()
	{
	var fontInformation = new Object();
	fontInformation.useFontSize = false;
	fontInformation.useFontFamily = false;		
	
	// Get Font Size information
	if (PINT_CSSStructure.style.fontSize != "")
		{
		fontInformation.useFontSize = true;
		fontInformation.fontSize = new String(parseInt(PINT_CSSStructure.style.fontSize));
		fontInformation.fontType = PINT_CSSStructure.style.fontSize.substring(fontInformation.fontSize.length)
		fontInformation.fontSize = fontInformation.fontSize >= 5 ? parseInt(fontInformation.fontSize) : 5;
		}	

	// Check Font Family		
	if (PINT_CSSStructure.style.fontFamily != "")
		{
		fontInformation.useFontFamily = true;		
		fontInformation.fontFamily = PINT_CSSStructure.style.fontFamily;
		}
		
	return fontInformation;
	}
	
function PINT_DetermineChangePercentage()
	{
	if (PINT_DetermineChangePercentage.arguments.length != 1) return false;
	
	var sizeChange = PINT_DetermineChangePercentage.arguments[0];	
	var currentFontSize = null;
	var allowChangeFontSize = true;	
	var changePercentage = null;
	
	fontInformation  = PINT_GetCurrentFontInformation();
	if ( fontInformation.useFontSize ) 
		{
		newFontSize = fontInformation.fontSize + sizeChange;
		changePercentage = newFontSize/fontInformation.fontSize;
		}

	return changePercentage;
	}
	
function PINT_ChangeFontFamily() 
	{
	if ((PINT_ChangeFontFamily.arguments.length != 1)) return false;
	var fontFamily = PINT_ChangeFontFamily.arguments[0];	
	
	PINT_CSSStructure.style.fontFamily = fontFamily;
	
	if (PINT_GetGlobalFontPreserveSession() || PINT_GetGlobalFontCurrentSession()) document.cookie = "fontFamily=" + escape(fontFamily) + ";" + PINT_CreateCookieDate();
	else PINT_DeleteCookie("fontFamily", "fontSize");
	}
	
	
function PINT_ChangeFontSize() 
	{
	if ((PINT_ChangeFontSize.arguments.length != 1)) return false;
	var sizeChange = PINT_ChangeFontSize.arguments[0];	
	var fontSize;

	var changePercentage = PINT_DetermineChangePercentage(sizeChange);
	var fontInformation = PINT_GetCurrentFontInformation();

	if (fontInformation.useFontSize && changePercentage)
		{
		fontSize = fontInformation.fontSize * changePercentage;
		fontSize += fontInformation.fontType;
		PINT_CSSStructure.style.fontSize = fontSize;
		}

	if (PINT_GetGlobalFontPreserveSession() || PINT_GetGlobalFontCurrentSession()) document.cookie = "fontSize=" + escape(fontSize) + ";" + PINT_CreateCookieDate();
	else PINT_DeleteCookie("fontFamily", "fontSize");
	}

function PINT_IncreaseFontSize() 
	{
	if (PINT_CheckGlobalFontDiv()) return false;
	var contentElement = document.getElementById( PINT_GetGlobalFontDiv() );	

	
	if (contentElement)	PINT_ChangeFontSize(1);	
	else PINT_AbortSetFontToolsDisplay();	
	
	return false;
	}

function PINT_DecreaseFontSize() 
	{
	if (PINT_CheckGlobalFontDiv()) return false;
	var contentElement = document.getElementById( PINT_GetGlobalFontDiv() );	

	if (contentElement)	PINT_ChangeFontSize(-1);	
	else PINT_AbortSetFontToolsDisplay();
	
	return false;	
	}	
		

function PINT_ChangeFontSizeLoop()
	{
	if (PINT_ChangeFontSizeLoop.arguments.length != 1) return false;
	
	maxElements = PINT_ChangeFontSizeLoop.arguments[0];
	
	if (maxElements > 0)
		{
		for (fontSizeIndex = 0; fontSizeIndex < maxElements; fontSizeIndex++)
			{
			PINT_IncreaseFontSize();	
			}
		}
	else if (maxElements < 0)
		{
		for (fontSizeIndex = 0; fontSizeIndex > maxElements; fontSizeIndex--)
			{
			PINT_DecreaseFontSize();	
			}
		}
	}
	
function PINT_SelectFontSize()
	{
	if (PINT_CheckGlobalFontDiv()) return false;
	var contentElementName = PINT_GetGlobalFontDiv();
	var formElement = this;	
	var contentElement = document.getElementById(contentElementName);
	var newElementValue;

	for ( var formElementIndex = 0; formElementIndex < formElement.length; formElementIndex++)
		{
		if (formElement[formElementIndex].selected)
			{
			newElementValue = formElement[formElementIndex].value;
			break;
			}
		}
	if (newElementValue && contentElement)
		{
		fontInformation = PINT_GetCurrentFontInformation();
		if (fontInformation.useFontSize)
			{
			newElementValue = newElementValue - fontInformation.fontSize;
			PINT_ChangeFontSizeLoop(newElementValue);
			}
		else PINT_AbortSetFontToolsDisplay()
		}
	else PINT_AbortSetFontToolsDisplay();
	}

function PINT_SelectFontFamily()
	{
	if (PINT_CheckGlobalFontDiv()) return false;
	var contentElementName = PINT_GetGlobalFontDiv();
	var formElement = this;	
	var contentElement = document.getElementById(contentElementName);
	
	newFontFamily = "";
	for ( var formElementIndex = 0; formElementIndex < formElement.length; formElementIndex++)
		{
		if (formElement[formElementIndex].selected)
			{
			newFontFamily = formElement[formElementIndex].value;
			break;
			}
		}

	if(newFontFamily.length && contentElement )
		{
		PINT_ChangeFontFamily(newFontFamily);
		}
	}
	
function PINT_CreateCookieDate()
	{
	dateString = "";
	if (PINT_GetGlobalFontPreserveSession())
		{
		var expiration = new Date();
		expiration.setYear(expiration.getFullYear() + 2);
		dateString = " expires=" + expiration.toGMTString() + ";";
		}
	return dateString;
	}
	
function PINT_ExtractCookies()
	{
	var name, value;
	var beginning, middle, end;
	var currentCookies = new Object();
	
	beginning = 0;
	while (beginning < document.cookie.length)
		{
		middle = document.cookie.indexOf('=', beginning);
		end = document.cookie.indexOf(';',  beginning);
		
		if (end == -1)
			end = document.cookie.length;
		if ( (middle > end) || (middle == -1) )
			{
			name = document.cookie.substring(beginning, end);
			value = "";
			}
		else
			{
			name = document.cookie.substring(beginning, middle);
			value = document.cookie.substring(middle + 1, end);
			}	
		currentCookies[name] = unescape(value);
		beginning = end + 2;
		}
	return currentCookies;
	}	

function PINT_DeleteCookie()
	{
	if (!PINT_DeleteCookie.arguments.length) return false;
	
	for (var argumentIndex = 0; argumentIndex < PINT_DeleteCookie.arguments.length; argumentIndex++)
		{
		document.cookie = PINT_DeleteCookie.arguments[argumentIndex] + "=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT";
		document.cookie = PINT_DeleteCookie.arguments[argumentIndex] + "; expires=Thu, 01-Jan-1970 00:00:01 GMT";	
		}
	}
function PINT_SetDefaultFontInformation()
	{
	if (PINT_SetDefaultFontInformation.arguments.length != 1) return false

	if (PINT_GetGlobalFontPreserveSession() || PINT_GetGlobalFontCurrentSession())
		{
		var currentCookies = PINT_ExtractCookies();	
		var currentElement = document.getElementById(PINT_SetDefaultFontInformation.arguments[0]);
		
		if (currentElement && currentCookies)
			{
			if(typeof(currentCookies["fontSize"]) != "undefined") PINT_CSSStructure.style.fontSize = currentCookies["fontSize"];
			if(typeof(currentCookies["fontFamily"]) != "undefined") PINT_CSSStructure.style.fontFamily = currentCookies["fontFamily"].toLowerCase();
			}
		}
	}	

// END: PINT FONT CHANGER FUNCTIONS ============================================================================

// BEGIN: PINT FLASH DETECTION AND DISPLAY =====================================================================
FlashObject = function(swf, id, w, h, defaultImage, ver, imageMap, c) {
	this.swf = swf;
	this.id = id;
	this.width = w;
	this.height = h;
	this.imageMap = imageMap;
	this.version = ver || 6; // default to 6
	this.align = "middle"; // default to middle
	this.codebase = this.version +",0,0,0"; // fix cab download
	this.redirect = "";
	this.sq = document.location.search.split("?")[1] || "";
	this.defaultImage = defaultImage;
	this.altTxt = "Please <a href='http://www.macromedia.com/go/getflashplayer'>upgrade your Flash Player</a>.";
	this.bypassTxt = "";
	this.params = new Object();
	this.variables = new Object();
	if (c) this.color = this.addParam('bgcolor', c);
	this.addParam('quality', 'high'); // default to high
	this.doDetect = getQueryParamValue('detectflash');
}

FlashObject.prototype.addParam = function(name, value) {
	this.params[name] = value;
}

FlashObject.prototype.getParams = function() {
    return this.params;
}

FlashObject.prototype.getParam = function(name) {
    return this.params[name];
}

FlashObject.prototype.addVariable = function(name, value) {
	this.variables[name] = value;
}

FlashObject.prototype.getVariable = function(name) {
    return this.variables[name];
}

FlashObject.prototype.getVariables = function() {
    return this.variables;
}

FlashObject.prototype.getParamTags = function() {
    var paramTags = "";
    for (var param in this.getParams()) {
        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
    }
    if (paramTags == "") {
        paramTags = null;
    }
    return paramTags;
}

FlashObject.prototype.getHTML = function() {
    var flashHTML = "";
    if (window.ActiveXObject && navigator.userAgent.indexOf('Mac') == -1) { // PC IE
        flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ this.codebase +'" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';
        flashHTML += '<param name="movie" value="' + this.swf + '" />';
        if (this.getParamTags() != null) {
            flashHTML += this.getParamTags();
        }
        if (this.getVariablePairs() != null) {
            flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
        }
        flashHTML += '</object>';
    }
    else { // Everyone else
        flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
        for (var param in this.getParams()) {
            flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
        }
        if (this.getVariablePairs() != null) {
            flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
        }
        flashHTML += '></embed>';
    }
    return flashHTML;	
}


FlashObject.prototype.getVariablePairs = function() {
    var variablePairs = new Array();
    for (var name in this.getVariables()) {
        variablePairs.push(name + "=" + escape(this.getVariable(name)));
    }
    if (variablePairs.length > 0) {
        return variablePairs.join("&");
    }
    else {
        return null;
    }
}

FlashObject.prototype.write = function(elementId) {
	if(detectFlash(this.version) || this.doDetect=='false') 
		{
		if (elementId) 
			{
			document.getElementById(elementId).innerHTML = this.getHTML();
			}
		else 
			{
			document.write(this.getHTML());
			}
		} 
	else 
		{
		if (this.redirect != "") 
			{
			document.location.replace(this.redirect);
			}
		else if (this.defaultImage != "")
			{
			imageString = "<img src=\"" + this.defaultImage + "\" width=\"" + this.width + "\" height=\"" + this.height + "\" border=\"0\" alt=\"\"";
			if (this.imageMap != "")
				imageString += " usemap=\"#" + this.imageMap + "\" ";
			imageString += " />";

			document.write (imageString);
			}
		else
			document.write(this.altTxt +""+ this.bypassTxt);
	}		
}

function getFlashVersion() {
	var flashversion = 0;
	if (navigator.plugins && navigator.plugins.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if(x){
			if (x.description) {
				var y = x.description;
	   			flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
	} else {
		result = false;
	    for(var i = 15; i >= 3 && result != true; i--){
   			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
   			flashversion = i;
   		}
	}
	return flashversion;
}

function detectFlash(ver) {	
	if (getFlashVersion() >= ver) {
		return true;
	} else {
		return false;
	}
}

// get value of querystring param
function getQueryParamValue(param) {
	var q = document.location.search;
	var detectIndex = q.indexOf(param);
	if(q.length > 1 && detectIndex != -1) {
		return q.substring(q.indexOf("=", detectIndex)+1, q.indexOf("&", detectIndex));
	} else {
		return true;
	}
}
// END: PINT FLASH DETECTION AND DISPLAY =======================================================================


// BEGIN: PINT FROM VALIDATION ================================================================================
var PINT_FormsToValidate = new Array();
function PINT_SubmitFormValidatorHandler(e)
	{
	e = (e) ? e : ((window.event) ? window.event : "")
	if (e)
		{
		var eventsource = PINT_GetEventSource(e);
		if (eventsource)
			{
			return check_form(eventsource);
			}
		}		
	}

function PINT_ResetFormValidatorHandler(e)
	{
	e = (e) ? e : ((window.event) ? window.event : "")
	if (e)
		{
		var eventsource = PINT_GetEventSource(e);
		if (eventsource)
			{
			return confirm('Reset form fields?');
			}
		}		
	}	

// Loops through the FORM Validator Array looking to see if any forms need to be binded.
function PINT_FormValidator()
	{
	if ( document.getElementById && PINT_FormsToValidate.length )
		{
		var elementIndex, trigger, elementLength;

		for(var formNameIndex = 0; formNameIndex < PINT_FormsToValidate.length; formNameIndex++)
			{		
			trigger = document.getElementById( PINT_FormsToValidate[formNameIndex] );
			if (trigger)
				{
				trigger.onsubmit = PINT_SubmitFormValidatorHandler;
				trigger.onreset = PINT_ResetFormValidatorHandler
				}
			}
		}
	}

// Call this function on any page you would like to have a form validation on using form check.
function PINT_SetFormsToValidate()
	{
	if (!PINT_SetFormsToValidate.arguments.length) return false;
	
	for(var argumentIndex = 0; argumentIndex < PINT_SetFormsToValidate.arguments.length; argumentIndex++)
		{
		PINT_FormsToValidate[PINT_FormsToValidate.length] = PINT_SetFormsToValidate.arguments[argumentIndex];
		}
	}


// END: PINT FROM VALIDATION =================================================================================

function PINT_ToggleElementsOnOff(show,elList,toggleBy)
	{
	CALANDAR_DOM = (document.getElementById) ? true : false;
	CALANDAR_NS4 = (document.layers) ? true : false;
	CALANDAR_IE = (document.all) ? true : false;
	CALANDAR_IE4 = CALANDAR_IE && !CALANDAR_DOM;
	CALANDAR_IE4M = CALANDAR_IE4 && HM_Mac;	

	if(CALANDAR_NS4&&(toggleBy=="tag"))return true;
	
	for(var i=0;i<elList.length;i++)
		{
		var ElementsToToggle=[];
		switch(toggleBy)
			{
			case "tag":
				ElementsToToggle=(CALANDAR_DOM)?document.getElementsByTagName(elList[i]):document.all.tags(elList[i]);
				break;
			case "id":
				ElementsToToggle[0]=(CALANDAR_DOM)?document.getElementById(elList[i]):(CALANDAR_IE)?document.all(elList[i]):document.layers[elList[i]];
				break;
			}
			
		for(var j=0;j<ElementsToToggle.length;j++)
			{
			var theElement=ElementsToToggle[j];
			if(!theElement)continue;

			if(CALANDAR_DOM||CALANDAR_IE)
				theElement.style.visibility=show?"inherit":"hidden";
			else if(CALANDAR_NS4)
				theElement.visibility=show?"inherit":"hide";
			}
		}
	return true;
	}	

// BEGIN: PINT Nice Titles =================================================================================	
var XHTMLNS = "http://www.w3.org/1999/xhtml";
var PINT_Browser = new Browser();
var PINT_NiceTitleStruct = new Object();

function PINT_MakeNiceTitles() {
	if (!document.createElement || !document.getElementsByTagName) return;
    // add namespace methods to HTML DOM; this makes the script work in both
    // HTML and XML contexts.
    if(!document.createElementNS)
    {
        document.createElementNS = function(ns,elt) {
            return document.createElement(elt);
        }
    }

	// Makes sure Proper elements are passed into the function and sets default values	
	if (PINT_MakeNiceTitles.arguments.length != 2 && PINT_MakeNiceTitles.arguments.length != 4) return false;
	PINT_NiceTitleStruct.divClassName = PINT_MakeNiceTitles.arguments[0];
	PINT_NiceTitleStruct.pClassName = PINT_MakeNiceTitles.arguments[1];		
	PINT_NiceTitleStruct.currentTitle;

	if (PINT_MakeNiceTitles.arguments.length == 4) 
		{
		PINT_NiceTitleStruct.x = parseInt(PINT_MakeNiceTitles.arguments[2]);
		PINT_NiceTitleStruct.y = parseInt(PINT_MakeNiceTitles.arguments[3]);		
		}
		
	if (isNaN(PINT_NiceTitleStruct.x) || isNaN(PINT_NiceTitleStruct.y))
		{
		PINT_NiceTitleStruct.x = 15;
		PINT_NiceTitleStruct.y = 35;				
		}	

    if( !document.links )
    {
        document.links = document.getElementsByTagName("a");
    }
    for (var ti=0;ti<document.links.length;ti++) {
        var lnk = document.links[ti];
        if (lnk.title) {
            lnk.setAttribute("nicetitle",lnk.title);
            lnk.removeAttribute("title");
            addEvent(lnk,"mouseover",showNiceTitle);
            addEvent(lnk,"mouseout",hideNiceTitle);
            addEvent(lnk,"focus",showNiceTitle);
            addEvent(lnk,"blur",hideNiceTitle);
        }
    }
    var instags = document.getElementsByTagName("ins");
    if (instags) {
    for (var ti=0;ti<instags.length;ti++) {
        var instag = instags[ti];
        if (instag.dateTime) {
            var strDate = instag.dateTime;
            var dtIns = new Date(strDate.substring(0,4),parseInt(strDate.substring(4,6)-1),strDate.substring(6,8),strDate.substring(9,11),strDate.substring(11,13),strDate.substring(13,15));
            instag.setAttribute("nicetitle","Added on "+dtIns.toString());
            addEvent(instag,"mouseover",showNiceTitle);
            addEvent(instag,"mouseout",hideNiceTitle);
            addEvent(instag,"focus",showNiceTitle);
            addEvent(instag,"blur",hideNiceTitle);
        }
    }
    }
}

function findPosition( oLink ) {
  if( oLink.offsetParent ) {
    for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) {
      posX += oLink.offsetLeft;
      posY += oLink.offsetTop;
    }
    return [ posX, posY ];
  } else {
    return [ oLink.x, oLink.y ];
  }
}

function showNiceTitle(e) {
    if (PINT_NiceTitleStruct.currentTitle) hideNiceTitle(PINT_NiceTitleStruct.currentTitle);
    if (!document.getElementsByTagName) return;
    if (window.event && window.event.srcElement) {
        lnk = window.event.srcElement
    } else if (e && e.target) {
        lnk = e.target
    }
    if (!lnk) return;
    if (lnk.nodeType == 3) {
        // lnk is a textnode -- ascend parents until we hit a link
        lnk = getParent(lnk,"A");
    }
    if (!lnk) return;
    nicetitle = lnk.getAttribute("nicetitle");
    
    var d = document.createElementNS(XHTMLNS,"div");
    d.className = PINT_NiceTitleStruct.divClassName;
    tnt = document.createTextNode(nicetitle);
    pat = document.createElementNS(XHTMLNS,"p");
    pat.className = "titletext";
    pat.appendChild(tnt);
    d.appendChild(pat);
    if (lnk.href) {
        tnd = document.createTextNode(lnk.href);
        pad = document.createElementNS(XHTMLNS,"p");
        pad.className = PINT_NiceTitleStruct.pClassName;
        pad.appendChild(tnd);
        d.appendChild(pad);
    }
    
    STD_WIDTH = 300;
    if (lnk.href) {
        h = lnk.href.length;
    } else { h = nicetitle.length; }
    if (nicetitle.length) {
      t = nicetitle.length;
    }
    h_pixels = h*6; t_pixels = t*10;
    
    if (h_pixels > STD_WIDTH) {
        w = h_pixels;
    } else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels)) {
        w = t_pixels;
    } else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels)) {
        w = h_pixels;
    } else {
        w = STD_WIDTH;
    }
        
    d.style.width = w + 'px';    

    /*
    mx = lnk.offsetLeft;
    my = lnk.offsetTop;
    */
    mpos = findPosition(lnk);
    mx = mpos[0];
    my = mpos[1];
    //xy = getMousePosition(e);
    //mx = xy[0]; my = xy[1];
    
//    d.style.left = (mx+15) + 'px';
//    d.style.top = (my+35) + 'px';
    d.style.left = (mx+PINT_NiceTitleStruct.x) + 'px';
    d.style.top = (my+PINT_NiceTitleStruct.y) + 'px';

    if (window.innerWidth && ((mx+w) > window.innerWidth)) {
        d.style.left = (window.innerWidth - w - 25) + "px";
    }
    if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth)) {
        d.style.left = (document.body.scrollWidth - w - 25) + "px";
    }
	
    document.getElementsByTagName("body")[0].appendChild(d);
   	PINT_ToggleElementsOnOff(false,['select'],'tag');

    PINT_NiceTitleStruct.currentTitle = d;
}

function hideNiceTitle(e) {
    if (!document.getElementsByTagName) return;
    if (PINT_NiceTitleStruct.currentTitle) {
        document.getElementsByTagName("body")[0].removeChild(PINT_NiceTitleStruct.currentTitle);
        PINT_NiceTitleStruct.currentTitle = null;
    }
	PINT_ToggleElementsOnOff(true,['select'],'tag');				
}

// Add an eventListener to browsers that can do it somehow.
// Originally by the amazing Scott Andrew.
function addEvent(obj, evType, fn){
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, true);
    return true;
  } else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
    return r;
  } else {
	return false;
  }
}

function getParent(el, pTagName) {
	if (el == null) return null;
	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())	// Gecko bug, supposed to be uppercase
		return el;
	else
		return getParent(el.parentNode, pTagName);
}

function getMousePosition(event) {
  if (PINT_Browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (PINT_Browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }
  return [x,y];
}

// Determine browser and version.

function Browser() {
// blah, browser detect, but mouse-position stuff doesn't work any other way
  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}
// END: PINT Nice Titles ===================================================================================	
	
function PINT_BrowserDetection() 
	{ 
	if (PINT_BrowserDetection.arguments.length != 1) return false;
	var browserUpgradeFile = PINT_BrowserDetection.arguments[0];
	var currentFileName = PINT_GetCurrentFileName();
	
	if (!document.getElementById && ( browserUpgradeFile.indexOf(currentFileName) == "-1" || currentFileName == "")) window.location.replace(PINT_GetRootDirectory() + '/' + browserUpgradeFile);
	}
	
function imgroll(element, imgpath) {
  element.src = imgpath;
}