Enhanced to support JQuery references in 'template' parameter

hei, I wanted a way to use dialogues I keep laid out on the page with your very cool plugin, so I made a small tweak and changed the examples and documentation too.  Please integrate when you have a chance or let me know if there's anything I should change.