var tmpSemaphore;
var ie4=document.all&&!document.getElementById;
var ns4=document.layers;
var DOM2=document.getElementById;
 
function stopClock(){
  clearTimeout(tmpSemaphore);
}
 
function yourClock(){
  var nd = new Date();
  var h, m;
  var s;
  var ind = "am";
  var time = " ";
  h = nd.getHours();
  m = nd.getMinutes();
  s = nd.getSeconds();
  if (h <= 9) h = "" + h;
  if (m <= 9) m = "0" + m;
  if (s <= 9) s = "0" + s;
  if (h > 11) ind = "pm";
  if (h > 12) h = h - 12;
  if (h == 0) h = 12;
  //time += "&nbsp;" + h + ":" + m + ":" + s + " "  + ind; 
  time += "&nbsp;&nbsp;&nbsp;" + h + ":" + m + " "  + ind; 

  if (DOM2){
		document.getElementById("dsptime").innerHTML = time;
	}
	else if (ie4)
		document.all.dsptime.innerHTML = time;
	else if (ns4){
		document.layers.dsptime.document.write(time);
		document.layers.dsptime.document.close();
	}	
	
  tmpSemaphore = setTimeout("yourClock()", 4000);

}




