/* GLOBAL_PKG INCLUDES:
 * global.js (12)
 * sniffLib-100.js (458)
 * author: Christian Bonham
 * dropdownLib-100.js (939)
 * milonic_src.js (1191) 
 * lc.js (1720) 
 * controlFocus.js (1846)
 */

/****************************************************
 *  Writes and supports global javascript functions
 *  global.js
 *  $Revision: 1.1.2.4 $
 *******************************************************/
// refresh the page on resize in netscape
function handleResize(){
  if (window.innerWidth != origWidth || window.innerHeight != origHeight) {
    location.href = location.href;
    return false;
  }
}

if (document.layers){
  origWidth = window.innerWidth;
  origHeight = window.innerHeight;
  window.captureEvents(Event.RESIZE);
  window.onresize = handleResize;
}

// Window Opening / Closing Funcitons 
function openChildWindow( appurl, windowname ) {
  var appwindow = window.open( appurl , windowname, "toolbar=yes,status=yes,top=25,left=0,outerWidth=798,outerHeight=547,width=798,height=547,scrollbars=yes,resizable=yes,menubar=yes,locationbar=no,");
  if (appwindow) appwindow.focus();
}

function global_openCdcPopup ( url, width, height ) {
  if ( isNaN(parseInt(width)) ) { width=550; } 
  else { width=parseInt(width); }
  if ( isNaN(parseInt(height)) ) {height=550; }
  else { height=parseInt(height); }
  var windowparms = "status=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height;
  var popup = window.open ( url, "globalCDCpopup", windowparms);
  if (popup) popup.focus();
}

// This function openLargePopup is now deprecated. Please don't use.
function openLargePopup( url, windowname ) {
  var popup = window.open( url , windowname, "toolbar=yes,status=yes,scrollbars=yes,menubar=yes,locationbar=no,top=50,left=70,outerWidth=643,outerHeight=468,width=643,height=468,resizable=yes");
  if (popup) popup.focus();
}

// This function openMediumPopup is now deprecated. Please don't use.
function openMediumPopup( url, windowname ) {
  var popup = window.open( url , windowname, "toolbar=no,status=yes,scrollbars=yes,menubar=no,locationbar=no,top=90,left=170,outerWidth=445,outerHeight=390,width=445,height=390,resizable=yes");
  if (popup) popup.focus();
}

// This function openSmallPopup is now deprecated. Please don't use.
function openSmallPopup( url, windowname ) {
  var popup = window.open( url , windowname, "toolbar=no,status=yes,scrollbars=yes,menubar=no,locationbar=no,top=90,left=290,outerWidth=220,outerHeight=390,width=220,height=390,resizable=yes"); 
  if (popup) popup.focus();
}

function closeWindow() { self.close(); }

function changeParentUrl( newurl ) {
  var openerClosed = false;
  if( document.all && !document.getElementById() ) {
    // opener.closed always returns false in IE ... makes sense, right?
    // let's roll our own function in VB, where we can trap errors...
    openerClosed = isOpenerClosed();
  } else {
    if( top.opener ) {
      openerClosed = top.opener.closed;
    } else {
      openerClosed = true;
    }
  }
  if( openerClosed ) {
    var newwin = window.open( newurl);
    newwin.focus();
  } else {
    top.opener.location.href = newurl;
    top.opener.focus(); 
  }
}

// Creates a browser-generated alert or message box
// note: this was abstracted just in case we ever want to do anything with the string or send to non-pcs devices
function openMessage(str) { alert(str); }

// Grabs a parameter from the URL.  Returns an empty string if parameter does not exist.
function getParameter(param) {
        var val = "";
        var qs = window.location.search;
        var start = qs.indexOf(param);
        if (start != -1) {
                start += param.length + 1;
                var end = qs.indexOf("&", start);
                if (end == -1) {
                        end = qs.length
                }
                val = qs.substring(start,end);
        }
        return val;
}

// Get the BaseTag, if specified in the current page
function get_baseTag() {
	var baseTag = "";
	if ( document.all ) {	
		var baseTagsCol = document.all.tags("BASE");
		if (baseTagsCol.length!=0){
			baseTag = baseTagsCol[0].href;
		}
	} else if (window.opera) {
		var baseTag
		if (document.getElementById('basehref')){
			baseTag = document.getElementById('basehref').href;
			baseTag = baseTag.substring(0, baseTag.length-1);
		}
	}
	return baseTag;
}

// Drop-down location.href redirection
function dropdown_redirect(select_name,reset) {
	if (reset == null) { reset = true };
	var theselect=eval(select_name);
	var tmp=theselect.selectedIndex;
	if (reset) { theselect.options[0].selected=true; }
	if(theselect.options[tmp].value != "") {
		location.href=get_baseTag()+theselect.options[tmp].value;
	}
}

// Area drop-down redirection
var areanav_current = 0;
function set_areanav_current( index ) {
	// xsl position starts at 1, array index starts at 0
	areanav_current = index-1;
}

function areanav_redirect(select_name) {	
  var theselect=eval(select_name);
  var tmp=theselect.selectedIndex;
  if(theselect.options[tmp].value != "") {
	 theselect.options[areanav_current].selected=true;
	 location.href=get_baseTag()+theselect.options[tmp].value;
  }
}

// functions used to register functions that execute on the global onClick event
var globalBodyOnClickList = new Array();

//function called to add a handler to the event
function addToBodyOnClick(funct){
    //assign the wrapper function to the event this blows away any traditionally assigned handlers
    document.onclick = bodyOnClick;
    //add the function to the array
    globalBodyOnClickList[globalBodyOnClickList.length] = funct;
}

//function that gets called by the body's onClick event
function bodyOnClick(){	
    for (var i=0;i<globalBodyOnClickList.length;i++){
        //do each of the functions in the array
        globalBodyOnClickList[i]();
    }
}

/* function used to register functions that execute on the global onLoad event
 * Revised Dec 2005 /gs 
 * Please note: this function is currently supported only for the homepage use with Visual Sciences.  If it is used on any other pages, please be aware that if there is an onload attribute in the body tag this function will not work.
 */
function addToWindowOnLoad(funct){
    var oldOnload = window.onload;
    //alert(oldOnload);
    if (typeof window.onload != 'function') {
    window.onload = funct;
    } else {
    window.onload = function() {
    oldOnload();
    funct();
    }
  }
}




/***************************************************************
sniffLib-100.js
* Browser Detection / Client Sniffing Library - v1.0.0
* (c) Cisco Systems, All Rights Reserved.
* Public Function API Definition:
* function								params 		return values
* ---------------------------------------------------------------
* The following functions will return the true 
* categorization of the client.
* ---------------------------------------------------------------
* sniffIsIE() 							none		true | false
* sniffIsNS70()  						none		true | false
* sniffIsMozilla() 						none		true | false
* sniffIsUnix()  						none		true | false
* sniffIsUnixMozilla()					none		true | false
* sniffIsUnix70()  						none		true | false
* sniffIsWin()  						none		true | false
* sniffIsMac()  						none		true | false
*
* The following functions will return the nature
* of the browser categorization with respect to 
* the Cisco browser support model.
* There are two primary considerations: 
* formatting, and functionality.
* For example:
* IE = fully functional, reference formatting
* IE (no-script) = reference degrade => (default no-script behavior, ie only css)
* NS70 = degrade functional, NS70 degrade formatting
* NS70 (no-script) = reference degrade
* Mozilla = fully functional, Mozilla degrade formatting
* Mozilla (no-script) = reference degrade
* NS6 = degrade functional, degrade formatting if script, reference degrade if not script
* Safari = degrade functional, degrade formatting if script, reference degrade if not script (same as Mozilla)
* ---------------------------------------------------------------
* To determine the functionality model for the client.
* ----------------------
* sniffIsFunctFull() 					none		true | false
* sniffIsFunctDegrade() 				none		true | false
* 
* To determine the formatting model for the client.
* ----------------------
* sniffIsFormatDefault() 				none		true | false
* sniffIsFormatMozilla() 				none		true | false
* sniffIsFormatNS70() 					none		true | false
* sniffIsFormatUnix() 					none		true | false
* sniffIsFormatUnix70() 				none		true | false
* sniffIsFormatUnixMozilla() 			none		true | false
*
* The following function will include (by <link...> 
* a passed in CSS URL as it applies to the Cisco 
* browser support model
* ---------------------------------------------------------------
* sniffIncCSSForNS70(sURL) 				(URL-path)	true | false
* sniffIncCSSForMozilla(sURL) 			(URL-path)	true | false
* sniffIncCSSForUnix(sURL) 				(URL-path)	true | false
* sniffIncCSSForDefault(sURL)			(URL-path)	true | false
****************************************************************/
/* Debugging functions, setting bDebug to true will spawn an alert with debugging info. */
function debug(debugStr, str) {
	debugStr = debugStr + str + '\n';
	return debugStr;
}
function sniffDebugClear(debugStr) {
	debugStr = '';
}
function sniffDebugAlert(str, bDebug) {
	if (bDebug) {
		alert(str);
	}
} 
var sniffDebugFlag = false;
var sniffDebugStr = '';
function sniffToAlert() {
	sniffDebugStr = debug(sniffDebugStr, 'Object Browser:');
	sniffDebugStr = debug(sniffDebugStr, 'Browser.name: ' + Browser.name );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.version: ' + Browser.version );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.os: ' + Browser.os );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.useragent: ' + Browser.useragent );
	sniffDebugStr = debug(sniffDebugStr, '----------------------');
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isIE: ' + Browser.isIE );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isMozilla: ' + Browser.isMozilla );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isNS70: ' + Browser.isNS70 );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isNS6: ' + Browser.isNS6 );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isNSOld: ' + Browser.isNSOld );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isSafari: ' + Browser.isSafari );
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isUnix: ' + Browser.isUnix);
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isWin: ' + Browser.isWin);
	sniffDebugStr = debug(sniffDebugStr, 'Browser.isMac: ' + Browser.isMac);
	sniffDebugStr = debug(sniffDebugStr, '----------------------');
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsIE(): ' + sniffIsIE());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsMozilla(): ' + sniffIsMozilla());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsNS70(): ' + sniffIsNS70());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsSafari(): ' + sniffIsSafari());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsUnix(): ' + sniffIsUnix());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsUnixMozilla(): ' + sniffIsUnixMozilla());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsUnix70(): ' + sniffIsUnix70());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsWin(): ' + sniffIsWin());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsMac(): ' + sniffIsMac());
	sniffDebugStr = debug(sniffDebugStr, '----------------------');
	sniffDebugStr = debug(sniffDebugStr, 'Functional model');
	sniffDebugStr = debug(sniffDebugStr, '----------------------');
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFunctFull(): ' + sniffIsFunctFull());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFunctDegrade(): ' + sniffIsFunctDegrade());
	sniffDebugStr = debug(sniffDebugStr, '----------------------');
	sniffDebugStr = debug(sniffDebugStr, 'Format model');
	sniffDebugStr = debug(sniffDebugStr, '----------------------');
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFormatDefault(): ' + sniffIsFormatDefault());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFormatMozilla(): ' + sniffIsFormatMozilla());
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFormatNS70(): ' + sniffIsFormatNS70());	
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFormatUnix(): ' + sniffIsFormatUnix());	
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFormatUnix70(): ' + sniffIsFormatUnix70());	
	sniffDebugStr = debug(sniffDebugStr, 'sniffIsFormatUnixMozilla(): ' + sniffIsFormatUnixMozilla());	
	sniffDebugAlert(sniffDebugStr, sniffDebugFlag);
	sniffDebugClear(sniffDebugStr);
}
	
// Set up some definitions.
// The following are the arrays that are compared against the appName.
var Wins = 	new Array("Win32");
var Unixes = new Array("SunOS", "HP", "Linux"); 
var Macs = 	new Array("MacPPC","Intel");
var Geckos = new Array("Netscape");

/* arrays used for gleening the netscape version
 * from the user-agent http field based on the
 * gecko codebase version. 
 *
 * Currently, Array: NS71s is not being used, but has been left 
 * for future use, and enumeration here.
 * Functionality for NS71 detection now relies on parsing
 * the gecko revision out of the user-agent, and comparing
 * against what we consider to be the baseline 7.1 revision.
 * This is currently defined as Mozilla 1.3 on Sun, which is the
 * first browser I have found to support what we need it to. 
 * This type of implementation will allow future versions of 
 * Netscape/Mozilla to be assumed to function full featured. */
var MozillaBaseGecko = 20030329;
var MozillaBaseSafari = 85;
var Mozillas = new Array(	"Gecko/20031007",  	// Mozilla 1.5
							"Gecko/20040113",  	// Mozilla 1.6
							"Gecko/20030329", 	// Mozilla 1.3 (Sun)
							"Gecko/20030624"); 	// Netscape 7.1
var NS70s = new Array(	"Gecko/20020823", 	// Netscape 7.0		
						"Gecko/20030208", 	// Netscape 7.0.2 
						"Gecko/20020921",	// Netscape 7.0 (Sun)
						"Gecko/20020920");	// Netscape 7.0 (Sun)
var NS6s = new Array(	"Gecko/20020508", 	// Netscape 6.2.3
						"Gecko/20020314",	// Netscpae 6.2.2
						"Gecko/20011128", 	// Netscape 6.2.1
						"Gecko/20010726" );	// Netscape 6.1
var Safaris = new Array("Safari/85",
						"Safari/100");		// Safari 1.0
var IEs = new Array("Microsoft Internet Explorer");

var Browser = new Object;
// Set up some fundamentals.
Browser.name = navigator.appName;
Browser.version = navigator.appVersion;
Browser.os = navigator.platform;
Browser.useragent = navigator.userAgent;
// platform browser bools
Browser.isIE = false;
Browser.isNS70 = false;
Browser.isMozilla = false;
Browser.isNS6 = false;
Browser.isNSOld = false;
Browser.isSafari = false;

// platform bools
Browser.isUnix = false;
Browser.isWin = false;
Browser.isMac = false;
	
/******************************************************************************
 * Private API functions
 *****************************************************************************/
function sniffCatchUnix() {
   var unixAppNameFlag = false;
   var unixPlatformFlag = false;
   for (var i=0; i < Unixes.length; i++) {
    	if (Browser.version.indexOf(Unixes[i]) != -1) {
		    unixAppNameflag=true;
		    break;
    	}
    } 
    for (var i=0; i < Unixes.length; i++) {
    	if (Browser.os.indexOf(Unixes[i]) != -1) {
		    unixPlatformFlag=true;
		    break;
    	}
    }
    return (unixPlatformFlag || unixAppNameFlag);
}

function sniffCatchWin() {
	var flag = false;
	for (var i=0; i < Wins.length; i++) {
    	if (Browser.os.indexOf(Wins[i]) != -1) {
		    flag=true;
		    break;
    	}
    } 
    return (flag);
}

function sniffCatchMac() {
	var flag = false;
	for (var i=0; i < Macs.length; i++) {
    	if (Browser.os.indexOf(Macs[i]) != -1) {
		    flag=true;
		    break;
    	}
    } 
    return (flag);
}

function sniffCatchGecko() {
	var nsFlag = false;
	for (var i=0; i < Geckos.length; i++) {
    	if (Browser.name.indexOf(Geckos[i]) != -1) {
		    nsFlag=true;
		    break;
    	}
    } 
    return (nsFlag);
}

function sniffCatchNS70() {
	var flag = false;
	for (var i=0; i < NS70s.length; i++) {
		if (Browser.useragent.indexOf(NS70s[i]) != -1) {
		    flag=true;
		    break;
		}
	}
    return (flag);
}

function sniffCatchMozilla() {
	var rev = -1;
	var flag = false;
	rev = sniffParseGeckoRev();
	if (rev > 0) {
		sniffDebugStr = debug(sniffDebugStr, '-> Gecko Rev = ' + rev);
		sniffDebugStr = debug(sniffDebugStr, '-> Base Mozilla Rev: ' + MozillaBaseGecko);
		if (rev >= MozillaBaseGecko) {
			flag = true;
		}
	}
    return (flag);
}

function sniffCatchSafari() {
	var rev = -1;
	var flag = false;
	rev = sniffParseSafariRev();
	if (rev > 0) {
		sniffDebugStr = debug(sniffDebugStr, '-> Safari Rev = ' + rev);
		sniffDebugStr = debug(sniffDebugStr, '-> Base Mozilla Rev: ' + MozillaBaseSafari);
		if (rev >= MozillaBaseSafari) {
			flag = true;
		}
	}
    return (flag);
}

function sniffCatchNS6() {
	var flag = false;
	for (var i=0; i < NS6s.length; i++) {
		if (Browser.useragent.indexOf(NS6s[i]) != -1) {
		    flag=true;
		    break;
		}
	}
    return (flag);
}

function sniffParseGeckoRev() {
	var sGecko = new String('Gecko/');
	var rev = -1;
	var pos = 0;
	pos = Browser.useragent.indexOf(sGecko) 
	if (pos != -1) {
		rev = Browser.useragent.substr( (pos + sGecko.length), (Browser.useragent.length - pos) );
		rev = parseInt(rev);
	} 
	return rev;
}

function sniffParseSafariRev() {
	var sSafari = new String('Safari/');
	var rev = -1;
	var pos = 0;
	pos = Browser.useragent.indexOf(sSafari) 
	if (pos != -1) {
		rev = Browser.useragent.substr( (pos + sSafari.length), (Browser.useragent.length - pos) );
		rev = parseInt(rev);
	} 
	return rev;
}

function sniffCatchIE() {
	var ieFlag = false;
	for (var i=0; i < IEs.length; i++) {
    	if (Browser.name.indexOf(IEs[i]) != -1) {
		    ieFlag=true;
		    break;
    	}
    } 
    return (ieFlag);
}

function sniffOS() {
	// Try and determine OS
	Browser.isUnix = false;
	Browser.isWin = false;
	Browser.isMac = false;
	
	if (sniffCatchUnix()) {
		Browser.isUnix = true;
	} else if (sniffCatchWin()) {
		Browser.isWin = true;
	} else if (sniffCatchMac()) {
		Browser.isMac = true;
	}	
	return true;
}

function sniffBrowser() {
	// Try and determine client/browser
	Browser.isNS70 = false;
	Browser.isNS71 = false;
	Browser.isNS6 = false;
	Browser.isNSOld = false;
	Browser.isSafari = false;
	Browser.isIE = false;
	if (sniffCatchGecko()) {
		sniffDebugStr = debug(sniffDebugStr, 'Caught Netscape');
		if (sniffCatchMozilla()) {
			Browser.isMozilla = true;
			sniffDebugStr = debug(sniffDebugStr, '-> Caught Mozilla');
		} else if (sniffCatchNS70()) {
			Browser.isNS70 = true;
			sniffDebugStr = debug(sniffDebugStr, '-> Caught 7.0');
		} else if (sniffCatchNS6()) {
			Browser.isNS6 = true;
			sniffDebugStr = debug(sniffDebugStr, '-> Caught 6');
		} else if (sniffCatchSafari()) {
			Browser.isSafari = true;
			sniffDebugStr = debug(sniffDebugStr, '-> Caught Safari');
		} else {
			Browser.isNSOld = true;
		} 
	} else if (sniffCatchIE()) {
		Browser.isIE = true;
	} 
	return true;
}

function Sniff() {
	if (sniffOS()) {
		sniffDebugStr = debug(sniffDebugStr, 'Caught platform/OS');
	} else {
		sniffDebugStr = debug(sniffDebugStr, 'Failed to detect platform/OS');
	}
	
	if (sniffBrowser()) {
		sniffDebugStr = debug(sniffDebugStr, 'Caught client/browser');
	} else {
		sniffDebugStr = debug(sniffDebugStr, 'Failed to detect client/browser');
	}
}

/*****************************************************************************
* Public API calls
* These are to determine the real properties of the client. 
*****************************************************************************/
function sniffIsIE() { return Browser.isIE; }
function sniffIsNS6() { return Browser.isNS6; }
function sniffIsNS70() { return Browser.isNS70; }
function sniffIsMozilla() { return Browser.isMozilla; }
function sniffIsUnix() { return Browser.isUnix; }

function sniffIsUnixMozilla() {
	return (sniffIsMozilla() && sniffIsUnix());
}

function sniffIsUnix70() {
	return (sniffIsNS70() && sniffIsUnix());
}
function sniffIsWin() {	return Browser.isWin; }
function sniffIsMac() { return Browser.isMac; }
function sniffIsSafari() { return Browser.isSafari; }

/******************************************************************************
 * The following API functions translate browser info into support model CSS && Functionality Reqs
 *****************************************************************************/
// To determine the functionality model for the client.
// Will assert false if sniffIsMac() is true - mac is not supported
function sniffIsFunctFull() {
  if (!sniffIsMac()) {
    return ( sniffIsIE() || sniffIsMozilla() );
  }
} 

function sniffIsFunctDegrade() {
	return ( !sniffIsFunctFull() );
}
 
// To determine the formatting model for the client.
function sniffIsFormatDefault() {
	return sniffIsIE();
}

function sniffIsFormatNS70() {
	if ( sniffIsNS70() && !sniffIsUnix() ) {
		return true;
	}
	return false;
}

function sniffIsFormatMozilla() {
	if (sniffIsMozilla() && !sniffIsUnix() ) {
		return true;
	}
	return false;
}

function sniffIsFormatUnix() { return sniffIsUnix(); }
function sniffIsFormatUnix70() { return sniffIsUnix70(); }
function sniffIsFormatUnixMozilla() { return sniffIsUnixMozilla(); }

// To include css files based on the formatting/degrade model.
function sniffIncCSSForNS70(sURL) {
	debug(sniffDebugStr, 'NS Url: ' + sURL);
	if (sURL) {
		// only include if it's not a unix platform.
		if (sniffIsFormatNS70()) {
			document.write ('<link rel="Stylesheet" href="' + sURL + '" type="text/css">');
			return (true);
		} 
	}
	return (false);
}

// To include css files based on the support model.
function sniffIncCSSForMozilla(sURL) {
	debug(sniffDebugStr, 'NS Url: ' + sURL);
	if (sURL) {
		// only include if it's not a unix platform.
		if (sniffIsFormatMozilla()) {
			document.write ('<link rel="Stylesheet" href="' + sURL + '" type="text/css">');
			return (true);
		} 
	}
	return (false);
}

function sniffIncCSSForUnix(sURL) {
	debug(sniffDebugStr, 'Unix Url: ' + sURL);
	if (sURL) {
		if (sniffIsFormatUnix()) {
			document.write ('<link rel="Stylesheet" href="' + sURL + '" type="text/css">');
			return (true);
		}
	}
	return (false);
}

function sniffIncCSSForDefault(sURL) {
	debug(sniffDebugStr, 'Default Url: ' + sURL);
	if (sURL) {
		document.write ('<link rel="Stylesheet" href="' + sURL + '" type="text/css">');
		return (true);
	}
	return (false);
}
Sniff();
sniffToAlert();


/***************************************************************
dropdownLib-100.js
* DirectAccess Pulldown Library - v0.9.9
* author: Christian Bonham
* (c) Cisco Systems, All Rights Reserved.
****************************************************************/
var currDropdowns = new Array();
var currId =0;
var autoOpenDropTimer=0;
var closeDropTimer=0; 		//currently not using any timed auto-closing

var dropdownDontClose = false; 	//use for handling events from the document.onclick
addToBodyOnClick(dropdownDocOnClick);
//addToFlyoutToggle(dropdownCloseAll);

/* Debugging functions, setting bDebug to true will spawn an alert
 * with debugging info. */
var dropdownDebugStr = '';
/* Debugging functions, setting bDebug to true will spawn an alert
 * with debugging info. */
function debug(debugStr, str) {
	debugStr = debugStr + str + '\n';
	return debugStr;
}
function debugClear(debugStr) {
	debugStr = '';
}
function debugAlert(str, bDebug) {
	if (bDebug) {
		alert(str);
	}
} 
function EventDebug(e) {
	dropdownDebugStr = debug (dropdownDebugStr, 'Event Info:');
	dropdownDebugStr = debug (dropdownDebugStr, 'clientX: ' + e.clientX);
	dropdownDebugStr = debug (dropdownDebugStr, 'clientY: ' + e.clientY);
	dropdownDebugStr = debug (dropdownDebugStr, 'layerX: ' + e.layerX);
	dropdownDebugStr = debug (dropdownDebugStr, 'layerY: ' + e.layerY);
	dropdownDebugStr = debug (dropdownDebugStr, 'pageX: ' + e.pageX);
	dropdownDebugStr = debug (dropdownDebugStr, 'pageY: ' + e.pageY);
	dropdownDebugStr = debug (dropdownDebugStr, 'screenX: ' + e.screenX);
	dropdownDebugStr = debug (dropdownDebugStr, 'screenY: ' + e.screenY);
	dropdownDebugStr = debug (dropdownDebugStr, 'offsetX: ' + e.offsetX);
	dropdownDebugStr = debug (dropdownDebugStr, 'offsetY: ' + e.offsetY);
	dropdownDebugStr = debug (dropdownDebugStr, 'x: ' + e.x);
	dropdownDebugStr = debug (dropdownDebugStr, 'y: ' + e.y);
}

/* switches between showing & hiding */
function dropdownToggle(dropdown,id,event){
	//alert('ddtoggle' + dropdownDontClose);
	clearTimeout(autoOpenDropTimer);
	dropdownCloseAllOther(id);
	
	//prompEle = the <a> tag
	promptEle = dropdown;
	//
	dropdown = dropdown.parentNode;
	
	// Get IDs
	parentID = dropdown.id;
	childID = dropdown.id + '-list';
	arrowID = dropdown.id + '-arrow';
	dropdownDebugStr = debug(dropdownDebugStr, 'parentID: ' + parentID + ', childID:' + childID);
		
	// set up pointers.
	if (document.all) {
		ele = document.all[parentID];
		pd = document.all[childID];
		arrow = document.all[arrowID];
		// Get the window height
		winWidth = document.documentElement.clientWidth;
		winHeight = document.documentElement.clientHeight;
		// must reconstruct aboslute page location based 
		// on mouse click abs position, and relative to layer
		eleTop = event.clientY - event.offsetY;
		
	} else if (document.getElementById) {
		ele = document.getElementById(parentID);
		pd = document.getElementById(childID);
		arrow = document.getElementById(arrowID);
		// Get the window height
		winWidth = window.innerWidth;
		winHeight = window.innerHeight; 
		// must reconstruct aboslute page location based 
		// on mouse click abs position, and relative to layer
		eleTop = event.pageY - event.layerY;
		//alert(winHeight);
	}
	
	dropdownDebugStr = debug(dropdownDebugStr, 'Window Width: ' + winWidth + ',' + 'Window Height: ' + winHeight);
	dropdownDebugStr = debug(dropdownDebugStr, 'Element Top: ' + eleTop);
	
	// change the visibility of the layer.
	if (ele.className == 'collapsed'){
		ele.className = 'shown';
		currDropdowns[id] = ele;
		promptEle.className = 'dropdownInstructionOpen';
		/* HAAAACK to Fix NS 7.0 first time click bug. */
		pd.style.display = 'block';
		// hide the arrow.
		arrow.className = 'dropdownArrowHidden';
		dropdownDontClose = true;
	} else {
		//alert(pd.offsetTop);
		ele.className = 'collapsed';
		pd.style.top = '0px';
		/* HAAAACK to Fix NS 7.0 first time click bug. */
		pd.style.display = 'none';
		currDropdowns[id] = null;
		promptEle.className = 'dropdownInstruction';
		// show the arrow.
		arrow.className = 'dropdownArrow';
		dropdownDontClose = false;
	}

	// determine if we have enough space to render down.
	needHeight = (eleTop + pd.offsetHeight + ele.offsetHeight);	
	//alert(pd.offsetTop);
	dropdownDebugStr = debug(dropdownDebugStr, 'Height Req: ' + needHeight);
	//alert(eleTop);
	if (needHeight > winHeight) {
		dropdownDebugStr = debug(dropdownDebugStr, '***Render UP***');
		// shift the layer up by it's height, plus the prompt height
        /////////////////////////////////////////////////////////
        // JJ: For some reason in FF, when the window is smaller
        //     and the user has scrolled down 
        //     the offsetTop would read as -17 randomly.  This
        //     hack resets it to zero if that isn't the case
        //     so that we get normal functionality.
        //     Created an if clause here because I don't want to 
        //     disable any other intended functionality for this
        //     one "-17" clause.
        /////////////////////////////////////////////////////////
        //     newPosX = pd.offsetTop - (pd.offsetHeight + ele.offsetHeight);
        /////////////////////////////////////////////////////////
		if(pd.offsetTop == -17)
		    newPosX = 0 - (pd.offsetHeight + ele.offsetHeight);
		else
		    newPosX = pd.offsetTop - (pd.offsetHeight + ele.offsetHeight);
		/////////////////////////////////////////////////////////
		
		pd.style.top = newPosX + 'px';
	} else {
		dropdownDebugStr = debug(dropdownDebugStr, '***Render DOWN***');
	}
	
    dropdownDebugStr = debug(dropdownDebugStr, 'parent width = ' + ele.offsetWidth + ' height = ' +  ele.offsetHeight);
    dropdownDebugStr = debug(dropdownDebugStr, 'parent pos: ' + ele.offsetLeft + ':' + ele.offsetTop);
    dropdownDebugStr = debug(dropdownDebugStr, 'parent-parent top: ' + ele.offsetParent.offsetTop);
	dropdownDebugStr = debug(dropdownDebugStr, 'flyout dim: ' + pd.offsetWidth + ':' + pd.offsetHeight);
	dropdownDebugStr = debug(dropdownDebugStr, 'flyout pos: ' + pd.offsetLeft + ":" + pd.offsetTop);
	dropdownDebugStr = debug(dropdownDebugStr, '---');
	EventDebug(event);
	debugAlert(dropdownDebugStr, false);
}

/* automatically opens after 1 sec (1000msec) hover */
/* function autoOpenDropdown(dropdown,id) {
	currDropdowns[id] = dropdown;
	currId = id;
	autoOpenDropTimer = setTimeout("toggleDropdownWrap()",1000);
}
function toggleDropdownWrap() {
	dropdownToggle(currDropdowns[id],id);
} */
/* automatically closes after 1 sec (100msec) mouseout */

function autoCloseDropdown() {
	clearTimeout(autoOpenDropTimer);
	closeDropTimer = setTimeout("dropdownTimesOut()",1000);
	currDropdown = null;
}

function dropdownTimesOut() {
	if (currDropdown != null) {	
		currDropdown.className = 'collapsed';
	}
	else {
		//close all dhtml dropdowns
	}
}

function dropdownCloseAllOther(id) {
	for (var i=1;i<currDropdowns.length;i++) {
		if (i!=id) {
			dropdownClose(currDropdowns[i]);
			currDropdowns[i]=null;
		}	
	}
}

function dropdownClose(drop) {
	if (drop != null) {
		// change the visibility
		drop.className = 'collapsed';
		dropdownDontClose = false;

		// Get IDs
		childID = drop.id + '-list';
		arrowID = drop.id + '-arrow';
		promptID = drop.id + '-prompt';
	
		// set up pointers.
		if (document.all) {
			pd = document.all[childID];
			drop.firstChild.className = 'dropdownInstruction'; 
		} else if (document.getElementById) {
			pd = document.getElementById(childID);
			prompt = document.getElementById(promptID);
			prompt.className = 'dropdownInstruction';
		}
		// reset the layer position to relative zero.
		dropdownDebugStr = debug(dropdownDebugStr, 'AutocloseID: ' + drop.id + ', childID:' + childID);
		pd.style.top = '0px';
		/* HAAAACK to Fix NS 7.0 first time click bug. */
		pd.style.display = 'none';
		arrow.className = 'dropdownArrow';
	}
	debugAlert(dropdownDebugStr, false);
}

function dropdownCancelBubble() {
	// 	This function essentially replicates the cancel bubble functionality by preventing parent element onClicks from closing the pulldown.
	dropdownDontClose = true;
}

function dropdownDocOnClick() {
	//If someone has set the don't close me flag, just clear the flag, otherwise close the whole shibang.
	//alert('dropdownDocOnClick ' + dropdownDontClose);
	if (dropdownDontClose) {
		dropdownDontClose = false;
	} else {
		dropdownCloseAll();
	}
}

function dropdownCloseAll() {
	for (var i=1;i<currDropdowns.length;i++) {
		dropdownClose(currDropdowns[i]);
		currDropdowns[i]=null;	
	}
	dropdownDontClose = false;
}


/*********************************************************************************************
milonic_src.js
Milonic DHTML Menu - JavaScript Website Navigation System. Version 5+
Copyright 2004 (c) Milonic Solutions Limited. All Rights Reserved.
This is a commercial software product, please visit http://www.milonic.com/ for more information.
See http://www.milonic.com/license.php for Commercial License Agreement
All Copyright statements must always remain in place in all files at all times
*******  PLEASE NOTE: THIS IS NOT FREE SOFTWARE, IT MUST BE LICENSED FOR ALL USE  ******* 
License Number: 1000 for Unlicensed  -- Please do not change the license details, it will cause the menu to fail
************************************************************************************************/



_mD=2
_d=document;
_dB=_d.body;
_n=navigator
_L=location
_nv=$tL(_n.appVersion);
_nu=$tL(_n.userAgent)
_ps=parseInt(_n.productSub);
//_f=false;
//_t=true;
_toL=X_=Y_=_n=null
_W=window
//doubleDollarVarHere=1234567 // see menujsbuilder for more info
//singleDollarVarHere=1234567 // see menujsbuilder for more info
_wp=_W.createPopup;
ie=(_d.all)?1:0;
ie4=(!_d.getElementById&&ie)?1:0;
ie5=(!ie4&&ie&&!_wp)?1:0;
ie55=(!ie4&&ie&&_wp)?1:0;
ns6=(_nu.indexOf("gecko")!=-1)?1:0;
konq=(_nu.indexOf("konqueror")!=-1)?1:0;
sfri=(_nu.indexOf("safari")!=-1)?1:0;
if(konq||sfri){_ps=0;ns6=0}
ns4=(_d.layers)?1:0;
ns61=(_ps>=20010726)?1:0;
ns7=(_ps>=20020823)?1:0;
ns72=(_ps>=20040804)?1:0;
ff15=(_ps>=20060000)?1:0;
op=(_W.opera)?1:0;
if(op||konq)ie=0;
op5=(_nu.indexOf("opera 5")!=-1)?1:0;
op6=(_nu.indexOf("opera 6")!=-1||_nu.indexOf("opera/6")!=-1)?1:0;
//op7=((op&&_W.opera.version&&_W.opera.version()>6)||_nu.indexOf("opera 7")!=-1||_nu.indexOf("opera/7")!=-1)?1:0;
op7=(_nu.indexOf("opera 7")!=-1||_nu.indexOf("opera/7")!=-1)?1:0;
_OpV=(op&&_W.opera.version)?_W.opera.version():0;

if(_OpV)op7=1;
mac=(_nv.indexOf("mac")!=-1)?1:0;
if(ns6||ns4||op||sfri)mac=0;
ns60=0;if(ns6&&!ns61)ns60=1;
if(op7)op=0;
IEDtD=0;if(!op&&((_d.all||ns7)&&_d.compatMode=="CSS1Compat")||(mac&&_d.doctype&&_d.doctype.name.indexOf(".dtd")!=-1))IEDtD=1;
_jv="javascript:void(0)"
inEditMode=_rstC=inDragMode=_d.dne=lcl=inopenmode=_mnuD=_mcnt=_sL=_sT=_ofMT=_oldbW=_bW=_oldbH=_bl=_el=_st=_en=_cKA=0
_startM=_c=1
_trueItemRef=focusedMenu=_oldel=_itemRef=_mn=-1;
_zi=_aN=_bH=999
if(op)ie55=0;
B$="absolute";
menuVar="menu"
$5="hidden"
_d.write("<style>.milonic{width:1px;visibility:hidden;position:absolute}</style>")
function gmobj(v) {                                  // Returns an object reference to a menu.
	if(_d.getElementById)return _d.getElementById(v) // If browser supports getElementById it's probably DOM compliant
	if(_d.all)return _d.all[v]                  // If IE4.0 and certain Opera based browsers. . . .
}

function _StO(f,m){return setTimeout(f,m)}
tTipt=""
_m=[]              // Array container for each menu object
_mi=[]	     // Array container for each menu item object
_sm=[]	     //_sm - Global variable for Selected Menu - Array
_tsm=[]            // Temporary selected menus array
_cip=[]            // Temprary array for storing menu items matching current page
$S3="2E636F6D2F"             // Ending for href
$S4="646D2E706870"           // Encoding for the file dm.php
_MT=_StO("",0);        // Empty menu drop timer variable
_oMT=_StO("",0);       // Empty open menu timer variable
_cMT=_StO("",0);       // Empty close menu timer variable
_mst=_StO("",0);       // MSCAN timer
_Mtip=_StO("",0);      // Temporary Tooltip timer.
$u="undefined ";             // Temporary var for Undefined
lNum=1000;
lURL="Unlicensed";
lVer="5.743"
_Lhr=_L.href;
$6="visible"
if(op5) {
	$5=$tU($5)
	$6=$tU($6)
}

//_hrL=_hrF.length
///_hrP=_hrF.substr((_hrF.indexOf(_L.pathname,0)),_hrL)
//if(_L.pathname=="/")_hrP="/"
//function chop(_ar,_pos){var _tar=new Array();for(_a=0;_a<_ar.length;_a++){if(_a!=_pos){_tar[_tar.length]=_ar[_a]}}return _tar}
//_Fa=["M_hideLayer","_oTree","mmMouseMove","_cL","_TtM","_ocURL","mmClick","autoOT","_iF0C","showtip","isEditMode","hidetip","mmVisFunction","doMenuResize"]
function M_hideLayer(){}
function _oTree(){}
function mmMouseMove(){}
function _cL(){}
function _TtM(){}
function _ocURL(){}
function mmClick(){}
function autoOT(){}
function _iF0C(){}
function showtip(){}
function isEditMode(){}
function hidetip(){}
function mmVisFunction(){}
function doMenuResize(){}
function _tMR(){}
function remove(a,d){var t=[];for(_a=0;_a<a.length;_a++){if(a[_a]!=d){t[t.length]=a[_a]}}return t}
function copyOf(w){for(_cO in w){this[_cO]=w[_cO]}}
function $tL(v){if(v)return v.toLowerCase()}
function $tU(v){if(v)return v.toUpperCase()}
function $pU(v){if(v)return parseInt(v)}
function drawMenus() {
	_startM=1;
	_oldbH=0;
	_oldbW=0;
	_baL=0;
	if(_W.buildAfterLoad)_baL=1
	for(_y=_mcnt;_y<_m.length;_y++) {
		_drawMenu(_y,1,_baL)
	}
}
 
_$S={
	         menu:0,
               text:1,
                url:2,
           showmenu:3,
             status:4,
          onbgcolor:5,
            oncolor:6,
         offbgcolor:7,
           offcolor:8,
          offborder:9,
     separatorcolor:10,
            padding:11,
           fontsize:12,
          fontstyle:13,
         fontweight:14,
         fontfamily:15,
        high3dcolor:16,
         low3dcolor:17,
          pagecolor:18,
        pagebgcolor:19,
        headercolor:20,
      headerbgcolor:21,
    subimagepadding:22,
   subimageposition:23,
           subimage:24,
           onborder:25,
       ondecoration:26,
      separatorsize:27,
         itemheight:28,
              image:29,
      imageposition:30,
         imagealign:31,
          overimage:32,
         decoration:33,
               type:34,
             target:35,
              align:36,
        imageheight:37,
         imagewidth:38,
        openonclick:39,
       closeonclick:40,
          keepalive:41,
         onfunction:42,
        offfunction:43,
             onbold:44,
           onitalic:45,
            bgimage:46,
        overbgimage:47,
         onsubimage:48,
    separatorheight:49,
     separatorwidth:50,
   separatorpadding:51,
     separatoralign:52,
            onclass:53,
           offclass:54,
          itemwidth:55,
          pageimage:56,
     targetfeatures:57,
       visitedcolor:58,
            pointer:59,
       imagepadding:60,
             valign:61,
      clickfunction:62,
        bordercolor:63,
        borderstyle:64,
        borderwidth:65,
         overfilter:66,
          outfilter:67,
             margin:68,
        pagebgimage:69,
             swap3d:70,
     separatorimage:71,
          pageclass:72,
        menubgimage:73,
       headerborder:74,
         pageborder:75,
              title:76,
          pagematch:77,
             rawcss:78,
          fileimage:79,
         clickcolor:80,
       clickbgcolor:81,
         clickimage:82,
      clicksubimage:83,
           imageurl:84,
       pagesubimage:85,
           dragable:86,
         clickclass:87,
       clickbgimage:88,
   imageborderwidth:89,
 overseparatorimage:90,
clickseparatorimage:91,
 pageseparatorimage:92,
        menubgcolor:93,
          opendelay:94,
            tooltip:95,
           disabled:96,
         dividespan:97,
           tipdelay:98,
          tipfollow:99,
            tipmenu:100,
          menustyle:101,
        pageoncolor:102,
                 id:103,
               name:104                 
      }
ADDSEMICOLONHERE=1 // DO NOT DELETE
function mm_style() {         // This setup the style object
	for($i in _$S)this[$i]=_n // Create blank object properties for style
	this.built=0;
}

_$M={
          items:0,
           name:1,
            top:2,
           left:3,
      itemwidth:4,
 screenposition:5,
          style:6,
  alwaysvisible:7,
          align:8,
    orientation:9,
      keepalive:10,
      openstyle:11,
         margin:12,
       overflow:13,
       position:14,
     overfilter:15,
      outfilter:16,
      menuwidth:17,
     itemheight:18,
   followscroll:19,
      menualign:20,
    mm_callItem:21,
     mm_obj_ref:22,
       mm_built:23,
     menuheight:24,
ignorecollision:25,
        divides:26,
         zindex:27,
      opendelay:28,
      resizable:29,
       minwidth:30,
       maxwidth:31
}
ADDSEMICOLONHERE=1 // DO NOT DELETE
function menuname(name) {        // This sets up the menu object
	for($i in _$M)this[$i]=_n    // Create blank object properties for menu
	this.name=$tL(name)          // sets the name of this menu
	_c=1                         // Reset the menu item counter for this new menu
	_mn++                        // Increment the menu counter
	//this.menunumber=_mn
}

function _incItem(i) {
	_mi[_bl]=[];// Create empty array to store menu item values
	_mi[_bl][0]=_mn
	i=i.split(";");
	_sc=""
	for(var a=0;a<i.length;a++) {	
		var p=i[a].indexOf("`");
		if(p!=-1) {
			_sc=";"
			_tI=i[a]
			if(p==i[a].lastIndexOf("`")) {
				for(var b=a;b<i.length;b++) {
					if(i[b+1]) {
						_tI+=";"+i[b+1];
						a++;
						if(i[b+1].indexOf("`")!=-1)b=i.length;
					}
				}
			}
			i[a]=_tI.replace(/`/g,"")
		}
		p=i[a].indexOf("=");	
		if(p==-1) {
			if(i[a])_si=_si+";"+i[a]+_sc
		}
		else {
			_si=i[a].slice(p+1);
			_w=i[a].slice(0,p);	
			if(_w=="showmenu")_si=$tL(_si)
		}
		if(i[a]&&_$S[_w])_mi[_bl][_$S[_w]]=_si
	}
	var S=_x[6]
	if(_mi[_bl][101])S=eval(_mi[_bl][101])	
	for($i in S)if(S[$i]){
		var v=_mi[_bl][_$S[$i]]
		if(!v&&v!="")_mi[_bl][_$S[$i]]=S[$i]   // Move the data from this[property] to menu[counter] array element
	}
	_m[_mn][0][_c-2]=_bl;
	_c++;
	_bl++;	
}	
_c=0
function ami(t){
	_t=this;               // Set _t to be this.object
	if(_c==1) {             // If this is the first item being drawn, will need to build the menu first
		_c++;              // Increment the menuitem counter so that we don't run this again for this menu
		_m[_mn]=[];        // Create a new menu in the _m array
		_x=_m[_mn];        // Set _x as the temporary object for this new menu
		for($i in _t)_x[_$M[$i]]=_t[$i]// Loop through each property in this.object
		_x[21]=-1           // Set array element[21] to -1 by default
		_x[0]=[];           // Create a new array at position[0] for storing menu items
		if(!_x[12])_x[12]=0 // if the margin hasnt been declared we need to set it to zero, it's used for dimension testing.
		var s=_m[_mn][6]
		var m=_m[_mn]
		//m[2]=$pU(m[2])
		if(m[15]==_n)m[15]=s.overfilter
		if(m[16]==_n)m[16]=s.outfilter
		s[65]=(s.borderwidth)?$pU(s.borderwidth):0;
		s[64]=s.borderstyle
		s[63]=s.bordercolor		
		if(_W.ignoreCollisions)m[25]=1;	
		if(!s.built){
			_WzI=_zi
			if(_W.menuZIndex){
				_WzI=_W.menuZIndex
				_zi=_WzI
			}
			lcl++
			var v=s.visitedcolor
			if(v){
				_oC=s.offcolor
				if(!_oC)_oC="#000000"
				if(!v)v="#ff0000"
				_d.write("<style>.linkclass"+lcl+":link{color:"+_oC+"}.linkclass"+lcl+":visited{color:"+v+"}</style>");
				s.linkclass="linkclass"+lcl
			}
			s.built=1
		}
	}
	_incItem(t)                // Add the item to this menu
}
menuname.prototype.aI=ami; 


/***************************************
controlFocus.js
****************************************/



var setLoadFocus = function() {

	try {
 		document.sitewidesearch.searchPhrase.focus();
		if (document.sitewidesearch.searchPhrase.value == '') {
			document.sidewidesearch.searchPhrase.value = 'Search';
		}
	}
 	catch(err) {
		//ignore errors here
	}
}

function setAfterFlydownFocus() { document.sitewidesearch.tabIndexControler.focus(); }
function setReverseFlydownFocus() { _popi(47); }
addToWindowOnLoad(setLoadFocus);







