
var Ctrl_Calendar_Event = Class.extend({
    
    init: function(data) {
        for (var name in data) {
            this[name] = data[name];
        }
    
        this.start = new Date(this.start * 1000)
        this.end = new Date(this.end * 1000);
        
    },
    
    getCalendar: function() {
        return CalendarModel.data[this.calendar_id];
    },

    
    isRecurring: function() {
        return this.recurrence > 0;
    },
    
    getNodes: function() {
        return $('div[ctrl-event-id='+this.ID+']');
    },
    
    hide: function() { this.getNodes().hide() },
    show: function() { this.getNodes().show() }

});
