$(window).load(
  function() {
    var menuItems = $('ul#menu li');
    var menuWidth = $('ul#menu').width();
    
    if ($.browser.msie && $.browser.version <= 6.0) {
      menuWidth = 669;
    }
    
    var itemWidth = Math.floor(menuWidth / menuItems.length);
    
    menuItems
    .each(
      function(index) {
        if (index < menuItems.length - 1) $(this).width(itemWidth);
        else $(this).width(menuWidth - (itemWidth * (menuItems.length - 1)));
      }
    ) 
    .hover(
      function() {
        $(this) 
        .addClass('hover');
        
        $('ul#menu li:not(li.hover)') 
        .stop() 
        .animate({
            opacity : 0.35
          }, {
            duration : 200
          });
      },
      function() {
        $('ul#menu li:not(li.hover)') 
        .stop() 
        .animate({
            opacity : 1
          }
        );
        
        $(this) 
        .removeClass('hover');
      }
    ) 
    .click(
      function() {
        location.href = $(this).find('a').attr('href');
      }
    );
    
    $('div#contents-background') 
    .css({
        opacity : 0.65
      }
    );
  }
);
 
