﻿function sccgovModalPopup(title, header, data, footer, bottom, form, option) {
    var sccgovModalDialogData = $(header + data + footer + bottom);
    sccgovModalDialogData.dialog({
        autoOpen: true, title: title, resizable: false, width: 500, modal: true, closeText: "Close", close: function (event, ui) {
            if (option == "double") {
                $(".ui-dialog-titlebar").css("background-image", "url('" + siteCollectionRootURL + "/Style Library/SCCGOV/" + sccgovTemplateName + "/Images/" + sccgovTemplateColor + "/vhp_calendar_popup_header_bg.gif')");
                $(".ui-dialog-titlebar").css("color", "#333333");
                $('.ui-widget-overlay').css("background-color", "#666666");
                $('.ui-widget-overlay').css("opacity", "0.5");
            }
            else
			{
                $(this).remove();
            }
        }
    });

    if (form == "calendar") {
        $(".ui-dialog-titlebar").css("background-image", "url('" + siteCollectionRootURL + "/Style Library/SCCGOV/" + sccgovTemplateName + "/Images/" + sccgovTemplateColor + "/vhp_calendar_popup_header_bg.gif')");
        $(".ui-dialog-titlebar").css("color", "#333333");
    }
    else if (form == "location") {
        $(".ui-dialog-titlebar").css("background-image", "url('" + siteCollectionRootURL + "/Style Library/SCCGOV/" + sccgovTemplateName + "/Images/" + sccgovTemplateColor + "/vhp_location_popup_header_bg.gif')");
        $(".ui-dialog-titlebar").css("color", "#333333");
    }
    else {
        $(".ui-dialog-titlebar").css("background-image", "url('" + siteCollectionRootURL + "/Style Library/SCCGOV/" + sccgovTemplateName + "/Images/" + sccgovTemplateColor + "/vhp_search_popup_header_bg.gif')");
        $(".ui-dialog-titlebar").css("color", "#ffffff");
    }
}

function languageInfo(msg, desturl) {
    if (desturl == "") {
        sccgovModalPopup("Language Selection", "<div class=\"sccgov_events_container\">", "<p>" + msg + "</p>", "<div id=\"sccgov_calendar_popup_bottom\"></div>", "</div>", "", "double");
    }
    else {
        sccgovModalPopup("Language Selection", "<div class=\"sccgov_events_container\">", "<p>" + msg + "</p><p><a href=\"" + desturl + "\">Click here to continue</a></p>", "<div id=\"sccgov_calendar_popup_bottom\"></div>", "</div>", "", "double");
    }
}
