function repositionClock() {
	
		if ((document.body.offsetWidth - theClock.style.pixelWidth - 20) > 450)	theClock.style.posLeft = document.body.offsetWidth - theClock.style.pixelWidth - 20;	
		theClock.style.posTop = 22;	

}

function showClock() {

  if (!document.layers && !document.all)
  return;

  var timenow = new Date();
  var hours = timenow.getHours();
  var minutes = timenow.getMinutes();
  var seconds = timenow.getSeconds();
  var dn = "am";
  if (hours >= 12) {
    dn = "pm";
    hours = hours - 12;
  }

  if (hours == 0) {
    hours = 12;
  }

  if (minutes <= 9) {
    minutes = "0" + minutes;
  }

  if (seconds <= 9) {
    seconds = "0" + seconds;
  }

  var months=new Array(13);
  months[1]="January";
  months[2]="February";
  months[3]="March";
  months[4]="April";
  months[5]="May";
  months[6]="June";
  months[7]="July";
  months[8]="August";
  months[9]="September";
  months[10]="October";
  months[11]="November";
  months[12]="December";

  var month=months[timenow.getMonth() + 1];
  var year=timenow.getYear();
  var date=timenow.getDate();
  if (year < 2000)
    year = year + 1900;

  var days=new Array(8);
  days[1]="Sunday";
  days[2]="Monday";
  days[3]="Tuesday";
  days[4]="Wednesday";
  days[5]="Thursday";
  days[6]="Friday";
  days[7]="Saturday";
	


  var day=days[timenow.getDay() + 1];

  showtime = hours + ":" + minutes + " " + dn + " on " +day + ", " + month + " " + date + ", " + year;

  if (document.layers) {
    document.layers.clock.document.write(showtime);
    document.layers.clock.document.close();
  }
  else if (document.all) {
    clock.innerHTML = showtime;
  }

  setTimeout("showClock()", 1000)
}



