var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)

function FixIERendering() {
	if ( /MSIE/.test(navigator.userAgent) ) {
		document.getElementsByTagName("body")[0].style.backgroundColor="#82828E";
	}
}



//The built-in Javascript properties nextSibling and previousSibling will return a reference to the element after/before
// your chosen element respectively, //but they have a major drawback when it comes to whitespace in your code – any spaces
// or line-breaks in the source code will be interpreted as DOM nodes, and your nextSibling/previousSibling call will return a blank text node instead of the // object you were expecting.
//
// To get around this, I’ve extended the Object type and added two new methods, named nextObject() and previousObject(). 
// They perform exactly the same function as nextSibling and previousSibling, but will only return the next/previous HTML element, 
// ignoring text nodes altogether
//
// Usage: var elem = someDiv.nextObject(); 


function GetNextSiblingEntityNode( domObject ) {
	var retval = null;
	if (domObject != null && domObject.nextSibling != null) {
		retval = domObject.nextSibling;
		if (retval.nodeType != 1) {
			retval = GetNextSiblingEntityNode(retval);
		}
	}
	return retval;
}

function GetPreviousSiblingEntityNode( domObject ) {
	var retval = null;
	if (domObject != null && domObject.previousSibling != null) {
		retval = domObject.previousSibling;
		if (retval.nodeType != 1) {
			retval = GetPreviousSiblingEntityNode(retval);
		}
	}
	return retval;
}