//
// Minitabs 0.1
// Requires jquery
//
// http://code.google.com/p/minitabs/
//
// Usage :
//
// $("#container").minitabs([speed],[slide|fade]);
//
// db: renamed id to my_id and IE likes it now
// db: added fix from web site to add current class to li also
//

jQuery.fn.minitabs = function(speed,effect) {
  my_id = "#" + this.attr('id');
  $(my_id + ">DIV:gt(0)").hide();
  $(my_id + ">UL>LI>A:first").addClass("current");
  $(my_id + ">UL>LI:first").addClass("current");
  $(my_id + ">UL>LI>A").click(
    function(){
      $(my_id + ">UL>LI>A").removeClass("current");
      $(my_id + ">UL>LI").removeClass("current");
      $(this).addClass("current");
      $(this).parent().addClass("current");
      $(this).blur();
      var re = /([_\-\w]+$)/i;
      var target = $('#' + re.exec(this.href)[1]);
      var old = $(my_id + ">DIV");
      switch (effect) {
        case 'fade':
          old.fadeOut(speed).fadeOut(speed);
          target.fadeIn(speed);
          break;
        case 'slide':
          old.slideUp(speed);  
          target.fadeOut(speed).fadeIn(speed);
          break;
        default : 
          old.hide(speed);
          target.show(speed)
      }
      return false;
    }
 );
}


