$(document).ready(function() {
    $("#event").change(function() {
        if ($(this).val() != "0") {
            $.ajax({
            url: "/?AJAX=1&page=SCHEDULED_EVENTS&event=" + $(this).val()
            })
                    .done(function(data) {
            $('#divEvent').html(data);
                    });
        }
    });
});

        function SubmitForm(saveAndPost) {
            var posting;

            if (saveAndPost) {
                if (confirm('Are you sure you want to save changes and post the event?'))
                    posting = $.post("/?AJAX=1&page=SCHEDULED_EVENTS&postEvent=1&event=" + $('#event').val(), $("#eventsForm").serialize());
            }
            else {
                if (confirm('Are you sure you want to save changes to the event?'))
                    posting = $.post("/?AJAX=1&page=SCHEDULED_EVENTS&postEvent=0&event=" + $('#event').val(), $("#eventsForm").serialize());
            }

            posting.done(function(data) {
                $("#divEvent").empty().html(data);
            });
        }