/* *  General Cross Browser Java Script Function  */ //++// cross browser get object by id or name.  if the name is// not a string, it is passed by unchanged since it can't be an id.// if it is a string, it tries DOM first, then IE 4/5 then Netscape 4// if forceIEBehavior is true and the getElementById// fails, routine will try to find a name instead of IE//--function getObj( name, forceIEBehavior ){    var newObj;    if ( typeof name == "string" ) {        if (document.getElementById) {            newObj = document.getElementById(name);            if ( newObj == null && forceIEBehavior != null & forceIEBehavior ) {                var newObjArray = document.getElementsByName( name );                if ( newObjArray != null && newObjArray.length > 0 )                     newObj = newObjArray[ 0 ];            }else{                var newObjArray = document.getElementsByName( name );                if ( newObjArray != null && newObjArray.length > 0 )                     newObj = newObjArray[ 0 ];            }        }        else if (document.all) {            newObj = document.all[name];        }        else if (document.layers) {            newObj = document.layers[name];        }    }    else        newObj = name;    return newObj;}//++// cross browser get all objects with the same name in an array.// tries DOM first, then IE 4/5 then Netscape 4//--function getObjArray( name ){    var newObjArray;    if ( typeof name == "string" ) {        if (document.getElementById) {			 newObjArray = document.getElementsByName(name);        }        else if(document.getElementsByName)            newObjArray = document.getElementsByName(name);        else if (document.all)            newObjArray = document.all[name];        else if (document.layers)            newObjArray = document.layers[name];    }    else        newObjArray = name;    return newObjArray;}//++// cross browser update inner HTML object// --function doUpdateHtml(obj,text) {	if(obj.innerHTML != null)		obj.innerHTML = text;	else if(obj.insertAdjacentHTML != null) {		obj.insertAdjacentHTML("beforeEnd",text);	}	else if(document.createElement != null) {		}}function doUpdateText(obj,text) {	if(obj.innerText != null)		obj.innerText = text;	else if(obj.innerHTML != null)		obj.innerHTML = text;	else if(obj.insertAdjacentHTML != null) {		obj.insertAdjacentHTML("beforeEnd",text);	}	else if(document.createElement != null) {	}}function doGetText(obj) {	if(obj.innerText != null)		return obj.innerText;	else if(obj.innerHTML != null)		return obj.innerHTML;}//++// cross browser get style object by id or name.// tries DOM first, then IE 4/5 then Netscape 4// if forceIEBehavior is true and the getElementById// fails, routine will try to find a name instead of IE//--function getStyle( name, forceIEBehavior ){    var myObj = getObj( name, forceIEBehavior );    return myObj == null ? null : myObj.style;}//++// cross browser routine to hide an element//--function hideElement( name ){	if ( document.getElementById )		getStyle( name ).visibility="hidden";	else if ( document.layers )		getObj( name ).visibility = "hide";}//++// cross browser routine to show an element//--function showElement( name ){	if ( document.getElementById )		getStyle( name ).visibility="visible"	else if ( document.layers )		getObj( name ).visibility = "show";}//++// cross browser routine to hide/show an element//--function menuElementStatus( name ){	if ( document.getElementById ){		if(getStyle( name ).visibility == "visible")			return true		else			return false	}else if ( document.layers ){		if(getObj( name ).visibility == "show")			return true		else			return false	}}/* *  Menus and Navigation */var currentlyHovering_Main = false;function doMenu(pId,pEvt) {    currentlyHovering = true;    var pEvent= (window.event) ? window.event : pEvt;        if (window.event)event.cancelBubble=true;	else if (pEvent.stopPropagation)pEvent.stopPropagation()    setTimeout('doPopulateCheck('+pId+','+(pEvent.type=="click")+','+(pEvent.type=="mouseover")+')',500);}function doPopulateCheck(pId,pblnClickStatus,pblnmouseoverStatus) {    if (!currentlyHovering_Main){        doPopulateMenu(pId,pblnClickStatus,pblnmouseoverStatus);    }}function doHideMenus(){	var objSubMenu;	for (i=0;i<100;i++) {		objSubMenu ='menuItem' + i.toString();		if(getObj(objSubMenu)){			if (menuElementStatus( objSubMenu ) ){				hideElement( objSubMenu );				var navElement = getObj('navItem' + i.toString());				if (navElement != null) {						if (navElement.className.indexOf("On") != -1) 						navElement.className = navElement.className.substring(0, (navElement.className.length-2));				}				return;			}		}	}}function doPopulateMenu(pId,pblnClickStatus,pblnmouseoverStatus){        doHideMenus();        var objMenu = getObj('navItem' + pId);        var strSubMenu = 'menuItem' + pId;            if (pblnClickStatus==true && (!menuElementStatus( strSubMenu )) || pblnmouseoverStatus==true){            objMenu.className = objMenu.className + "On";            showElement( strSubMenu );        }	        else if (pblnClickStatus==true){            if (objMenu.className.indexOf("On") != -1) {                    objMenu.className = objMenu.className.substring(0, (objMenu.className.length-2));            }            hideElement( strSubMenu );        }}function doHideSubMenu(pId){	var objMId = getObj('navItem' + pId)	var objSMId = getObj('menuItem' + pId)		if (!currentlyHovering) {		if (typeof objSMId !="undefined" && objSMId.style.visibility =="visible"){			if (objMId.className.indexOf("On") != -1) {				objMId.className = objMId.className.substring(0, (objMId.className.length-2));				hideElement( 'menuItem' + pId );				strVal = getObj('selectedMenu').value;				if(getObj('navItem' +strVal)){					objNavSelected = getObj('navItem' +strVal);					if(objNavSelected.className != objNavSelected.clasName+"On")						objNavSelected.className = objNavSelected.className + "On";					showElement( 'menuItem'+strVal);					currentlyHovering = true;				}			}		}	}}/*---------------Start Used for Menu Generation -----------------*/function doHideMenu(pId) {	//menu disappear speed onMouseout (in miliseconds)    currentlyHovering=false;    setTimeout("doHideCheck("+pId+")",500);}function doHideCheck(pId) {    if (!currentlyHovering){    	setTimeout("doHideSubMenu("+pId+")",1000);    }}function doPersistHover(pId) {	currentlyHovering = true;    currentlyHovering_Main = true;}function doNotPersistHover(pId) {    currentlyHovering_Main = false;	 //menu disappear speed onMouseout (in miliseconds)    if (currentlyHovering){        currentlyHovering = false;        setTimeout("doHideSubMenu("+pId+")",1500);    }}function setMenu(pId){	getObj('selectedMenu').value=pId;}/*---------------End Used for Menu Generation -----------------*/
