Jquery Dialog

Jquery Dialog

HI so I am trying to make a dialog come up when a particular button is pressed on my web page but my code is not working. What is odd is that when I change the property of autoopen to true the dialog comes up on load and the code works fine... (Code is underneath). 
Also do I need to change the display property of the div to none?
#WarrantyAddDiv - is the div containg a table in it and I want that table to appear in the dialog once button is pressed
#btnAddAssetWarrantyInfo - is the button used

$(document).ready(function () {
        $("#WarrantyAddDiv").dialog({ autoOpen: true, show: "slide",title:"Add Warranty" });

           $("#btnAddAssetWarrantyInfo").click(function () {
               $("#WarrantyAddDiv").dialog();
               return false;
           });
       });

But when I try to initiate the dialog on button click nothing happens... code i used for that is underneath..
$(document).ready(function () {
           $('#WarrantyAddDiv').dialog({
              autoOpen: false, show:"slide", title: "Add Warranty"});
           $('#btnAddAssetWarrantyInfo').click(function () {
                $("#WarrantyAddDiv").dialog();
                  return false;
         });

       });


Any help is much appreciated..