// JavaScript Document

var total=2;   // enter total number of tabs
var z;
var counter=0;
function autoprogress(tab){
	$('.inLatestTabContent').hide();
	$('.'+tab).fadeIn(750);
	next = tab;
	if (next == total){next = 1;}else{next++;}
	counter=tab;
	z=setTimeout ('autoprogress(next)', 10000);
}

function changeTab(tab){
	clearTimeout(z);
	autoprogress(tab);
}

function toNext(){
	if (counter==total){
		changeTab(1);	
	}else{
	counter++;
	changeTab(counter);
	}
}

function toPrevious(){
	if (counter==1){
		changeTab(total);	
	}else{
	counter--;
	changeTab(counter);
	}
}

/*
function pause(){
	clearTimeout(z);
}

function restart(){
	restart(z); 
	
}
*/