$(function () {
  
  // Dropdown menus
  $("#header .navigation li.dropdown").hover(function (e) {
    $(this).find(".coverup").width($(this).width()); // HACK coverup
    $(this).addClass("over");
    
    $(this).siblings(".dropdown").removeClass("over");
    
    // HACK for ie6 haslayout
    if ($.browser.msie && $.browser.version == "6.0") {
      var w = $(this).find("ul").width();
      $(this).find("ul a").css("zoom","1");
      $(this).find("ul").width(w);
    }
  }, function (e) {
    $(this).removeClass("over");
  });
  
  if ($.browser.msie && $.browser.version == "7.0") {
    $("#header .navigation li.dropdown a").mouseleave(function (e) {return false;});
    $("#header .navigation li.dropdown .coverup").mouseleave(function (e) {return false;});
  }
  
  // Popout image links
  $("a[target='popup']").click(function (e) {
    window.open($(this).attr("href"), $(this).attr("target"), "width=616px, height=600px");
    return false;
  });
});
