J query Dialog eating up the div section of the page

J query Dialog eating up the div section of the page


Hi
I am trying to use Jquery dialog for my project development. How ever
I have manged to sucessfully implement it, but I have noticed that
once the dialog is pooped up and then closed the div section that I am
displaying in the dialog is getting deleted from my page, there fore
not allowing me to view the dialog again untill I refresh the page.
I am calling a java script function to pop up the dialog.here is the
code example
<a href="javascript:search();"><img border="0" src="./images/
mag_glass.gif" width="11" height="13" alt="Look up security by name"
align="middle"/></a>
<div id="dialog" title="Security Description"> I am in Dialog</div>
This is the a link which I am using to initate the dialog and the div
section is what I am displaying in the dialog window. Once I click on
the message the search() function is called and with in that function
I am initiating the dialog. The code is below
function search(){
var data = document.getElementById("dialog");
$(function() {
        $(data).dialog({
            bgiframe: true,
            height: 140,
            modal: true
        });
    });}
For the first time it works fine, but when I close the dialog and try
to click the link again, not getting me the dialog and I noticed that
the div section disappears from the screen.
I appreciate any help in fixing this issue.
Thanks
Edd.