jQuery.fn.mytabs =function(){
	
	$('.tab', this).click(switch_tab);
	
	function switch_tab() 
	{
		var obj = $('.tabs-collection .tab.active');
		
		obj.addClass('unactive');
		if (!$('.tabs-collection .tab.active').next().size())
			$('.tabs-collection .tab.active:last .wrp').addClass('unactive-last');
		obj.next().removeClass('after-active');
		var prev = $('.tabs-collection .tab.active:last').prev();		
		prev.removeClass('after-active');
		$('.wrp', prev).removeClass('before-active');		
		obj.removeClass('active');
		
		
		$(this).removeClass('unactive').addClass('active');
		prev = $(this).prev();
		$('.wrp', prev).addClass('before-active');
		
		$(this).next().addClass('after-active');
		
		
		var tab = $('a', this).attr('href');
		tab = tab.substring(1, tab.length);
		
		$('.tab-data.active').fadeOut(500, function(){
			$(this).removeClass('active');
			$('.'+tab).addClass('active').fadeIn(500);
		});		
	}
};
