/*
*	jQuery Tabber Plugin
*	Version 1.1
*	Copyright (c) 2010 Simon Smith - http://www.blink-design.net/codebin
*	Dual licensed under the MIT and GPL licenses
*	Requires jQuery 1.4 or higher
*/
;(function($){$.fn.tabber=function(options){var o=$.extend({},$.fn.tabber.defaults,options);return this.each(function(){var obj=$(this);var wrap=$('<div></div>').addClass(o.wrap);var lists=obj.find('ul:not(ul ul)');var nav=lists.filter('ul:eq(0)');var content=lists.filter('ul:eq(1)');var plugin={};plugin.tabber=function(){function doclick(link){nav.find('> li').removeClass(o.current);link.parent().addClass(o.current);return link.parent().index()}function switchcontent(i){switch(o.animate){case'fade':content.find('> li:visible').stop().fadeOut(o.speed,function(){content.find('> li').eq(i).fadeIn(o.speed)});break;case'slide':content.find('> li:visible').stop().slideUp(o.speed,function(){content.find('> li').eq(i).slideDown(o.speed)});break;case'both':content.find('> li:visible').stop().animate({'height':'toggle','opacity':'toggle'},o.speed,function(){content.find('> li').eq(i).animate({'height':'toggle','opacity':'toggle'},o.speed)});break;default:content.find('> li:visible').hide().end().find('> li').eq(i).show()}}return{switchtabs:function(){nav.find('li a').click(function(){if($(this).parent().hasClass(o.current))return false;var i=doclick($(this));switchcontent(i);return false})},init:function(){obj.children().wrapAll(wrap);nav.find('li:eq('+o.tab+')').addClass(o.current);content.find('> li:not(:eq('+o.tab+'))').hide();this.switchtabs()}}}();plugin.tabber.init()})};$.fn.tabber.defaults={wrap:'tabber',current:'current',animate:'',speed:'',tab:0}})(jQuery);
