i am using the below code to get a Jquery UI popup, but its not returning the value and popup box is closing

I need when i click on button it has to work as confirmation box..!

Code :

```
<style type="text/css" >
        .ui-widget-header, .ui-widget-content
    { color: red !important;}
</style>
<script type="text/javascript">
    $(document).ready(function () {
        var $myDialog = $('<div></div>')
        .html('You are going to Lock the Record.<br/>Click OK to confirm.  Click Cancel to stop this action.')
        .dialog({
            autoOpen: false,
            title: 'Confirm..?',
            buttons: { "OK": function () {
                $(this).dialog("close");

            }, "Cancel": function () {
                $(this).dialog("close");

            }
            }
        });

        $(function fn() {
            $('#Button1').click(function (e) {
                return $myDialog.dialog('open');

            });
        });
    });
</script>

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return fn() onclick="Button1_Click"/>

```