var timerID = null;
var timerRunning = false;
function showtime()
{
    var now = new Date();
    var hours = now.getHours();
	var tm = " قبل ظهر";

	if (hours == 12) { tm = " بعدظهر"; }
	
	if (hours < 12) { tm = " قبل ظهر"; }

	if (hours > 12) { hours = hours - 12; tm = " بعدظهر"; }

	if (hours == 0) { tm = " قبل ظهر"; hours = 12; }
	
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var timeValue = "" + hours;
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes;
    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds;
    LocalTimer.innerHTML = timeValue + tm;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true;
}
