$(function () {
  Cufon.now();
  
  $li = $('#nav>ul>li');
  $li.mouseenter(function (e) {
    $(this).children('a').addClass('hover');
  }).mouseleave(function (e) {
    $(this).children('a').removeClass('hover');
  })
  
  $li.hover(
    function (e) {
      var $this = $(this),
          $ul   = $this.find('ul');
        
      $this
        .children('.droparrow').show().end()
        //.children('.drop').slideDown(100).end()
        .children('.drop').show().end()
        .find('li').width($ul.width());
    },
    function (e) {
      $(this)
        .children('.droparrow').hide().end()
        //.children('.drop').slideUp(100);
        .children('.drop').hide();
    }
  );
  
  $li.each(function () {
    if ($('.drop', this).length > 0) {
      $(this).children('a')
        .click(function () { return false; })
    }
  });
  
  $names = $('div.team-name');
      
  if ($names.length) {
    $names
      .mouseover(function (e) {
        if (!$(this).hasClass('team-click')) {
          $(this).addClass('team-hover');
        }
      })
      .mouseout(function (e) {
        $(this).removeClass('team-hover');
      })
      .click(function (e) {
        $names.each(function () {
          $(this).removeClass('team-click');
        });
        
        $(this).addClass('team-click');
        $('#team-content').html($(this).parent().next().html());
      });
  
    $('.first').children('.team-name').click();
  }
});
