﻿$(document).ready(function () {
    $('#GoddessGallery').fadeIn(750);
    $('#GaeaGallery').fadeIn(750);
    $('#UrbnArtGallery').fadeIn(750);
    $('#MamaBabyGallery').fadeIn(750);

    $('#galleryGoddess').click(function (e) {
        e.preventDefault();

        // example of calling the confirm function
        // you must use a callback function to perform the "yes" action
        confirm("Placid Star Productions Goddess Gallery contains artistic nude photography. Continue?", function () {
            window.location.href = 'GalleryShow.aspx?Id=1';
        });
    });
});

function confirm(message, callback) {
    $('#confirm').modal({
        close: false,
        position: ["20%", ],
        overlayId: 'confirmModalOverlay',
        containerId: 'confirmModalContainer',
        onClose: function (dialog) {
            dialog.container.fadeOut(200, function () { dialog.overlay.fadeOut(200, function () { $.modal.close(); }); });
        },
        onOpen: function (dialog) {
            dialog.overlay.fadeIn(200, function () { dialog.container.fadeIn(200, function () { dialog.data.fadeIn(200, function () { ; }); }); });
        },
        onShow: function (dialog) {
            dialog.data.find('.message').append(message);

            // if the user clicks "yes"
            dialog.data.find('.yes').click(function () {
                // call the callback
                if ($.isFunction(callback)) {
                    callback.apply();
                }
                // close the dialog
                $.modal.close();
            });
        }
    });
}    
