function curTime() {

	var currentTime = new Date();
	var hours = currentTime.getHours();
	var minutes = currentTime.getMinutes();
	var seconds = currentTime.getSeconds();
	
	if(hours > 11){
		hours = hours - 12;
		ampm = "PM";
		if (hours == 0) {
			hours = 12;
		}
	} else {
		ampm = "AM";
	}

	if (hours < 10)
		hours = "0" + hours;
	if (minutes < 10)
		minutes = "0" + minutes;
	if (seconds < 10)
		seconds = "0" + seconds;
		
	document.getElementById("curTime").firstChild.nodeValue = hours + ":" + minutes + ":" + seconds + " " + ampm;
	
	setTimeout('curTime()',1000);
}

