echo "<div class='ch_js_loader id{$calendarId}'></div>";
    echo "</div>";
    //close chronosly closure
    if (!isset($_REQUEST["shortcode"]) or !$_REQUEST["shortcode"]) {
        ?>
        </div><!-- #content -->
        </section><!-- #primary -->

    <?php 
    }
    if (!isset($_REQUEST["shortcode"]) or !$_REQUEST["shortcode"]) {
        get_footer();
    }
} else {
    $calendarId = $_REQUEST["calendarid"];
    $query = Post_Type_Chronosly_Calendar::get_events_by_date($year, $month, $week);
    $repeated = Post_Type_Chronosly_Calendar::get_events_repeated_by_date($year, $month, $week);
    $settings = unserialize(get_option("chronosly-settings"));
    $calendar = $settings["chronosly_calendar_template_default"];
    if (isset($_REQUEST["small"]) and $_REQUEST["small"]) {
        $calendar .= " small";
    }
    echo "<div class='chronosly-calendar-block'>";
    if (!$_REQUEST["shortcode"] or $_REQUEST["shortcode"] and $_REQUEST["before_events"]) {
        do_action("chronosly-before-events", $stilo);
    }
    echo "<div class='chronosly-content-block' style='" . $stilo . ";clear:both;'>";
    if ($_REQUEST["from"]) {
        echo "<div style='display:none'>\r\n            <div class='ch_from'>" . $_REQUEST["from"] . "</div>\r\n            <div class='ch_to'>" . $_REQUEST["to"] . "</div>\r\n            <input type='hidden' name='y' value='{$year}'/>\r\n            <input type='hidden' name='mo' value='{$month}'/>\r\n            <input type='hidden' name='w' value='{$week}'/>\r\n        </div>";
    }
    if (isset($Post_Type_Chronosly->template)) {