<%
options, attrs = attributes.partition_hash(["autoOpen", "bgiframe", "closeOnEscape", "dialogClass", "draggable", "height", "hide", "maxHeight", "maxWidth", "minWidth", "modal", "position", "resizable", "show", "stack", "title", "width", "zIndex"])
events, html_attrs = attrs.partition_hash(["beforeclose", "open", "focus", "dragStart", "drag", "dragStop", "resizeStart", "resize", "resizeStop", "close"])
options["autoOpen"]=false unless options.has_key?("autoOpen")
%>
<% html_attrs = add_classes(html_attrs, "hidden dialog-box") %>
<% # we can't use jQuery traversal functions since the dialog will move around in the DOM %>
<% attributes["id"]="dialog-#{(rand*1000000000).to_i}" unless attributes.has_key?("id") %>