// JavaScript Document

timeout = "";

$(window).load(function() {
// Initialize the product tabs
        initProductTabs();
		addHover();
		$('div.equal').equalHeightColumns();
		timeout = window.setTimeout(function(){
					$(".tab_links .button").eq(1).click();
					}, 8000);
});

function initProductTabs(){
    $(".tab_links .button").click(function(e){
        e.preventDefault();	
		clearTimeout(timeout);
        
        if($(this).hasClass('active')){
            return;
        }
        
        index = $(this).index();
        
        $(this).siblings().removeClass('active');
        $(this).addClass('active');
        $(".tabs").each(function(){
            $(this).children(".tab").fadeOut(400);
			current = $(this);
            setTimeout(function(){$(current).children(".tab").eq(index).fadeIn(600);}, 400);
			if(index == 2){
				timeout = window.setTimeout(function(){
					$(".tab_links .button").eq(0).click();
					}, 9000);
			}
			else{
				timeout = window.setTimeout(function(){
					$(".tab_links .button").eq(index + 1).click();
					}, 9000);
			}
        })
        
    });
};



function addHover(){
    $("div.equal a.zone").bigTarget({
        hoverClass: 'hover', // CSS class applied to the click zone onHover
        clickZone : '.equal' // jQuery parent selector
    });
}
