<?php
  /**
   * Copyright 2011 Zazavi - http://www.zazavi.com
   * Zazavi is free software released under the terms of the GNU General Public License.
   * You should have received a copy of the license.  If not, see <http://www.gnu.org/licenses/>.
   */
  if (!defined("_VALID_PHP"))
      die('Direct access to this location is not allowed.');
?>
<!-- Start Event Manager -->
<div id="cal-wrap"></div>
<script type="text/javascript">
$(document).ready(function () {
    function loadList() {
        $.ajax({
            url: SITEURL + "/modules/events/calendar.php",
            cache: false,
            success: function (html) {
                $("#cal-wrap").html(html);
            }
        });
    }
    loadList();

    $("a.changedate").live("click", function () {
        var parent = $(this);
        $.ajax({
            type: "POST",
            url: SITEURL + "/modules/events/calendar.php",
            data: 'eventdate=' + $(this).attr('id').replace('item_', ''),
            success: function (data, status) {
                $("#cal-wrap").fadeIn("fast", function () {
                    $(this).html(data);
                });
            }
        });
        return false;
    });
});
</script>
<!-- End Event Manager /-->