jQuery.fn.simpletabs = function (options) {
	settings = jQuery.extend({
		//
	}, options);
	
    return this.each(function(){
		var $this = $(this);
		var _selected = null;
	
	//	find out the tabs max height and apply it to the container
	//	hide the tabs showing only the first one
		var h = 0;
		var first = true;
		$('.tabsTab', $this).each(function () {
			var nh = $(this).outerHeight();
			if (h < nh) h = nh;
			$(this).hide();
		});
		$('.tabsContainer', $this).height(h);
		
	//	init the links
		var first = true;
		$('ul.tabsLinks li a', $this).each(function () {
			$(this).click(function () {
				selectTab(this);
				return false;
			});
			if (first) {
				selectTab(this);
				first = false;
			}
		});
		
		function selectTab (el) {
			var _el = $(el);
			if (_selected == el) return;
			_el.parent().addClass('selected');
			$(_el.attr('href')).show();
			if (_selected) {
				$(_selected).parent().removeClass('selected');
				$($(_selected).attr('href')).hide();
			}
			
			_selected = el;
		}
    });
};
