document.observe("dom:loaded", function() {
    $$('#nav > li.li1').each(function(el, i) {                
        if (el) {
            var L1Width = 0;
            var L2Width = 0;        
            L1Width = $(el).getWidth() -42;

            $(el).select('ul > li').each(function(el2, i) {            
                L2Width = $(el2).getWidth();
                if(L2Width <= L1Width) {
                    $(el2).setStyle({
                        'width' : L1Width + 'px'							
                    });
                    obj = $(el2).up(0);
                    if(obj.getAttribute('className') != null) { // IE                       
                        document.getElementById(obj.id).setAttribute('className','round_submenu2');
                    } else {
                        document.getElementById(obj.id).setAttribute('class','round_submenu2');                        
                    }
                } 
            });
        }
    });                       
});


if (!window.XMLHttpRequest) {

    sfHover = function() {
        var sfEls = document.getElementById("nav").getElementsByTagName("LI");
        var el = null;
        for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover=function() {
                this.className+=" sfhover";
                if (this.childNodes[0].className == 'top_link') {
                    
                    if(el) {
                        el = this.childNodes[0];
                        el.className += " hover";
                    }
                }
            }
            sfEls[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
                if(el) {
                    el.className = 'top_link';
                }
            }
        }
    }
    if (window.attachEvent) window.attachEvent("onload", sfHover);
}
function showElement(id){
    //alert(id);
    document.getElementById(id).style.display="block";

}
function hideElement(id){
    //alert(id);
    document.getElementById(id).style.display="none";

}
