var timerID = null;
var timerRunning = false;
var onloadEvents = new Array();

function stopclock() {
	if	(timerRunning) clearTimeout(timerID);
	timerRunning = false;
}

function showtime() {
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
/*	var day = now.getDate();
	var month = now.getMonth();
	var monthname;
	if (month == 0) monthname = "januari"; 
	if (month == 1) monthname = "februari"; 
	if (month == 2) monthname = "maart"; 
	if (month == 3) monthname = "april"; 
	if (month == 4) monthname = "mei"; 
	if (month == 5) monthname = "juni"; 
	if (month == 6) monthname = "juli"; 
	if (month == 7) monthname = "augustus"; 
	if (month == 8) monthname = "september"; 
	if (month == 9) monthname = "oktober"; 
	if (month == 10) monthname = "november"; 
	if (month == 11) monthname = "december"; 
	var year = now.getFullYear();*/

	var timeValue = "" + hours;
	if (timeValue == "0") timeValue = 12;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes;

	/*var dateValue = day + " " + monthname + " " + year;*/
	
	document.getElementById("currenttime").innerHTML = timeValue + ",";
	/*document.getElementById("currentdate").innerHTML = dateValue;*/

	timerID = setTimeout("showtime()", 10 * 1000);
	timerRunning = true;
}

function startclock() {
	stopclock();
	showtime();
}

addOnloadEvent("startclock()");

function executeOnloadEvents() {
	for (var i = 0; i < onloadEvents.length; i++) {
		eval(onloadEvents[i]);
	}
}
function addOnloadEvent(command) {
	onloadEvents[onloadEvents.length] = command;
}
window.onload = executeOnloadEvents;

