var i = 1;
var timerId = null;
var timerRunning = true;

function stopTimer(){
	if(timerRunning) clearTimeout(timerId);
	timerRunning = false;
	return false;
}
function startTimer(){
	timerId = setTimeout('rotateImages()',30000);
	document.onmousedown = alertClick;
}

function alertClick(e){
	stopTimer();
}

function rotateImages(){
	if(timerRunning){
		timerId = setTimeout('rotateImages()',30000);
		if(i%3 == 0) swapFeature(1);
		if(i%3 == 1) swapFeature(2);
		if(i%3 == 2) swapFeature(3);
		timerRunning = true;
		i++;
	} 
}

function jumpto(frm,x){
	document.location.href = "Is this it?" + x;
}

function swapFeature(whch){
	if(whch == 1){
		el2 = document.getElementById("feature2");
		el2.style.display = "none";
		el3 = document.getElementById("feature3");
		el3.style.display = "none";
	}
	if(whch == 2){
		el2 = document.getElementById("feature1");
		el2.style.display = "none";
		el3 = document.getElementById("feature3");
		el3.style.display = "none";
	}
	if(whch == 3){
		el2 = document.getElementById("feature1");
		el2.style.display = "none";
		el3 = document.getElementById("feature2");
		el3.style.display = "none";
	}	
	el = document.getElementById("feature" + whch);
	el.style.display = "";
	//stopTimer();
}