var secs;					//	For Storing the Seconds
var cycles;				//	rotational cycles
var timerId;				//	For Storing timer id 
var timerRunning = false;		//	initialy timer running will be in NULL
var delay = 8000;	

$(document).ready(function() {	
	cycles = 0;
	secs = 0;			
	timerRunning = true;
	switchTab();
	timerId = window.setInterval(switchTab, delay);
});


function switchTab() {
	//alert(secs);
	if (secs == 2) { //last tab
		secs = 0;
		cycles++;
		if (cycles == 2)									
			window.clearInterval(timerId);
	}
	secs++;
	showRandom(secs);					
}
			
function stopTheClock()	{		//	For Stop the Timer function	
	if (timerRunning) {
		window.clearInterval(timerId);
		timerRunning = false;
	}
}
	



