//	scripts for webcam pages
//	upd 20051010 mh

libWebcam=[];

libWebcam.livecamRefresh=function(id,lang){
	//	script to initiate reload script for webcam images: libWebcam.livecamRefresh('imageID','de');
	//	will call itself every minute. language currently not used.
	//	cr mh 10.7.2005
	if(document.getElementById){
		libWebcam.dorefresh(id);
		setTimeout("libWebcam.livecamRefresh('"+id+"','"+lang+"')",60000);
	}else{
		setTimeout("self.location.reload()",60000)
	}
}
libWebcam.dorefresh=function(id){
	//	script to call new single webcam image: libWebcam.dorefresh('imageID');
	//	uses timestamp querystring to avoid cache problems
	//	cr mh 10.7.2005
	now=new Date();document.getElementById(id).src=document.getElementById(id).src+"?"+now.getTime();
	if(document.getElementById("livetime")){
		//	write current time to HTML element with id="livetime", if it exists
		var hour=now.getHours();var min=now.getMinutes();var sec=now.getSeconds();
		if(min<10){min="0"+min}
		if(sec<10){sec="0"+sec}
		document.getElementById("livetime").innerHTML=hour+":"+min+":"+sec;
	}
}