hello, i have installed jquery.ui-1.6 and jquery_ui-6.x-1.x-dev.tar and i want build dialog from element of my page

javascript code

    $("#edit-field-name-0-value-wrapper").dialog();

give me error
TypeError: '$("#edit-field-name-0-value-wrapper").dialog' is not a function

i don't know js.
please, help me to understand how to fix it

Comments

ok, i found what where is no added all widgets by default and i must load needed via jquery_ui_add(array('ui.dialog', 'ui.draggable', 'ui.resizable'));

ok, i putt this into template.php and it's work, but how can i add js via jquery_ui_add to specified templates/nodes/pages ?

i found solution and maybe some people need it too

add to your .tpl file (page-node-add.tpl) this

<?php
jquery_ui_add
(array('ui.dialog', 'ui.draggable', 'ui.resizable'));
$scripts = drupal_get_js();
echo
$scripts
?>

instead this

<?php
echo $scripts
?>

and with http://drupal.org/node/388384#comment-3667740

<?php
jquery_ui_add
(array('ui.dialog', 'ui.draggable', 'ui.resizable'));
$scripts = drupal_get_js();
$styles = drupal_get_css();
echo
$styles;
echo
$scripts;
?>

for adding needed css and js from ui to tpl

Thank you very much. I couldn't find a solution anywhere. It seemed so simple, but running a
$('#div').dialog(); wasn't accomplishing anything. Thank you for posting this.