how to handle javascript with watir

html code:
<script language="javascript" type="text/javascript">
  document.write('<input name="TPL_password" id="TPL_password" type="password" maxlength="20" size="32" tabindex="2"/>)

</script>

my question:

    how to locate the password field with watir?

This should work:

browser.text_field(:id, "TPL_password").set "not-the-real-one"

By the way, you will get more answers at http://groups.google.com/group/watir-general/

Željko