

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

var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus(){
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"
    		
    	//if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
			ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
		//else //else if this is a sub level submenu (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.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
		for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
		ultags[t].style.visibility="visible"
		ultags[t].style.display="none"
		}
  }
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)




/**
$j(document).ready(function () {
    $j("li.mnc").hover(
        function () {
            $j($j(this).children('ul:first')[0]).show();
            $j($j(this).children('ul:first')[0].children('li').children('ul:first')[0]).hide();
        },
        function()
        {
            $j($j(this).children('ul:first')[0]).hide();
            $j($j(this).children('ul:first')[0].children('li').children('ul:first')[0]).hide();
        }
    );

    function setmargin(){
        $j('ul.mnc').each(function(index) {
            $j(this).show();
            var pwth = $j(this).width();
            $j($j(this).children('li').children('ul')).attr('style','margin-left:' + pwth +'px !important;');
        });
        $j('ul.mnc').each(function(index) {
            $j(this).hide();
        });
        $j('ul#nav0').show();

    }
    setmargin();

    // Set menu items with for <= IE 7 
    function setMenuItemWidthIE7() {
        // Find widths
        $j('ul.mnc li').each(function() {
            var width = $j(this).children('ul').css('margin-left');
            if (width && width != undefined) {
                $j(this).attr('style', 'width:' + width + ' !important');
            } else {
                var widthh = $j(this).next().children('ul').css('margin-left');
                if (widthh && widthh != undefined) {
                    $j(this).attr('style', 'width:' + widthh + ' !important');
                } else {
                    var widthhh = $j(this).children('a').children('span').text().length;
                    $j(this).parent().children('li').each(function(){
                        if ($j(this).children('a').children('span').text().length > widthhh) {
                            widthhh = $j(this).children('a').children('span').text().length;
                        }
                    });
                    widthhh = widthhh < 10 ? 
                                widthhh*11 :
                                widthhh < 15 ?
                                    widthhh*10 :
                                    widthhh < 20 ?
                                        widthhh*9 :
                                        Math.ceil(widthhh*7.5);
                    $j(this).attr('style', 'width:'+ widthhh +' !important');
                    $j(this).mouseover(function(){
                         $j(this).width(widthhh +'px');
                    });
                    $j(this).parent().width(widthhh +'px');
                }
            }
        });
        // Resize widths
        $j('ul.mnc li').each(function() {
            var width = $j(this).children('ul').css('margin-left');
            if (!width || width == undefined) {
                var widthh = $j(this).parent().width();
                $j(this).parent().children('li').each(function(){
                   if ($j(this).width() > widthh) {
                       widthh = $j(this).width();
                   }
                });
                $j(this).width(widthh);
                $j(this).mouseover(function(){
                     $j(this).width(widthh);
                });
                $j(this).parent().width(widthh);
            }
        });
    }
    if ($j.browser.msie && Math.floor($j.browser.version) <= 7) {
        setMenuItemWidthIE7();
    }
		
});
**/ 
// For the category page - set the height of the li with the bigest one
$j(document).ready(function () {
    $j(".category-inpage-navigation ul").each(function (){
        var maximWidth = $j(this).width();
        var maximWidthLi = 0;
        var maximHeightLi = 0;
        var row = 1;

        var firstLi = $j(this).children("li").first();
        firstLi.addClass('first');
        
        $j(this).children("li").each(function (){           
            maximWidthLi += $j(this).width();

            if (maximWidthLi > maximWidth) {
                firstLi.removeClass('first');
                firstLi.removeClass('no-border');

                $j(this).addClass('first');
                $j(this).addClass('no-border');
                firstLi = $j(this);

                row ++;
                maximWidthLi = 0;
            }

            var currentLiHeight=$j(this).height();
            if (currentLiHeight > maximHeightLi) {
                maximHeightLi = currentLiHeight;
            }			
        });

        if (row == 1) {
            firstLi.addClass('no-border');
        }
		 
        $j($j(this).children("li")).attr("style","height:" + maximHeightLi + "px;")
		
    });
	 
    $j(".category-inpage-navigation ul li").hover(function() {
        $j(this).addClass("hover");
    },
    function () {
        $j(this).removeClass("hover");
    }
    );
});
/** 
function setHeightDinamique(){
    var heightNeeded = $j('.product-essential').height();
    heightNeeded = heightNeeded + 212; // compensation
    $j('.question-ask-content').css("top", heightNeeded + "px");
} 

$j(document).ready(function () {
    setTimeout("setHeightDinamique()",3000);
});	
**/
