
function showDialog(id) {
    $('#' + id).dialog("open");
}

function closeDialog(id) {
    $('#' + id).dialog("close");
}

function modalConfig() {
    /*demo*/
    $('#newForm').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "900px",
        title: "New Form",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#directoryUserEvent').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "900px",
        title: "Modify Event",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#corporateEventAttended').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "600px",
        title: "Corporate Events Attended",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#testimonialDetails').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "600px",
        title: "Manage Testimonial Details",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#locationDetails').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "600px",
        title: "Manage Location Details",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#addTeacherForm').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "600px",
        title: "Add Teacher",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#addSectionForm').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "600px",
        title: "Add New Section",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#addDocumentForm').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "600px",
        title: "Add New Document",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#searchTeacherCriteria').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "400px",
        title: "Find A Teacher",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#northAmerica').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "600px",
        title: "Countries in North America",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#centralAmerica').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "400px",
        title: "Countries in Central America and Caribbean",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#southAmerica').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "400px",
        title: "Countries in South America",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#europe').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "400px",
        title: "Countries in Europe",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#asia').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "400px",
        title: "Countries in Asia",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#oceania').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "400px",
        title: "Countries in Oceania and Pacific",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });

    $('#africa').dialog({
        autoOpen: false,
        draggable: true,
        show: "fade",
        hide: "fade",
        modal: true,
        width: "400px",
        title: "Countries in Africa",
        open: function (type, data) {
            $(this).parent().appendTo("form");
            $('body').css('overflow', 'hidden');
            $('.ui-widget-overlay').css('width', '100%');
        },
        close: function (type, data) {
            $('body').css('overflow', 'auto');
        }
    });
}

function initJQUERY() {

    $(function () {

        modalConfig();

    });
}

