UI Dialog - limit draggable area to a div element

UI Dialog - limit draggable area to a div element

I have a website that needs a dialog box opened, but i need it to open in a "div". I want the modal option, but the modal should only cover whats in the div, and not the whole page.

example:
  1. <div id="content">
  2.       <div id="main_content">Blah Blah blah <a id="open_dialog">Open Dialog</div>
  3.       <div id"second_content">Blah blah blah</div>
  4. </div>
  5. <div id="dialog_content">blah blah dialog box</div>
When i click on the "Open Dialog" box, i want the dialog box to open in the "main_content" div, and use modal, but i still want the content in the "second_content" viewable/selectable.

Is this possible?