
var dom=document.getElementById&&!document.all;var mousex,mousey;var agt=navigator.userAgent.toLowerCase();var prefix='/new_nav/ChronMenu_rc1.html?';var _ISIE = document.all && window.ActiveXObject && (agt.indexOf("msie") > -1);var cMenus = new Array(12);var cSubMenus = new Array();var cFocusedMenu = null;var widthMarker = 0;var YFudge = _ISIE?1:0;var XFudge=(_ISIE)?0:-8; var IEsubmenu = new Array();var _ISOPERA=(agt.indexOf("opera") > -1);var _ISMAC=(agt.indexOf("mac") > -1);var appVer=parseFloat(navigator.appVersion);var _ISFF = (agt.indexOf('firefox') != -1);if(_ISFF){_ISFF=Number(agt.match(/firefox\/(\d\.?\d?)/)[1]);};var _ISMOZ=(agt.indexOf("mozilla") > -1);if(_ISMOZ){_ISMOZ=_ISIE?false:appVer;}

function setupMenus() {
	var cmenu = getObj('cseMenu');
	if (!cmenu) {return false;}
	var i=0;
	var cseM=getObj('cseMenu');
	for(i in cseM.childNodes) {
		var cm=cseM.childNodes[i];
		if (cm.nodeName=='DIV') {
			cm.onmouseover=function(){cmShow(this);}
			cm.onmouseout=function(){this.className=this.className.replace(' hover','');}
		}
	}
	for (i=0;i<num_sections;i++) {
	 var submenuOvr = '';var highlight = '';
	 var cmClass='cmBlue';
	 var ele = getObj('cm'+(i+1));	 
	 cMenus[ele.id] = new cmakeMenu(ele,i+1,cmClass,highlight,'','');
	}
	return false;
}
function cmakeMenu(ele,pos,cmClass,cmHigh,sectStyle,submenuOvr) {
	ele.className = cmClass;
	this.obj = ele;
	this.id=ele.id;
	this.pos=pos;
	this.cmouseout = ele.className + cmHigh;
	this.cmouseovr=ele.className+' hover';
	ele.className+=cmHigh;
	this.cleft = widthMarker;
	this.cwidth = parseInt(ele.parentNode.parentNode.style.width)||ele.offsetWidth;
	this.submenu=getObj('cSub'+pos);
	if (this.submenu) {
		if (submenuOvr) {
			this.submenu.className=submenuOvr;
		} else {
			this.submenu.className+=sectStyle;
		}
		cSubMenus[this.submenu.id] = this.id;
		this.xBounds=getBounds(ele,XFudge,YFudge);
                positionMenus(this);
		var cmItems = this.submenu.getElementsByTagName('a');
		for (var i in cmItems) {
			cmItems[i].onmouseover=function(){this.className+=' cmhilight';}
			cmItems[i].onmouseout=function(){this.className=this.className.replace(' cmhilight','');}
		}
		this.submenu.onmouseout=function(e){
			var evt=e?e:window.event;
			var target = _ISIE?evt.toElement:evt.relatedTarget;
			var sect = this.parentNode;
			if(!cmIsRelated(target,sect)) {
				sect.className=sect.className.replace(' hover','');	
			}
		}
	} else {
		this.cmouseovr+='X';
	}
	widthMarker += this.cwidth+1;
}
function cmIsRelated(target,sect) {
	while (target.parentNode){
		if((target=target.parentNode)==sect){return true;}
	}
	return false;
}
function repositionMenus() {
	for (var i=0;i<IEsubmenu.length;i++) {
		var menu=IEsubmenu[i];
		menu.xBounds=getBounds(menu.obj);
		positionMenus(menu);
	}
}
function positionMenus(menu) {
	if (menu.submenu.className.indexOf('right')>=0) {
		var calcleft = (menu.cwidth-parseInt(menu.submenu.style.width)-3)+ 'px';
		menu.submenu.style.left = calcleft;
	}
	if(_ISIE ||(_ISFF?_ISFF>=1.5:false)){createShim(menu);}

}
function getCurrentSection() {
	var loc = document.location.toString();
	if (!window.CurrentSection) {
		for (var i=0;i<sections.length;i++) {
			var sectionMatch = sections[i][0];
			for (x in sectionMatch) {
				if (loc.indexOf(sectionMatch[x])>-1) {window.CurrentSection=i;}
			}
		}
	}
	if(!window.CurrentSection){
		window.CurrentSection=0;
	} else if (window.CurrentSection ==-1) {
          var sect = [['home'],0,'cmblue','','',''];
          return sect;
        }
	return sections[window.CurrentSection];
}
function cmShow(mvr) {
 mvr.className+=' hover';
 var menu=cMenus[mvr.firstChild.firstChild.id];
 if(!menu) {return;}
 if (menu.submenu && menu.submenuShim) {
 	if (menu.submenuShim.height==300 || menu.xBounds.y1==menu.xBounds.y0) {
		menu.xBounds=getBounds(menu.submenu);
		var cheight=menu.submenu.offsetHeight;
		menu.submenuShim.height=cheight;
		if(menu.submenuShim2){
			menu.submenuShim2.height=cheight;
		}
	}
 }
 if(_ISFF && _ISFF<1.5) {
	for (i=0;i<12;i++) {
		var clr=getObj('hover'+(i+1));
		if(clr) {
			if(clr!=mvr) {
				clr.className=clr.className.replace(' hover','');
			}
		}
	}
 }
}
function createShim(menu){
	var div = menu.submenu;
	var obj=getObj('hover'+menu.pos);
	var shim=newNode('iframe');
	shim.className="cshim";
	shim.id="cShim_iframe"+menu.pos;
	shim.frameBorder="0"
	shim.scrolling="no"
	shim.height=parseInt(div.offsetHeight)||300;
	shim.width=div.offsetWidth||153;
	shim.style.left=div.style.left;
	obj.appendChild(shim);
	menu.submenuShim=shim;
	shim = getObj('cShim_flash');
	if (shim) {
		shim2 = shim.cloneNode(true);
		shim2.style.left=div.style.left;
		obj.appendChild(shim2);
		menu.submenuShim2=shim2;
	}
}
function cAttachEvent(obj,evt,func) {
  if (obj.addEventListener) {
    obj.removeEventListener(evt,func, false);
    obj.addEventListener(evt,func, false);
  } else if (obj.attachEvent){
   obj.detachEvent("on"+evt,func); // Bug fix line
   obj.attachEvent("on"+evt,func);
  }
}
function cShow(obj) {
   var theObj = getObj(obj);
   if (theObj) {
      if (!_ISIE && theObj.tagName.toUpperCase()=='TR') {
         theObj.style.display = "table-row";
      } else if (theObj.getAttribute('displaytype')) {
         theObj.style.display = theObj.getAttribute('displaytype');
      } else {
         theObj.style.display = 'block';
      }
      theObj.style.visibility = "visible";
	}
}

function cHide(obj) {
   var theObj = getObj(obj);
   if (theObj) {
      theObj.style.display = "none";
      theObj.style.visibility = "hidden";
   }
}
function getObj(obj) {
   if (!obj) {return null}
   var theObj=false;
   if (typeof obj == "string") {
      theObj = document.getElementById(obj);
   } else {

      theObj = obj;
   }
return theObj;
}
function newNode(tagnme) {
   var ele = document.createElement(tagnme);
   return ele;
}
function newText(txt) {
   var txtnode = document.createTextNode(txt);
   return txtnode;
}
function findPosX(obj){
   var curleft = 0;
   if (obj.offsetParent||obj.parentNode){
      while (obj.offsetParent||obj.parentNode){
         curleft += (obj.style&&obj.style.left)?parseInt(obj.style.left):obj.offsetLeft;
         obj = obj.offsetParent||obj.parentNode;
      }
   } else if(obj.style && obj.style.left) {
		curleft = obj.style.left;
   }
   return curleft;
}
function findPosY(obj){
   var curtop = 0;
   if (obj.offsetParent||obj.parentNode){
      while (obj.offsetParent||obj.parentNode){
         curtop += (obj.style&&obj.style.top)?parseInt(obj.style.top):obj.offsetTop;
         obj = obj.offsetParent||obj.parentNode;
      }
   } else if (obj.style && obj.style.top) {
      curtop = parseInt(obj.style.top);
   }
   return curtop;
}
function getBounds(ele,xAdj,yAdj) {
xAdj=(xAdj)?xAdj:0;yAdj=(yAdj)?yAdj:0;
var coords = new Array();
coords.x0 = findPosX(ele)+xAdj;
coords.y0 = findPosY(ele)+yAdj;
coords.x1 = coords.x0+(ele.offsetWidth||ele.style?parseInt(ele.style.width):0)-xAdj;
coords.y1 = coords.y0+(ele.offsetHeight||0)-yAdj;
return coords;
}