function CurrentTime(containerNode, startTimeStamp) {
    var self = this,
        timer,
        weekDays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
               months = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
        now = new Date(),
        prevTickTimeStamp,
        currTickTimeStamp;


    function addLeadingZero(v) {
        var s = v < 0 ? "-" : "";
        v  = Math.abs(v);

        return s + (v < 10 ? "0" + v : v);
    }

    function generateTimeString() {
        var hours = now.getUTCHours(),
            dayPart = "AM";
        if (hours > 11) {
            hours -= 12;
            dayPart = "PM";
        }
        if (hours == 0) {
            hours = 12;
        }


        return hours + ":" + addLeadingZero(now.getUTCMinutes()) + " " + dayPart;
    }

    function secondTick() {
        currTickTimeStamp = new Date().getTime();
        now.setTime((currTickTimeStamp - prevTickTimeStamp) + startTimeStamp);

        containerNode.nodeValue = generateTimeString();
    }

    this.timeFormat = typeof timeFormat == "undefined" ? CurrentTime.F24 : timeFormat;

    this.start = function () {
        clearInterval(timer);
        prevTickTimeStamp = (new Date()).getTime();
        timer = setInterval(secondTick, 1000);
    }
}
