/* called immediately after loading*/ Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6; Prototype.Browser.IE7 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 7; Prototype.Browser.IE8 = Prototype.Browser.IE && !Prototype.Browser.IE6 && !Prototype.Browser.IE7; /*adjust heights*/ Event.observe(window, 'load', function() {adjustTopMenuPopupItemsPositions(); positionTopMenuArrows();}); Event.observe(window, 'resize', function() {adjustTopMenuPopupItemsPositions();}); /* functions */ function adjustTopMenuPopupItemsPositions(){ $$('body div').each(function(s) { if ((s.id+"").include("Menu")) { if (s.ancestors().size() == 4 && Prototype.Browser.IE6){ s.style.marginLeft = /*parseInt(s.style.marginLeft) +*/ (s.ancestors()[3].getWidth()/*html element*/ -$('header').getWidth()/*header elment - positioned absolute*/ )/2 +"px"; }else if (s.ancestors().size() == 2){ s.style.marginLeft = /*parseInt(s.style.marginLeft) +*/ (s.ancestors()[1].getWidth()/*html element*/ -$('header').getWidth()/*header elment - positioned absolute*/ )/2 +"px"; } } }); } function positionTopMenuArrows(){ $$('ul#nav li div a.with_submenu ').each(function(s) { x = s.getWidth()-25; s.style.backgroundPosition = x+"px 34px"; //alert(s.style.backgroundImage); }); }