jQuery.logThis = function(text) {
    if ((window['console'] !== undefined)) {
        console.log(text);
    }
};
$(document).ready(function() {
    var root_param = $("#root_url").val();
    var segment = '/';
    if (typeof (root_param) != 'undefined') {
        segment = root_param;
    }

    var root_url = document.location.protocol + "//" + location.host + segment;
    populate_schedule_menu(root_url);
});

function populate_schedule_menu(root_url) {
    $.ajax({
        type: "get",
        global: false,
//        url: root_url + "ajaxmenu.php",
        url: root_url + "ctrl/schedule-menu.php",
        data: "",
        beforeSend: function(jqXHR, settings) {
        },
        complete: function(jqXHR, status) {
            //status
        },
        error: function(jqXHR, textStatus, errorThrown) {
            $.logThis(textStatus);
        },
        success: function(data, textStatus, jqXHR) {
            if (textStatus == "success") {
                //$("#MMMenu0011154235_1").html(data);
                $("#lu_schedule").html(data);
            }
            else {
                alert("Status: " + textStatus);
            }
        }
    });
}
