<!--

var timerID = null;
var timerRunning = false;

function MakeArray(n) {
	this.length = n;
	return this;
}

function stopclock(){
	if(timerRunning) {
		clearTimeout(timerID);
	}
	timerRunning = false;
}

function startclock(){
	stopclock();
	showtime();
}

function showtime(){
	var now = new Date();
	var offset = 60000 * now.getTimezoneOffset();	// offset to milliseconds
	var nowStr = now.toString();			// make it a string
	var nowMS = Date.parse(nowStr);			// get the milliseconds
	nowMS += offset;				// contains UTC now in MS
	nowMS = nowMS + (8 * 60 * 60 * 1000);		// add 8 hours in MS
	now = new Date(nowMS);				// contains WIT now

	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();
	var timeValue = "" + ((hours < 10) ? "0" : "") + hours;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds;

	document.baliclock.clockdisplay.value = timeValue + " Bali Time";

	timerID = setTimeout("showtime()",1000);
	timerRunning = true;
}

//-->

