﻿var now,hours,minutes,seconds,timeValue;
function showtime(){
now = new Date();
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
timeValue = (hours >= 12) ?"<font color=#CC3300>"+ "&nbsp;下午 "+"</font>" : "<font color=#008080>"+"&nbsp;上午 "+"</font>";
timeValue += ((hours > 12) ? hours - 12 : hours) + "<font color=#4F4F4F>"+" 點"+"</font>";
timeValue += ((minutes < 10) ? " 0" : " ") + minutes + "<font color=#4F4F4F>"+" 分"+"</font>";
timeValue += ((seconds < 10) ? " 0" : " ") + seconds +"<font color=#4F4F4F>"+ " 秒"+"</font>";
clock.innerHTML = timeValue;
setTimeout("showtime()",100);
}
showtime();

