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"
    }
    }
  }
}
function buildname_hovers(){
var divnodes = document.getElementsByTagName("div");
    for(var i=0;i<divnodes.length; i++){
        if(divnodes[i].className =="name"){
	   var children = divnodes[i].childNodes;
	   var a = [];
		for(var j=0;j<children.length; j++){
	   		if(children[j].className == "pinfo"){
			a.push(j);
			}
			else if (children[j].className =="picture"){
			a.push(j);
			}
		}
		divnodes[i].onmouseover=function(){
		this.childNodes[a[0]].style.visibility="visible";
		this.childNodes[a[1]].style.visibility="visible";
		this.style.color="white";
		this.style.cursor="pointer";
		}
		divnodes[i].onmouseout=function(){
		this.childNodes[a[0]].style.visibility="hidden";
		this.childNodes[a[1]].style.visibility="hidden";
		this.style.color="#11b0f2";
		}
		}
	}
}

function buildpic_hovers(){
var divnodes = document.getElementsByTagName("div");
for(var i=0;i<divnodes.length; i++){
        if(divnodes[i].className =="footer"){
	   var children = divnodes[i].childNodes;
	   var a = [];
		for(var j=0;j<children.length; j++){
	   		if(children[j].className == "pinfo"){
			a.push(j);
			}
			else if (children[j].className =="picture"){
			a.push(j);
			}
		}
		divnodes[i].onmouseover=function(){
		this.childNodes[a[0]].style.visibility="visible";
		this.childNodes[a[1]].style.visibility="visible";
		this.style.color="white";
		this.style.cursor="pointer";
		}
		divnodes[i].onmouseout=function(){
		this.childNodes[a[0]].style.visibility="hidden";
		this.childNodes[a[1]].style.visibility="hidden";
		this.style.color="#11b0f2";
		}
		}
	}
}
var preloadFlag = false;
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function preloadImages() {
	if (document.images) {
		home_29_over = newImage("images/home_29-over.gif");
		home_32_over = newImage("images/home_32-over.gif");
		preloadFlag = true;
	}
}

if (window.addEventListener){
window.addEventListener("load", buildsubmenus_horizontal, false);
window.addEventListener("load", buildname_hovers, false);
window.addEventListener("load", preloadImages, false);
}
else if (window.attachEvent){
window.attachEvent("onload", buildsubmenus_horizontal);
window.attachEvent("onload", buildname_hovers);
window.attachEvent("onload", preloadImages);
}
