﻿$(document).ready(function() {
    $("#IAgree").hide();
    $("#btnConfirm").click(function() {
        if ($("#Map1").val() == "Map Request") {
            if (($("#selCustType").val() == "City Resident") || ($("#selCustType").val() == "Non-Resident") || ($("#selCustType").val() == "Private Business")) {
                $("#IAgree").show();
                $("#IAgree").dialog('open');
                $("#IAgree").dialog({
                    bgiframe: true,
                    resizable: true,
                    top: 200,
                    left: 200,
                    height: 630,
                    width: 640,
                    modal: true,

                    closeOnEscape: false,
                    overlay: {
                        backgroundColor: '#000',
                        opacity: 0.85
                    },
                    buttons: {
                        'I Agree': function() {
                            $(this).dialog('close');
                            $("#btnSave").click();
                        }, 'I Disagree': function()
                        { $(this).dialog('close'); return false; }
                    }
                });
                $(".ui-dialog-titlebar-close").hide();
            }
            else {
                $("#btnSave").click();
            }
        }
        else {
            $("#btnSave").click();
        }
    });
});
