/* 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();
    }
  }
}

/* ---------------------------------------------------------------
   Cookie functions - 
   global_setCookie and global_getCookie match the ones in collapsing_list.js for tdts-books. The rest are new.
   ---------------------------------------------------------------- */
//function returns the date that is 'days' days from now. (in milliseconds since 1/1/70 of course)
function global_daysFutureToTimeMS (days) {
  var mydate = new Date();
  var ms;
  mydate.setTime(mydate.getTime()+((days)*24*60*60*1000));
  ms = Date.parse(mydate);
  return ms;
}

function global_setCookie(name, value, days) {
  if (days) {
    var dateobj = new Date(global_daysFutureToTimeMS (days));
    var expdate = dateobj.toGMTString();
    var expires = "; expires="+expdate;
  } else {
    var expires = "";
  }
  //alert("expires="+expires);
  document.cookie = name+"="+value+expires+"; path=/; domain=cisco.com";
}

function global_getCookie(name) {
 var CValue = new String();
  CValue = document.cookie;
  var exp = new RegExp("^.*" + name + "=" );
  if (CValue.match(exp)){
    CValue = CValue.replace(exp,'');
    CValue = CValue.replace(/;.*/,'');
    //alert(name +" is currently set to "+CValue);
    return CValue;
  }
  //alert(name+" has no value yet");
  return ""; 
}
 
function global_extractCookieChip(cookiename,parmname) {
  //alert("extracting "+parmname+" from "+cookiename);
  var CValue = unescape(global_getCookie(cookiename));
  var PValue = new String();
  var namestr = "&"+parmname+"=";
  var start = CValue.indexOf(namestr);
  if (start > -1) {
    start += namestr.length;
    PValue = CValue.substring(start,CValue.length);
    //alert(PValue+"=PValue");
    if (PValue.indexOf("&") > -1) {
      PValue = PValue.substring(0,PValue.indexOf("&"));
    }
    return PValue;
  }
  return "";
}

function global_crumbleCookieChip(cookiename, parmname) {
  /* get cookie values in array */
  var CValue = unescape(global_getCookie(cookiename));
  if ( CValue.indexOf ("&", CValue) > -1) {
    var chips = CValue.split("&");
    var newchips = new String();

    /* reassemble without parm and rewrite */
    for ( var i=0; i < chips.length; i++) {
      if ( chips[i].indexOf(parmname) != 0 ) {
        if ( newchips == "") { chips[i] = "&"+chips[i]; }
        newchips += chips[i];
      }
    } /* end stepping through array */
    global_setCookie(cookiename, newchips, 366);
  } /* if there was no '&' we did nothing */
}

function global_addCookieChip(cookiename, newname, newvalue ) {
  var CValue = global_getCookie(cookiename);
  CValue += escape("&"+newname+"="+ newvalue);
  global_setCookie (cookiename, CValue, 366);
}

/*---------------------------------------------------------
  Intercept popup window decision process functions
  ------------------------------------------------------------------
  Use timedPop() to popup an intercept window only if they've been on-site for a while.
  They will NEVER get this window on the first page they come to, even if minutes=0. Use randomPop() instead if you need that

   minutes: how long they need to be onsite before getting popup
   frequency: how often to ask people - random number between 1 & frequency generated
   url: url of window to pop open
   stopcookie: name of cookie that lets you know they've been asked already
   expires: number of days to keep the stopcookie active
   windowsize: small, medium, large - defaults to large -- sizes defined in window opening functions
---------------------------------------------------------------------*/
function timedPop(minutes, frequency, url, stopcookie, expires, windowsize ) {
  myDomain = window.location.host; 
  if ( (myDomain == "cisco.com" || myDomain == "www.cisco.com" || myDomain == "elovejoy-lnx" || myDomain == "maunaloa" || myDomain == "maunaloa.cisco.com" || myDomain == "newsroom.cisco.com" ) && window.location.pathname.match("/en/US/") ) { /* don't let this interfere w/ apps or theaters */
    timeCookie= "CDCsitetimer";
    /* check for time cookie */
    now = new Date();
    nowMinutes = now.getTime()/60000; 
    if ( cookietime = global_getCookie(timeCookie)) {
      // alert("long enough? cookietime="+cookietime +" & now is " 	+nowMinutes);
      if ( cookietime != "Done" && (nowMinutes - cookietime) >= minutes )   {
        // alert("time to pop");
        randomPop(frequency,  url, stopcookie, expires, windowsize);
        global_setCookie(timeCookie,"Done", 0);
      } 
    } else {
      /* if they don't have a timer make one */
      global_setCookie(timeCookie,nowMinutes, 0);
   }
   //} else { alert("we don't pop on your domain");
  } /* end domain check */
}

/* -------------------------------------------------------------------
 randomPop() will popup an intercept window if the randomly generated number = 1
 If frequency=1 this will always get called.
 This _can_ happen on the first page someone lands on.
   frequency: odds of getting popup = 1/frequency times
   url: url of the content for popup window
   stopcookie: name of cookie that keeps them from getting popup again
   expiredays: number of days to keep the stopcookie active
   windowsize: small, medium, large - defaults to large 
   -- these sizes are defined in the window opening functions
  ------------------------------------------------------------------- */
function randomPop (frequency, url, stopcookie, expiredays, windowsize){
  var cookiename = 'IntSurP';
  var validDate;
  var random_num;
  frequency <= 1 ? random_num = 1: random_num = Math.ceil( frequency * Math.random()) ;
  if ((random_num == 1) ) {
   validDate = global_extractCookieChip(cookiename,stopcookie);
   if ( validDate && validDate < Date.parse(Date()) ) {
      /* they had the cookie, but it's too old to matter */
      global_crumbleCookieChip(cookiename, stopcookie);
      validDate = "";
   }
   if (!validDate ) {
      /* they don't have a cookie telling us to stop */
      expiredays = global_daysFutureToTimeMS(expiredays);
      global_addCookieChip(cookiename, stopcookie,expiredays);
      if ( windowsize=="medium" ) {
        openMediumPopup(url,"popWin");
      } else if ( windowsize=="small") {
	  openSmallPopup(url,"popWin");
      } else {
        openLargePopup(url,"popWin");
      }
   //} else { 
    //alert("You've got the Cookie! " + stopcookie); 
  }  /* ends if (!validDate) */
  //} else { 
     /* it was a different random number */
    // alert("random_num was "+random_num)  // for debugging purposes only
  } /* ends if (random_num ==1) */
} // end randomPop() 


/* ------------------------------------------------------------
   function call to initiate timed survey
   ------------------------------------------------------------ */
// How to use timedPop. Comment out the following line to turn it off.
timedPop(1, 50, "http://www.cisco.com/survey/intercept.html", "cdcsurvey", 183, "small" ); 

/* ------------------------------------------------------------
   function call for framework to render right grey bar if framework-content-right has a certain # of child nodes 
   ------------------------------------------------------------ */
function setRightColumnBar(){
	var thisCol = document.getElementById('framework-content-right').childNodes;
	for(i=0;i < thisCol.length;i++){
		if(thisCol[i].nodeType == 1 || (thisCol[i].nodeType == 3 && (/\S/.test(thisCol[i].nodeValue)))){
			document.getElementById('framework-base-main').className="framework-base-main-override";
			document.getElementById('framework-content-right').style.width="189px";
		}
	}
}

/* ---------------------------------------------------------------
    Search box -- Function to clear the word Search	when you go into the field. Could be used for other default text
   --------------------------------------------------------------- */
function checkClear(input,defaultPhrase) {
  if ( input.value == defaultPhrase) input.value = "";
}
   
/* ---------------------------------------------------------------
       Sitewide Tools Rollover Functions  
   --------------------------------------------------------------- */
/* Window opening script for Sitewide Toolkit only */
function sitewide_toolkit_window(url,winName) {
	if(!winName) { winName = "swtwin"; }
    var swtwin = window.open(url, winName, 'width=643,height=492,outerWidth=643,outerHeight=492,top=50,left=70,resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,status=yes,locationbar=no');
	if (swtwin) swtwin.focus();
}

/* ------------------------------------------------------------	
   Function for Performing redirect.
   ------------------------------------------------------------ 
   must pass Burl other parameters are optional:
      doRedirect('http://cisco.com');
   This will default to 50/50 chance of a redirect.  To adjust the chance of a redirect, use a second parameter.  To get a one in 5 chance:
      doRedirect('http://cisco.com',5);
   If they want session consistency then they must choose and pass in a unique cookie name.  If you use a cookieName, you MUST specify the frequency even if it is 2.  The cookie name can be composed of letters, numbers, dashes and underscores and be less than 20 charaters.  
      doRedirect('http://cisco.com',2,'you-inc-AorB');
   ------------------------------------------------------------ 
*/

function doRedirect(Burl,chance,cookieName) {
    if(!Burl) {
        return;
    }
    if (!chance) {
        chance = 2;
    }
    if (cookieName) {
        var cookie = global_getCookie(cookieName);
        if (cookie == 'b') {
            window.location.replace(Burl);
            return;
        }
        if (cookie == 'a') {
            return;
        }
    }
    var chooser = Math.ceil(Math.random()*chance);
    if (chooser == 1) {
        if (cookieName) {
             global_setCookie(cookieName, 'b');
        }
        window.location.replace(Burl);
    }
    else {
        if (cookieName){
             global_setCookie(cookieName, 'a');
        }
    }

	var chooser = Math.ceil(Math.random()*chance);
	if (chooser == 1) {
		window.location.replace(Burl)
	}
}


/***************************************************************
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,
////////////////////////////////////////////////////////////////
//JJ: Added name attribute here in order to support visual sciences &lpos= tags
////////////////////////////////////////////////////////////////
               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; 


/********************************************************************************************
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License: http://www.opensource.org/licenses/mit-license.php
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for legal reasons.
 *********************************************************************************************/
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;

/******************************************
lc.js
******************************************
*** !!! This branched version 
   *  uses image request not http_request 
   *  $Revision: 1.1.2.4 $ 
*/
//Revision: 1.0.2
//var vs_getdomain = ""; //for root-relative url

var vs_getdomain="http://www.cisco.com"; // example for absolute url
var vs_filename = vs_getdomain + "/swa/j/zag2_vs_log1.asc?Log=1";
function vs_makeExit(link) {
  return function() {
    //var method = "POST";
    var method = "GET";     
    var lhref = "&link=" + escape(link.href);
    var lname = "&linkname=" + escape(link.name);
    var theText = link.text ? link.text : link.innerText; 
    var ltext = "&linktext=" + theText;
    var dref = "&title=" + document.title;
    var dlink = "&basepage=" + window.location.href;
    var cb = "&cb=" + (new Date()).getTime();
    var url = vs_filename + lhref + lname + ltext + dref + dlink + cb;
    var imObj = new Image();
    imObj.src = url;
    return true;
  }
}

function vs_makeImg(link) {
  //var method = "POST";
  var method = "GET";
  var lsrc = "&image=" + escape(link.src);
  var ltext = "&imagetext=" + escape(link.alt);
  var lname = "&imagename=" + escape(link.name);
  var dref = "&title=" + document.title;
  var dlink = "&basepage=" + window.location.href;
  var cb = "&cb=" + (new Date()).getTime();
  var url = vs_filename + lsrc + ltext + lname + dref + dlink + cb;
  var imObj = new Image();
  imObj.src = url;
  return true;
}

function vs_makeSubmit(link) {
  //var method = "POST";
  var method = "GET";
  var lname = "&linkname=" + escape(link.name);
  var dref = "&title=" + document.title;
  var dlink = "&basepage=" + window.location.href;
  var cb = "&cb=" + (new Date()).getTime();
  var url = vs_filename + lname + dref + dlink + cb;
  var imObj = new Image();
  imObj.src = url;
  return true;
}

function vs_pageTag() {
  //var method = "POST";
  var method = "GET";
  var dref = "&title=" + document.title;
  var dlink = "&basepage=" + window.location.href;
  var cb = "&cb=" + (new Date()).getTime();
  var local_vars = "";  
  if (typeof vs_vars != "undefined") {
    if (vs_vars) {
      local_vars = "&" + vs_vars;
    }
  }
  var url = vs_filename + dref + dlink + local_vars + cb;
  var imObj = new Image();
  imObj.src = url;
  return true;
}

var vs_tempFunction = function() {
  if (typeof vs_pt != "undefined") {
    if (vs_pt) {
      vs_pageTag();
    }
  }
  // Get all of the a tags
  var o = document.getElementsByTagName("a");
  // Loop through all of the links
  for (i = 0; i < o.length; i++) {
    // Grab the rel attribute values
    if (anchs = o[i].getAttribute("rel")) {
      // If there is more than one value of rel, we need to split it
      var rels = anchs.split(" ");
      // Loop through all of the values of the rel attribute
      for (j = 0; j < rels.length; j++) {
        // If we found an exit link
        if (rels[j] == "exit") {
          // Make a new function to attach to the link
          exitLinkFunction = vs_makeExit(o[i]);
          // Attach the function to the onclick event of the link we found.
          o[i].onmousedown = exitLinkFunction;
        }
      }
    }
  }
  
  // Get all of the area tags
  var p = document.getElementsByTagName("area");
  // Loop through all of the links
  for (i = 0; i < p.length; i++) {
    // Grab the rel attribute values
    if (anchs = p[i].getAttribute("rel")) {
      // If there is more than one value of rel, we need to split it
      var arearels = anchs.split(" ");
      // Loop through all of the values of the rel attribute
      for (j = 0; j < arearels.length; j++) {
        // If we found an exit link
        if (arearels[j] == "exit") { 
          // Make a new function to attach to the link
          exitLinkFunction = vs_makeExit(p[i]);
          // Attach the function to the onclick event of the link we found.
          p[i].onclick = exitLinkFunction;
        }
      }
    }
  }
}
addToWindowOnLoad(vs_tempFunction);

/***************************************
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);

