﻿var mecPHPPlugin = new Class({

    Implements: [Options, Events],
    options: {
        cEvents: []
    },
    initialize: function (options) {
        this.setOptions(options);
    },
    getEvents: function (that, eventRangeStart, eventRangeEnd) {

        var thisObj = this;
        new Request.JSON({
            method: 'get',
            secure: false,
            url: eventurl,
            onComplete: function (cevents) {                
                if (cevents != null) {
                    that.options.cEvents = cevents;
                    that.gotEvents = true;
                    $('loading').fade('out');
                    that.loadCalEvents();
                } else {
                    that.gotEvents = false;
                    $('loading').fade('out');
                }
            }
        }).send('startDate=' + eventRangeStart.ymd() + '&endDate=' + eventRangeEnd.ymd());
    }
});
