<!--

//////////////////////////////////////////
// This script is copyright (c) 2002 by //
// Gert Graf (graf@grafnet.com          //
//////////////////////////////////////////

var timerID = null;
var timerRunning = false;

monthNames = new MakeArray(12)
monthNames[1] = "Jan"
monthNames[2] = "Feb"
monthNames[3] = "Mar"
monthNames[4] = "Apr"
monthNames[5] = "May"
monthNames[6] = "Jun"
monthNames[7] = "Jul"
monthNames[8] = "Aug"
monthNames[9] = "Sep"
monthNames[10] = "Oct"
monthNames[11] = "Nov"
monthNames[12] = "Dec"

dayNames = new MakeArray(7)
dayNames[1] = "Sun"
dayNames[2] = "Mon"
dayNames[3] = "Tue"
dayNames[4] = "Wed"
dayNames[5] = "Thu"
dayNames[6] = "Fri"
dayNames[7] = "Sat"

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

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

function show_clock(){
	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;

	var theDay = dayNames[now.getDay() + 1];
	var theMonth = monthNames[now.getMonth() + 1];
	msie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
	if (msie4) {
		var theYear = now.getYear();
	} else {
		var theYear = now.getYear() +1900;
	}

	document.lombokclock.clockdisplay.value = "Lombok : " + timeValue;
	document.lombokclock.datedisplay.value = ""

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

//-->

