// TABS -------------------------------------------------------------------------

var rotateSpeed = 10000; 	// Milliseconds to wait until switching tabs.
var currentTab = 0; 		// Set to a different number to start on a different tab.
var numTabs; 				// These two variables are set on document ready.
var autoRotate;

function openTab(clickedTab) {
	var thisTab = $(".tabBox ul a").index(clickedTab);
	$(".tabBox ul li a").removeClass("active");
	$(".tabBox ul li a:eq("+thisTab+")").addClass("active");
	$(".tabBox .tabContent").hide();
	$(".tabBox .tabContent:eq("+thisTab+")").fadeIn("slow");
	currentTab = thisTab;
}
function rotateTabs() {
	var nextTab = (currentTab == (numTabs - 1)) ? 0 : currentTab + 1;
	openTab($(".tabBox ul li a:eq("+nextTab+")"));
}

/**
 * Equal Heights Plugin
 * Equalize the heights of elements. Great for columns.
 *
 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
 *
 * Usage Example: $('.columns').equalHeights();
 *
 */
(function($) {
	$.fn.equalHeights = function() {
		tallest = 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		return this.each(function() {
			$(this).height(tallest);
		});
	}
})(jQuery);

$(document).ready(function() {	
	$(".tabContent").equalHeights();
	numTabs = $(".tabBox ul li a").length;
	$(".tabBox ul li a").click(function() { 
		openTab($(this)); return false; 
	});
	$(".tabBox").mouseover(function(){clearInterval(autoRotate)})
	.mouseout(function(){autoRotate = setInterval("rotateTabs()", rotateSpeed)});	
	$(".tabBox ul li a:eq("+currentTab+")").click()
	$(".tabBox").mouseout();	
//	$("dl.tabContent dd:odd").css("background-color", "#F1F5FA");
//	autoOpenToggle();		
});;
