  function showTime(timeDiv, timeZoneOffset) {
    if (!document.getElementById || !document.getElementById(timeDiv)) { return; }
    this.container = document.getElementById(timeDiv);
    this.localtime = this.serverdate = new Date(serverTime);
    this.localtime.setTime(this.serverdate.getTime()+timeZoneOffset*60*1000);
    this.updateTime();
    this.updateTimeDiv();
  }

  showTime.prototype.updateTime=function() {
    var thisobj = this;
    this.localtime.setSeconds(this.localtime.getSeconds()+1);
    setTimeout(function(){thisobj.updateTime()}, 1000); //update time every second
  }

  showTime.prototype.updateTimeDiv=function() {
    var thisobj = this;
    var hour = this.localtime.getHours();
    var minute = this.localtime.getMinutes();
    var second = this.localtime.getSeconds();
    var AMorPM = (hour >= 12) ? "PM" : "AM";
    this.container.innerHTML = formatTime(hour, 1)+":"+formatTime(minute)+":"+formatTime(second)+" "+AMorPM+" CST";
    setTimeout(function(){thisobj.updateTimeDiv()}, 1000); //update container every second
  }

  function formatTime(timeNum, isHour) {
    if (typeof isHour != "undefined") { // format hour
      var hourNum = (timeNum > 12) ? timeNum-12 : timeNum
      return (hourNum == 0) ? 12 : hourNum
    }
    return (timeNum <= 9) ? "0"+timeNum : timeNum // format min/sec
  }
