<!--

// create a page level object tracking object if it doesn't exist

if (!_eit_mnu3_pObj) {

	var _eit_mnu3_pObj = new Object();

	_eit_mnu3_pObj.arHideable = null;

	_eit_mnu3_pObj.arHiding = null;

	_eit_mnu3_pObj.arrIDs = new Array();

	_eit_mnu3_pObj.sCurrent = "";

	_eit_mnu3_pObj.bJustClicked = false;

}



/* START - Common Menu Functions */

/* build an xml menu given a data island */

function _eit_mnu3_xmlLoaded( xmldoc, oSet ) {

	try {

		//_eit_mnu3_setMenuOrientation( oSet );

		oSet.mRoot = new _eit_mnu3_MnS( null, oSet );

		oSet.htDAtt = _eit_mnu3_buildAttributeHashtable( xmldoc.documentElement );

		_eit_mnu3_build( oSet.mRoot, xmldoc.documentElement.firstChild, oSet );

		oSet.mRoot.show( true );

		return true;

	}

	catch (e) {

		// user error

		oSet.oMCo.innerHTML = "<strong>Menu cannot be displayed at this time.</strong>";

		// detailed error:

		oSet.oMCo.innerHTML += "<div style=\"display:block;\">" + ( ( xmldoc.parseError ) ? _eit_mnu3_getXMLError( xmldoc ) : e.description ) + "</span>";		

		return false;

	}

}



/* traverse the xml, building menu nodes as we go */

function _eit_mnu3_build( mThis, xParse, oSet ) {

	if ( xParse.nodeName == "Item" ) {

		var bHasKids = _eit_mnu3_hasChildItems( xParse );

		var miNew = new _eit_mnu3_MnI( mThis, _eit_mnu3_buildAttributeHashtable( xParse ), bHasKids );

		if ( bHasKids ) _eit_mnu3_build( miNew.mSubmenu, xParse.childNodes[0], oSet );

	}

	if ( xParse.nextSibling ) _eit_mnu3_build( mThis, xParse.nextSibling, oSet );

	oSet.oMCo.appendChild( mThis.tItems );

}



/* check to see if a menu has children */

function _eit_mnu3_hasChildItems( xParse ) {

	if ( xParse.hasChildNodes() ) {

		return xParse.childNodes[xParse.childNodes.length-1].nodeName == "Item";

	}

	else return false;

}



/* build a table with all of the menu attributes */

function _eit_mnu3_buildAttributeHashtable( xParse ) {

	var arOut = new Array();

	for ( var i = 0; i < xParse.attributes.length; ++i ) {

		arOut[xParse.attributes(i).nodeName] = xParse.attributes(i).text;

	}

	return arOut;

}



/* look for hideable elements on the page and store them in the arHideable array */

function _eit_mnu3_setHideableElements( oSet ) {

	_eit_mnu3_pObj.arHideable = new Array(); // Fill now with hideables

	_eit_mnu3_pObj.arHidden = new Array(); // Declare but leave empty until hiding occurs

	var arTags = new Array( "select" );

 	if ( (oSet && !oSet.bPMd) || !oSet ) {

 		for ( var i = 0; i < arTags.length; ++i ) {

 			var arSet = document.getElementsByTagName( arTags[i] );

 			if ( arSet != null ) {

 				for ( var j = 0; j < arSet.length; ++j ) {

 					_eit_mnu3_pObj.arHideable[_eit_mnu3_pObj.arHideable.length] = arSet[j];

 				}

 			}

 		}

 	}

}



/* check to see if an object is hidden */

function _eit_mnu3_isHidden( oElement ) { return ( oElement.style != null && oElement.style.visibility == "hidden" ); }



/* hide all elements in the arHideable array */

function _eit_mnu3_hideElements( oSet )

{

	// If the arHideable array has not yet been built, build it now

	if ( _eit_mnu3_pObj.arHideable == null ) {

		_eit_mnu3_setHideableElements( oSet );

	}

	

	if ( _eit_mnu3_pObj.arHideable.length > _eit_mnu3_pObj.arHidden.length ) {

		for ( var i = 0; i < _eit_mnu3_pObj.arHideable.length; ++i ) {

			if ( !_eit_mnu3_isHidden( _eit_mnu3_pObj.arHideable[i] ) ) {

				_eit_mnu3_pObj.arHideable[i].style.visibility = "hidden";

				_eit_mnu3_pObj.arHidden[_eit_mnu3_pObj.arHidden.length] = _eit_mnu3_pObj.arHideable[i];

			}

		}

	}

}



/* unhide all elements that were hidden using the hideElements function */

function _eit_mnu3_unhideElements()

{

	if (_eit_mnu3_pObj.arHidden) {

	for ( var i = 0; i < _eit_mnu3_pObj.arHidden.length; ++i ) {

		_eit_mnu3_pObj.arHidden[i].style.visibility = "visible";

	}

	_eit_mnu3_pObj.arHidden = new Array();

	}

}



/* get the last XML parsing error */

function _eit_mnu3_getXMLError( oXML ) {

	if ( oXML != null && oXML.parseError != null ) {

		var sOut = "XML Error: ";

		sOut += oXML.parseError.reason + " [line " + oXML.parseError.line + ", pos " + oXML.parseError.linepos + "]";

		sOut = "Unable to display menu.  Please contact your local support.";

		return sOut;

	}

	else return "";

}



/* END - Common Menu Functions */



/* START - MenuShell Class */



/* build a menu shell from its parent */

function _eit_mnu3_MnS( miParent, oSet ) {

	this.tItems = null;

	this.miParent = miParent;

	this.miSelected = null;

	this.isRoot = ( this.miParent == null );

	this.oSet = oSet;

	this.sType = "MenuShell";

	this.bForceLeft = false;

	this.bR2L = false;



	_eit_mnu3_MnS.prototype.show = _eit_mnu3_MnS_show;

	_eit_mnu3_MnS.prototype.create = _eit_mnu3_MnS_create;

	_eit_mnu3_MnS.prototype.setHideable = _eit_mnu3_MnS_setHideable;

	this.create();

	this.tItems.ptrObject = this;

	return this;

}



/* set an item visible or invisible */

function _eit_mnu3_MnS_show( bIsVis ) {

	if ( !this.isRoot ) {

		if ( bIsVis ) {

			var oParentShell = this.miParent.mParent.tItems;

			this.tItems.style.visibility = "visible"; // No transition effect

			this.tItems.style.top = oParentShell.offsetTop + this.miParent.rCR.offsetTop;

			this.tItems.style.left = ( this.oSet.bLM ) ?

				oParentShell.offsetLeft + oParentShell.offsetWidth - 1 :

				oParentShell.offsetLeft - this.tItems.offsetWidth + 1;

		}	

		else {

			var mParse = this;

			while ( mParse ) {

				 mParse.tItems.style.visibility = "hidden";

				 mParse = ( mParse.miSelected ) ? mParse.miSelected.mSubmenu : null;

			}	

		}

	}

}



function _eit_mnu3_MnS_setHideable( bIsHideable ) {

	var arHideable = this.oSet.arHideable;

	if ( arHideable.length > 0 ) {

		for ( var i = 0; i < arHideable.length; ++i ) {

			arHideable[i].style.visibility = ( bIsHideable ) ? "hidden" : "visible";

		}

	}

}

		

function _eit_mnu3_MnS_create() {

	this.tItems = document.createElement('<TABLE cellspacing="0" cellpadding="0" border="0">');



	if ( this.isRoot ) {

		this.tItems.className = this.oSet.clsRM;

		this.tItems.width = "100%";

		this.tItems.style.position = "relative";

		this.tItems.style.zIndex = 0;

		this.tItems.id = "ROOT_" + this.oSet.id;

	}

	else {

		this.tItems.className = this.oSet.clsSM;

		this.tItems.style.position = "absolute";

		this.tItems.style.zIndex = new Number(this.miParent.mParent.tItems.style.zIndex) + 1;

	}

	this.show( false );

}

/* END - MenuShell Class */



/* START - MenuItem Class */

function _eit_mnu3_MnI( mParent, htAtt, bIsP ) {

	this.mParent = mParent;		// pointer to item's parent

	this.mSubmenu = null;		// pointer to item's submenu

	this.rCR = null;			// item's row data

	this.cCC = null;			// item's content cell data

	this.htAtt = htAtt;			// item's attributes

	this.bIsP = bIsP;			// is this item a parent?

	this.clsNormal = null;		// default format

	this.clsHot = null;			// hover format

	this.clsLPt = null;			// left pointer format

	this.clsLPtHot = null;		// left pointer hover format

	this.clsRPt = null;			// right pointer format

	this.clsRPtHot = null;		// right pointer hover format

	this.oSet = mParent.oSet;	// inherit the parent's settings

	this.sType = "MenuItem";

	this.bForceLeft = false;

	this.bR2L = false;

	

	_eit_mnu3_MnI.prototype.sLabel = function () { return ( ( this.htAtt["Label"] == null ) ? "" : this.htAtt["Label"]  ); }

	_eit_mnu3_MnI.prototype.sLink = function () { return ( ( this.htAtt["Href"] == null ) ? "" : this.htAtt["Href"]  ); }

	_eit_mnu3_MnI.prototype.sIcon = function () { return ( ( this.htAtt["Icon"] == null ) ? "" : this.htAtt["Icon"]  ); }

	_eit_mnu3_MnI.prototype.sFormat = function () { return ( ( this.htAtt["Type"] == null ) ? "" : this.htAtt["Type"]  ); }

	_eit_mnu3_MnI.prototype.sTooltip = function () { return ( ( this.htAtt["Tooltip"] == null ) ? "" : this.htAtt["Tooltip"]  ); }

	_eit_mnu3_MnI.prototype.sTargetFeatures = function () {

			var sDefaultFeatures = "location=1,toolbar=1,menubar=1,resizable=1,status=1,scrollbars=1";

			return sDefaultFeatures + 

				(

					( this.htAtt["Features"] == null ) 

					? "" 

					: "," + this.htAtt["Features"]

				);

		}

	_eit_mnu3_MnI.prototype.sTarget = function () {

			var sDefaultTarget = this.oSet.htDAtt["DefaultTarget"];

			sDefaultTarget = ( sDefaultTarget == null ) ? "_blank" : sDefaultTarget;

			return ( ( this.htAtt["Target"] == null ) ? sDefaultTarget : this.htAtt["Target"]  );

		}

	_eit_mnu3_MnI.prototype.onMouseOver = function () {

			this.cIC.className = this.clsHot;

			this.cCC.className = this.clsHot;

			this.cPC.className = ( this.oSet.bLM ) ? this.clsRPtHot : this.clsLPtHot;

			window.status = this.sLink();

		}

	_eit_mnu3_MnI.prototype.onMouseOut = function () {

			this.cIC.className = this.clsNormal;

			this.cCC.className = this.clsNormal;

			if (this.bIsP) {

				if (this.mParent.isRoot) { this.cPC.className = ( this.oSet.bLM ) ? this.clsRPt : this.clsLPt; }

				else { this.cPC.className = this.clsNormal;	}

			} else {

				this.cPC.className = this.mParent.isRoot ? ( this.oSet.bLM ) ? this.clsRPt : this.clsLPt : this.clsNormal;

			}

			window.status = "";

		}

	_eit_mnu3_MnI.prototype.onClick = _eit_mnu3_MnI_onClick;

	_eit_mnu3_MnI.prototype.createContentRow = _eit_mnu3_MnI_createContentRow;

	_eit_mnu3_MnI.prototype.clearSubmenus = _eit_mnu3_MnI_clearSubmenus;

	_eit_mnu3_MnI.prototype.setClasses = function () {

			this.clsHot = ( this.mParent.isRoot ) ? this.oSet.clsRIH : this.oSet.clsSIH;

			this.clsNormal = ( this.mParent.isRoot ) ? this.oSet.clsRI : this.oSet.clsSI;

			this.clsRPt = this.oSet.clsRPt;

			this.clsLPt = this.oSet.clsLPt;

			this.clsRPtHot = this.oSet.clsRPtHot;

			this.clsLPtHot = this.oSet.clsLPtHot;

		}

	this.setClasses();

	this.createContentRow();

	return this;

}





function _eit_mnu3_MnI_clearSubmenus( sId ) {

//	alert(sId);

	var tRoot = document.getElementById( "ROOT_" + sId );

	if ( tRoot != null ) {

		var oSet = tRoot.ptrObject.oSet;

		if ( oSet.miLast != null ) {

			if ( oSet.miLast.mSubmenu ) oSet.miLast.mSubmenu.show( false );

			var mParse = oSet.miLast.mParent;

			while ( !mParse.isRoot ) {

				mParse.show( false );

				mParse = mParse.miParent.mParent;

			}

		}

	}

}



function _eit_mnu3_MnI_clearAllSubmenus( arrIDs , sExcept ) {

	for (var i=0; i< arrIDs.length; i++){

		if (arrIDs[i] != sExcept) {

			_eit_mnu3_MnI_clearSubmenus(arrIDs[i]);

		}

	}

}



function _eit_mnu3_MnI_onClick() {

	sCurrent = this.oSet.id;

	if (this.bIsP) {

		var bIsVis = (this.mSubmenu.tItems.style.visibility == "visible") ? true : false;

		if (bIsVis) {

			// menu is visible and needs to be hidden

			_eit_mnu3_MnI_clearSubmenus(this.oSet.id);

			if ( !this.mParent.isRoot || this.mSubmenu != null ) {

				_eit_mnu3_unhideElements();

			}

			

			sCurrent = "";

		}

		else

		{

			// menu is hidden and should be shown

			_eit_mnu3_pObj.bJustClicked = true;  // required to tell the page that a menu was just opened

			_eit_mnu3_MnI_clearAllSubmenus(_eit_mnu3_pObj.arrIDs, this.oSet.id);

			if (!isNaN(this.oSet.id)) {  // this isn't a banner menu (those are non-numeric)

				_eit_mnu3_showtabs ("");

			}

			if ( this.oSet.miLast ) {

				var miParse = this.oSet.miLast;

				while ( miParse ) {

					if ( miParse.mParent == this.mParent && miParse != this && miParse.bIsP ) {

						miParse.mSubmenu.show( false );

						break;

					}

					miParse = miParse.mParent.miParent;

				}

			}

			window.clearTimeout( this.oSet.nTimeout );

			this.oSet.miLast = this;

			this.mParent.miSelected = this;

			if ( !this.mParent.isRoot || this.mSubmenu != null ) {

				_eit_mnu3_hideElements( this.oSet );

				window.clearTimeout( _eit_mnu3_pObj.nTimeout );

			}

			if ( this.bIsP ) this.mSubmenu.show( true );

		}

	}

	// if link, open the link

	else if ( this.sLink() != "" ) {

		_eit_mnu3_MnI_clearSubmenus(this.oSet.id);

		if (this.sTarget() != "" ) {

			var oWin = window.open( this.sLink(), this.sTarget(), this.sTargetFeatures(), false );

			try { oWin.focus();	}  // some windows won't allow focus()

			catch (e) {}

		} else {

			window.location.href=this.sLink();

		}

	}

}



function _eit_mnu3_MnI_createContentRow() {

	// Set up row

	this.rCR = this.mParent.tItems.insertRow();

	this.rCR.width = "100%";



	var sTooltip = (this.sTooltip().length > 0) ? "title='" + this.sTooltip() + "'" : "";



	

	if ( this.sFormat() ) {

		var sCellHTML = "<TD " + sTooltip + ">";

	} else {

		var sCellHTML = "<TD onMouseOver='if ( this.ptrObject ) this.ptrObject.onMouseOver();'" +

						   " onMouseOut='if ( this.ptrObject ) this.ptrObject.onMouseOut();'" +

						   " onClick='if ( this.ptrObject ) this.ptrObject.onClick();' " + sTooltip + ">";

	}

	

	// Set up icon cell

	this.cIC = document.createElement( sCellHTML );

	this.cIC.ptrObject = this;

	this.cIC.className = this.clsNormal;



	if (this.sIcon().length > 0) {

		this.cIC.innerHTML = "<img src=\"" + this.sIcon() + "\" border=\"0\" title=\"" + this.sTooltip() + "\" width=\"20\" height=\"20\">";

	} else {

		this.cIC.innerHTML = "&nbsp;";

	}

	this.cIC.style.width = "20px";

	

	// Set up content cell

	this.cCC = document.createElement( sCellHTML );

	this.cCC.ptrObject = this;

	this.cCC.className = this.clsNormal;

	this.cCC.innerHTML = this.sLabel();

	this.cCC.style.width = (this.mParent.isRoot) ? "100%" : "200px";



	// Set up pointer cell

	this.cPC = document.createElement( sCellHTML );

	if ( this.bIsP ) {

		var sArr = ( this.oSet.bLM ) ? "right" : "left";

		this.cPC.innerHTML = "<img src='images/btn-" + sArr + "arrow.gif' title='Open this menu' border='0' style=\"width:9px;height:9px;margin:0px 2px;\">";

		this.mSubmenu = new _eit_mnu3_MnS( this, this.oSet );

		this.cPC.ptrObject = this;

	}

	else {

		this.cPC.innerHTML = "&nbsp;";

	}

	this.cPC.className = ( this.mParent.isRoot ) ? (( this.oSet.bLM ) ? this.clsRPt : this.clsLPt) : this.clsNormal;

	

	if ( this.sFormat() ) {

		this.cCC.colSpan = "2";

		this.cCC.className = "Header";

		this.cCC.style.cursor = "default";

		this.cPC.className = "Header";		

		this.cPC.style.cursor = "default";

		this.rCR.appendChild( this.cCC );

		this.rCR.appendChild( this.cPC );

	}

	else if ( this.oSet.bLM ) {

		this.rCR.appendChild( this.cIC );

		this.rCR.appendChild( this.cCC );

		this.rCR.appendChild( this.cPC );

	}

	else {

		this.cPC.style.backgroundImage = "none";  // don't show faded bg for R2L mnus

		this.rCR.appendChild( this.cPC );

		this.rCR.appendChild( this.cCC );

		this.rCR.appendChild( this.cIC );

	}		

}



/* END - MenuItem Class */



/*

-----------------------------

Bryan Minihan (bjm13273@LI.com) universal menu functions 15.05.2005

Begin

-----------------------------

*/



	// set gadget title

	function _eit_mnu3_setGT( iGID, sTtl )	{

		if ( sTtl != null && (""+sTtl).length > 0 ) {

			var oTitle = document.getElementsByName(iGID);

			try { oTitle[0].innerHTML = sTtl; }

			catch(e) {}

		}

	}



	// set header text

	function _eit_mnu3_setHT( iGID, sHT )	{

		var oGH = document.getElementById( "cGadgetHeader_" + iGID );

		if ( oGH != null ) {

			if ( sHT != null && (""+sHT).length > 0 ) {	oGH.innerHTML = sHT; }

			else {

				// If there's no text, just hide the row to conserve space

				try { oGH.parentNode.style.display = "none"; }

				catch (e) {}

			}

		}

	}



	// set footer text

	function _eit_mnu3_setFT( iGID, sFT )	{

		var oGF = document.getElementById( "cGadgetFooter_" + iGID );

		if ( oGF != null ) {

			if ( sFT != null && (""+sFT).length > 0 ) {	oGF.innerHTML = sFT; }

			else {

				try { oGF.parentNode.style.display = "none"; }

				catch (e) {}

			}

		}

	}



	// set gadget content

	function _eit_mnu3_setGC( iGID, sCN )	{

		if ( sCN != null && (""+sCN).length > 0 ) {

			var oG = document.getElementById( "divGadget_" + iGID );

			if ( oG != null ) {	oG.className = "Gadget_" + sCN;	}

		}

	}



	// set menu classes

	function _eit_mnu3_setMC( iGID, sCN )	{

		if ( sCN == null || (""+sCN).length == 0 ) sCN = "def";

		var oMenu = document.getElementById( "cMenu_" + iGID );

		if ( oMenu != null ) oMenu.className = "Menu_" + sCN;

	}

	

	// is this a left menu?

	function _eit_mnu3_isLM(iGID)	{

		try {

			var divMenu = document.getElementById( "divGadget_" + iGID );

			var oParse = divMenu.parentNode;

			while (oParse.id.indexOf("ptcol") == -1) {oParse = oParse.parentNode;}

			return (oParse.id == "ptcol0");

		}

		catch (e) {}

		return true;

	}

		

	

	function _eit_mnu3_setIP( iGID, oSet ) {

		oSet.id = iGID;

//		oSet.nTimeout = 0;

//		oSet.nTOD = 5;

		oSet.miLast = null;

		oSet.clsRM = "RootMenu";

		oSet.clsSM = "SubMenu";

		oSet.clsRI = "RootItem";

		oSet.clsSI = "SubItem";

		oSet.clsLPt = "LeftPointer";

		oSet.clsRPt = "RightPointer";

		oSet.clsRIH = "RootItemHot";

		oSet.clsSIH = "SubItemHot";

		oSet.clsLPtHot = "LeftPointerHot";

		oSet.clsRPtHot = "RightPointerHot";

		oSet.oData = document.getElementById( "xmlDataIsland_" + iGID );

		oSet.oMCo = document.getElementById( "cMenu_" + iGID );

		oSet.bLM = _eit_mnu3_isLM(iGID);

		oSet.bPMd = false;

		oSet.fnCallback = _eit_mnu3_onBldCmplt;

	}



	function _eit_mnu3_showtabs (which) {

		if (_eit_mnu3_pObj.arrIDs) {

			for (var i=0; i<_eit_mnu3_pObj.arrIDs.length; i++) {

				if (isNaN(_eit_mnu3_pObj.arrIDs[i])) {

					var omen = document.getElementById("tab" + _eit_mnu3_pObj.arrIDs[i]);

					if (omen && omen.style && "tab" + _eit_mnu3_pObj.arrIDs[i] != which) {

						omen.style.display = "none";

					}

					else if (omen && omen.style) {

						if (omen.style.display == "block") {

							_eit_mnu3_unhideElements();

							omen.style.display = "none";

						} else {

//							alert(which.substr(4,which.length-1));

							sCurrent = which.substr(4,which.length-1);

							_eit_mnu3_pObj.bJustClicked = true;  // required to tell the page that a menu was just opened

							_eit_mnu3_MnI_clearAllSubmenus(_eit_mnu3_pObj.arrIDs, "");

							_eit_mnu3_hideElements();

							omen.style.display = "block";

						}

					}

				}

			}

		}

	}





	function _eit_mnu3_hideall () {

		if (!_eit_mnu3_pObj.bJustClicked) {

			_eit_mnu3_MnI_clearAllSubmenus(_eit_mnu3_pObj.arrIDs, "");

			_eit_mnu3_showtabs ("");

			_eit_mnu3_unhideElements();

		} else {

			_eit_mnu3_pObj.bJustClicked = false;

		}

		return true;

	}



	// after building the menu, fill in gadget data

	function _eit_mnu3_onBldCmplt(iGID, oSet) {

		_eit_mnu3_setGT( iGID,oSet.htDAtt["Title"] );

		_eit_mnu3_setHT( iGID,oSet.htDAtt["HeaderText"] );

		_eit_mnu3_setFT( iGID,oSet.htDAtt["FooterText"] );

		_eit_mnu3_setGC( iGID,oSet.htDAtt["GadgetSkin"] );

		_eit_mnu3_setMC( iGID,oSet.htDAtt["MenuSkin"] );

		document.onunload = function () { oSet.mRoot = null; }

	}

	

	// standalone loader for use when setIP is configured separately

	function _eit_mnu3_load(iGID, oSet) {

		if (oSet.oData) {

			if (_eit_mnu3_xmlLoaded( oSet.oData.XMLDocument, oSet )){

				oSet.fnCallback(iGID, oSet);

			}

		}

	}

	

	function _eit_mnu3_init(iGID, oSet) {

		_eit_mnu3_setIP( iGID, oSet );

		if (oSet.oData) {

			if (_eit_mnu3_xmlLoaded( oSet.oData.XMLDocument, oSet )){

				oSet.fnCallback(iGID, oSet);

			}

		}

//		alert(_eit_mnu3_pObj.arrIDs);

	}

	

/*

-----------------------------

Bryan Minihan (bjm13273@LI.com) universal menu functions 15.05.2005

Begin

-----------------------------

*/



//-->


