<!--

var runningtimeout
var a = 10
var h = 100
var k = 500
var atimer = "off"
var htimer = "on"
var ktimer = "off"
var endtimeout = "false"
var timercounter
var oldlocn
var adoldlocn

function closeTimeouts() {
	endtimeout = "true"
}

function thetimeout() {
	if (endtimeout == "true") {
		clearTimeout(runningtimeout)
		return false;
	}
	timercounter++
	if (timercounter == 10001) {
		timercounter = 0
	}
	document.applets.dataapplet.timeoutcounter = timercounter
	
	if ((timercounter/(a+1)) - Math.floor(timercounter/(a+1)) == 0 && atimer == "on") {
		findCoordinates()
		globaltolocaltime()
	}
	if ((timercounter/(h+1)) - Math.floor(timercounter/(h+1)) == 0 && htimer == "on") {
		settonow()
		if (oldlocn != currentlocn) {
			if(document.searchformbuttons.searchtype[1].checked == true) {
				DoSearch()
				//ktimer = "on"
			}
			else {
				vbrOnLoad()
				//ktimer = "on"
			}
		}
		oldlocn = currentlocn
	}
	if ((timercounter/(k+1)) - Math.floor(timercounter/(k+1)) == 0 && ktimer == "on") {
		if (adoldlocn != currentlocn) {
			refreshAd(itssearch)
			refreshtopAd(itssearch)
			ktimer = "off"
		}
		adoldlocn = currentlocn
	}
	runningtimeout = setTimeout("thetimeout()",0)
}

function refreshAd(itssearch) {
	var currentTime = new Date();
	//google_ad_top.innerHTML ="<a href='http://www.oddflower.com'><img src='images/oddflowerad3.gif' border='0' width='468px' height='60px'></a>"
	google_ad_bottom.location = "adbottom1.jsp?s=" + currentTime.getTime() + "&q="+itssearch+"&ad="+asubject; 
}

function refreshtopAd(itssearch) {
	var currentTime = new Date();
	google_ad_top.location = "adtop.jsp?s=" + currentTime.getTime() + "&q="+itssearch+"&ad="+asubject;
}

//-->