jQuery.fn.tabs = function() {
    var elt = $(this[0]); // It's your element
	elt.children('div').hide();
	elt.children('div:first').show();
	
	elt.children('ul:first').children('li:first').addClass('active');
	elt.children('ul:first').children('li').children('a').click(function(){ 
		elt.children('ul').children('li').removeClass('active');
		$(this).parent().addClass('active'); 
		var currentTab = $(this).attr('href'); 
		elt.children('div').hide();
		$(currentTab).show();
		return false;
	});
};