Time rotator (mood)

HTML

<div id="timeperiod1">early</div>
<div id="timeperiod2">middle</div>
<div id="timeperiod3">late</div>
<div id="timeperiod4">New</div>

JavaScript

$.fn.mood = (function(){
    var Mood = function(el, opts){
        this.el = $(el);
        
        this.range = { bottom: opts.range[0]*1, top: opts.range[1]*1 };
        this.init();
    };
    Mood.prototype = {
        init: function(){
            this.initTime = this.checkTime(); // 1, 0, -1
            
            this.initTime == 0 ? this.show() : this.hide();
            this.start();
        },
        start: function(){
            var t = new Date(), 
                showDate = new Date(t), 
                hideDate = new Date(t), 
                h = t.getHours(), hide = false, show = false;
            
            if(this.initTime < 0) {// time has not yet come
                showDate.setHours(this.range.bottom);
                showDate.setMinutes(0);
                show = true;
               
            }
            if(this.initTime <= 0){
                hideDate.setHours(this.range.top);
                hideDate.setMinutes(0);
                hide = true;
            }
            debugger;
            show && setTimeout($.proxy(this.show, this), Math.ceil(showDate.getTime()-t.getTime()));
            hide && setTimeout($.proxy(this.hide, this), Math.ceil(hideDate.getTime()-t.getTime()));
        },
        
        checkTime: function(){
            var t = new Date(), h = t.getHours();
            if(h >= this.range.bottom && h <= this.range.top)
                return 0;
            if(h < this.range.bottom)
                return -1;  
            if(h > this.range.top)
                return 1;  
        },
        show: function(){
            this.el.show('slow');
        },
        hide: function(){
            this.el.hide('slow');
        }
      
    };
      
    return function(opts){
        return this.data('rotateMood', new Mood(this, opts));    
    };
})();
$(function(){
    
    $('#timeperiod1').mood({
        range: [1, 7]
    });
    $('#timeperiod2').mood({
        range: [7, 15]
    });
   ...