;(function($) {

$.fn.tabs = function(options) {

	var $elm = $(this);
var $nav = $('ul', $elm).eq(0);
	var $tabs = $('a', $nav);
	var $panels = $nav.siblings();
	var $selected = -1;
	
		_resetTabs();
		$tabs.eq(0).addClass('active');
	$panels.eq(0).show();	


	
	
	

	
	
	$tabs.bind('click',function(){
		_resetTabs();
		$(this).addClass('active');
			var $index  = $tabs.index(this);
		 	$panels.eq($index).show();
		return false;
	})
	
	function _setTab(index){
		_resetTabs();
		$tabs.eq(index).addClass('active');
		$panels.eq($index).show();
	}
	
	function _resetTabs(){
		$tabs.each(function(){
			 $(this).removeClass('active');
	
	});
		$panels.each(function(){
			 $(this).hide();
	
	});
	
		
	}
	
}

})($);






