(function($) {
     var o          = null;
     var $data      = null;
     var $this      = null;
     
     $.fn.simpleTabs = function(options) {
          //debug(this);
          
          var opts = $.extend({}, $.fn.simpleTabs.defaults, options);

          return this.each(function() {
               $this = $(this);
               // build element specific options
               o = $.meta ? $.extend({}, opts, $this.data()) : opts;

               //Default Action
               $(".tabBody").hide(); //Hide all content
               $(".tabs .tab-0").addClass("active").show(); //Activate first tab
               $(".tabBody-0").show(); //Show first tab content

               //On Click Event
               $(".tabs span a").click(function() {
                    if($(".tabBody").is(':animated')){
                         return false;
                    }
                    $(".tabs span.button ").removeClass("active"); //Remove any "active" class
                    $(this).parents('span').addClass("active"); //Add "active" class to selected tab
                    
                    $(this).parents('li.frame').find(".tabBody").hide(); //Hide all tab content
                    $(this).stop();
                    var activeTab = $(this).attr("href"); //Find the rel attribute value to identify the active tab + content
                    $(activeTab).fadeIn(o.speed, function(){
                         //showing = false;
                    }); //Fade in the active content
                    return false;
               });
               
          });
     };

     function debug($obj) {
          if (window.console && window.console.log){
               window.console.log($obj);
          }
     }; 
     
     $.fn.simpleTabs.defaults = {
          speed:  500,
          tabContent:    '.tabBody'
     };

//
// end of closure
//
})(jQuery);
