$.tabs = function(selector, start) {
	
	$(selector).each(function(i, element) {
		$($(element).attr('tab')).css('display', 'none');
		
		$(element).click(function() {
			//window.location.hash = $(this).attr('tab');

			$(selector).each(function(i, element) {
				$(element).removeClass('selected');
				
				$($(element).attr('tab')).css('display', 'none');
			});
			
			$(this).addClass('selected');
			
			$($(this).attr('tab')).css('display', 'block');
			
		});
	});
	
	if (!start) {
		start = $(selector + ':first').attr('tab');
	}

	if(window.location.hash){
		$('a[tab=\''+window.location.hash+'\']').trigger('click');
	}else{
		$(selector + '[tab=\'' + start + '\']').trigger('click');
	}

};
