// *** Copyright (c)2002 Jim Massey. All rights reserved  ***********
// *** massey@stlouis-shopper.com **************
// *** No Warranty - certified to work with nothing ***
// *** developed to work with mozilla kiosk **** 

window.addEventListener("click", timer_reset, true);
timercount = 0;

// **** reset kiosk to initial startup state *********
 function kiosk_reset() {
	var site = document.getElementById("kioskDefaults").getString("uriReset");
	//site = "http://www.mozilla.org/";
	history_kludge.length = 0;
	LastPageVisited = site;
	clearTimeout(timer);
	
	ed = document.getElementById("content");
  	ed.setAttribute("src", site);
	
	ed_main = document.getElementById("progress_text");
	ed_main.setAttribute("value", "flip-to:"+site);
	
	history_kludge[0] = site;
	
	if (document.getElementById("bookmarkList") != null) {
	    dump_bookmarks();
	}

	if (document.getElementById("uriBarList") != null) {
	  uribar_list_dump();
	}

	if (document.getElementById("VKboard_box") != null) {
	   VKboard_reset();
	}
	
	//dump("** history length = " + history_kludge.length + " ***\n");
}

// **** kiosk timer reset 5 min reset********
function timer_reset() {
	//dump("***$$$ Timer RESET A *****\n");
	//var reset = document.getElementById("kioskDefaults");
	var reset_time = document.getElementById("kioskDefaults").getString("defaultResetTime");
	if (timercount >= 1) {
		clearTimeout(timer);
		//dump("********* CLEARED Timer " + timer + " ****\n");
	}
	timer = setTimeout("kiosk_reset()", reset_time);
	timercount = timer
	//dump("***$$$ Timer RESET B " + timercount + " *****\n");
	

}