var Calendar = {
    year: null,
    month: null,
    day: null,
    type: null,
    _setDateValues: function(year, month, day) {
        this.year = year;
        this.month = (month != null) ? dojo.string.padLeft(month, 2, '0') : '';
        this.day = (day != null) ? dojo.string.padLeft(day, 2, '0') : '';
    },
    grid: function(year, month, day, type) {
        this._setDateValues(year, month, day);
        this.type = type;
        var main = $('main');
        if (typeof main == 'undefined') return true;
        var url = basePath+'/remote/calendar.action?date='+this.year+this.month+this.day+'&method='+type;
        dojo.io.bind({
            preventCache: true,
           // preventCache: false,
            url: url,
            mimetype: "text/html",
            load: function(type, evaldObj){
                main.innerHTML = evaldObj;
                window.scrollTo(0,0);
                //executeScripts(main.innerHTML, false);
            }
        });
        return false;
    },
     grid2: function(year, month, day, type) {
        this._setDateValues(year, month, day);
        this.type = type;
        var main = $('main2');
        if (typeof main == 'undefined') return true;
        var url = basePath+'/remote/calendar2.action?date='+this.year+this.month+this.day+'&method='+type;
        dojo.io.bind({
            preventCache: true,
           // preventCache: false,
            url: url,
            mimetype: "text/html",
            load: function(type, evaldObj){
                main.innerHTML = evaldObj;
                window.scrollTo(0,0);
                //executeScripts(main.innerHTML, false);
            }
        });
        return false;
    }
};