
function UpdateClock() {
	if(clockID) {
		clearTimeout(clockID);
		clockID = 0;
	}
	var theClock = document.getElementById('time');
	if(theClock){
		var tDate = new Date();
		var seconds = addNil(tDate.getSeconds());
		var minutes = addNil(tDate.getMinutes());
		var hours = addNil(tDate.getHours());
		
		var timeString = "" + hours + ":" + minutes;
		theClock.innerHTML = timeString;
	}
	clockID = setTimeout("UpdateClock()", 1000*10);
	return true;
}

function addNil(val){
	return((val.toString().length == 1) ? '0'+val : val);
}

function StartClock() {
	clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
	if(clockID) {
		clearTimeout(clockID);
		clockID  = 0;
	}
}

function openDet(id) {
  w = window.open ("pge/roomdet.php?i="+id,"w","location=0,status=0,scrollbars=0,width=580,height=235");
  w.moveTo((screen.width-580)/2,(screen.height-235)/2);
}
