$(document).ready(function(){
  timeDown = 200;
  timeUp   = 400;
    $("ul.a-nav-main A").mouseover(function() {
        //Following events are applied to the subnav itself (moving subnav up and down)
        $(this).parent().find("ul.nav-depth-1").stop(true,true).each(function(){ //Drop down the subnav on click  

          // execute this only in IE7-
          if ($.browser.msie && $.browser.version.substr(0,1)<=7) {
            // repair wrong widths of menu items
            $(this).parent().find("ul.nav-depth-1>LI>A").css('width',$(this).parent().width()+40);  
            // repair wrong layer order
            $('DIV#a-content').css('z-index','-1');
            $('DIV.v_subnav-container UL LI').css('z-index','-1');
            // a higher speed is nececary in IE7- because of the width-repair above (slow=ugly)
            timeDown=50;
          }
        }).hide().slideDown(timeDown).show();
        $(this).parent().hover(function() {  //When the mouse hovers out of the subnav, move it back up
        }, function(){  
            $(this).find("ul.nav-depth-1").slideUp(timeUp).each(function(){

              // execute this only in IE7-: undo layer order repair
              if ($.browser.msie && $.browser.version.substr(0,1)<=7) {
                $('DIV#a-content').css('z-index','1');
                $('DIV.v_subnav-container UL LI').css('z-index','1');
              }

           }); 
        });  
    });  
});  
