//SuckerTree Vertical Menu 1.1 (Nov 8th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/
//modified by Erich Munz


var imgPath = '';


function buildmenus(_menuids, _imgPath, _images){
    if (_imgPath != '')
        imgPath = _imgPath;
    var menuids = _menuids.split(",");
    var tmpElement = null;
    var imgName = '';

    for (var i = 0; i < menuids.length; i++) {
        var ultags = document.getElementById(menuids[i]).getElementsByTagName("ul");

        for (var t = 0; t < ultags.length; t++) {
            ultags[t].parentNode.getElementsByTagName("a")[0].className = "subfolderstyle";
            ultags[t].style.left = ultags[t].parentNode.offsetWidth + 1 + "px";

            ultags[t].parentNode.onmouseover = function(){
                tmpElement = this.getElementsByTagName("a")[0];
                imgName = tmpElement.getAttribute('id');
                if (_images.indexOf(imgName) > -1)
                    tmpElement.style.backgroundImage = "url('" + imgPath + imgName + "_1.jpg')";
                else
                    tmpElement.style.backgroundColor = "#D6E4B3";
                this.getElementsByTagName("ul")[0].style.display = "block";
            }

            ultags[t].parentNode.onmouseout = function(){
                tmpElement = this.getElementsByTagName("a")[0];
                imgName = tmpElement.getAttribute('id');
                if (_images.indexOf(imgName) > -1)
                    tmpElement.style.backgroundImage = "url('" + imgPath + imgName + "_0.jpg')";
                else
                    tmpElement.style.backgroundColor = "#FFF";
                this.getElementsByTagName("ul")[0].style.display = "none";
            }

        }

        for (var t = ultags.length - 1; t > -1; t--) {
            ultags[t].style.visibility = "visible";
            ultags[t].style.display = "none";
        }
    }
}