// JavaScript Document
var milInterval = 10000;

function showItems2() {
	var index = this.values.length;
	if (index > 1)
		do { index=Math.floor(Math.random()*this.values.length); } while (this.lastItem == index);
	
	for (var i=0;i<arguments.length;i++) {
		if(this.values.length > 0)
			document.getElementById(arguments[i]).innerHTML = this.values[index][i];
	}
	this.lastItem = index;
}

function showMore() {
	eval(reloadFunc);
	reset_Int(reloadFunc,milInterval);	
}

function rotArray() {
	this.values = new Array();
	this.showItems = showItems2;
	this.lastItem = null;
}

var intval="";
function start_Int(action,interval) {
	if(intval==""){
		intval=window.setInterval(action,interval)
	}else{
		stop_Int()
	}
}

function stop_Int(){
	if(intval!=""){
		window.clearInterval(intval)
		intval=""
	}
}

function reset_Int(action,interval) {
	stop_Int();
	start_Int(action,interval);
}

function reset_Timer() {
	// reloadFunc and milInterval must be set in another JS file.
	start_Int(reloadFunc,milInterval);
}