CKEditor in UI dialog box

CKEditor in UI dialog box

hi,

I am trying to open dialog box with CKeditor, but I can't make it work. It appears in the textarea control as a plain text.
I have also used patch from ticket  http://dev.jqueryui.com/ticket/4727, still no luck.

here is my code.
  1. function showdialog(detail) {            
  2.                 $(function() {
  3.                     $(detail).dialog({
  4.                         bgiframe: true,
  5.                         modal: true,
  6.                         width: 700,
  7.                         height: 600,
  8.                         title: 'Product Details',
  9.                         buttons: {
  10.                         Ok: function() {
  11.                                 alert('Data saved');
  12.                                 $(this).dialog('close');
  13.                                 $(this).dialog('destroy');
  14.                             }
  15.                         }
  16.                     });

  17.                 });
  18.             }

I am using below references at the top of the page along with valid CSS and Jquery files as well.
<script type="text/javascript" src="script/ui/ui.dialog.js"></script>
 <script type="text/javascript" src="script/ui/dialog-patch.js"></script>


Please send me a sample code that I can use.

Thanks in advance
Raj