var allDIVTags = new Array();
var capture = new Array();
var res_pass = 1;
run = 0;

function results() {
	//Create Array of All DIV Tags
	allDIVTags=document.getElementsByTagName('DIV');

	//Loop through all tags using a for loop
	for (i=0; i<allDIVTags.length; i++) {
	
		//Get all tags with the specified class name.
		this_div = allDIVTags[i].className;
		if(this_div.substr(0, 7) == 'result_') {
			capture.push(i);
		}
	}
	
	if(capture.length > 0) {
		res_interval = setInterval(results_show, 5000);
	}
}

function results_show() {
	for(i=0; i<capture.length; i++) {
		v = capture[i];
		allDIVTags[v].style.display = 'none';
		if(res_pass == i) {
			//tmp = 0;
			allDIVTags[v].style.display = 'block';
		}
	}
	res_pass++;
	if(res_pass >= capture.length) res_pass = 0;
}

function peek(x) {
	if(tmp == 0) alert('x=' + x);
	tmp += 0.1;
	allDIVTags[x].style.height = tmp + 'em';
	allDIVTags[x].style.display = 'block';
	if(tmp == 4.5) {
		clearInterval(peek_interval);
		res_interval = setInterval(results_show, 5000);
	}
}
