// Easing
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend(jQuery.easing, {
  def: 'easeInOutCirc',
  swing: function (x, t, b, c, d) {
    return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
  },
  easeInCirc: function (x, t, b, c, d) {
    return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
  },
  easeOutCirc: function (x, t, b, c, d) {
    return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
  },
  easeInOutCirc: function (x, t, b, c, d) {
    if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
    return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
  }
});

$(document).ready(function(){
  $(".prevNext span").css({"opacity":"0"});
  $("#theBigPicture").hover(function(){
    $(".prevNext span").animate({"opacity":"1"}, 300);
  }, function(){
    $(".prevNext span").animate({"opacity":"0"}, 500);
  });
  $(".controls li a").live("click", function(){
    var targ = $(this).attr("href");
    if ( $(this).parent().hasClass("current") ) {
      $(".controls .tabPanel").slideUp(500);
      $(".controls ul .current").removeClass("current");
    } else {
      if ( $(".controls li").hasClass("current") ) {
        $(".controls .tabPanel").hide();
        $(targ).show();
      } else {
        $(targ).slideDown(500);
      }
      $(".controls ul .current").removeClass("current");
      $(this).parent().addClass("current");
    }
    return false;
  });
});
