jQuery(function($) {
  // List Elements
  $("ul li:last-child").addClass("last");
  $("ul li:first-child").addClass("first");
  $('.case:even').addClass('even');
  $('.case:odd').addClass('odd');
  $('table tbody tr:even').addClass('even');
  $('table tbody tr:odd').addClass('odd');
  
  // Clear on focus
  $("#searchform input").focus(function() {
    if (this.value == this.defaultValue) {
      this.value = "";
      $(this).addClass('filled');
    }
  }).blur(function() {
    if (!this.value.length) {
      this.value = this.defaultValue;
      $(this).removeClass('filled');
    }
  });
  
  $('a#expand').toggle(function() {
    $('table#compTable').animate({
      width: '940',
      left: '-250'
    }, 500);
    $(this).html('Contract Table');
  }, function() {
    $('table#compTable').animate({
      width: '100%',
      left: '0'
    }, 500);
    $(this).html('Expand Table');
  });
  
  $('a.popupTrigger').hover(function(e) {
    $(this).siblings().fadeIn();
  }, function() {
    $('.popup').fadeOut();
  })
});


