var tables;
var tabs;
var tableName;
$(document).ready(function() {
	tableName;
	tabs = $('ul.tabs').find('li');
	tables = $('table.tab');
	
	setTimeout("ultabs()", 1000);
});

function ultabs() {
	tables.each(function() {
		if($(this).hasClass('active') === false) {
			$(this).hide();
		}
	});
	tabs.click(function() {
		var active = tabs.find('span.active');
		active.removeClass('active');
		$(this).find('span').addClass('active');
		tableName = $(this).attr('id');
		tables.each(function() {
			$(this).hide();
			if($(this).hasClass(tableName)) {
				$(this).show();
			}
		});
	});
}

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});

	group.height(tallest);
}

function equalWidth(group) {
	var widest = 0;
	group.each(function() {
		var thisWidth = $(this).width();
		if(thisWidth > widest) {
			widest = thisWidth;
		}
	});

	group.width(widest);
}
