You need to determine what user interaction activates the java script.
Is it when the user clicks on some HTML element,( a link, a button,
etc), is it when the user enters text in a field, or whatever?
Once you know that key piece of information examine the HTML code for
that element to see what fire event is causing the java script to be
invoked. Then use Watir's fire_event method to simulate that action.
For example the HTML link below would activate a java script function
named "popup()" when the user hovers the mouse over that link. So it
would require Watir to send a fire_event of "onmouseover"
<a href="#" onmouseover="popup()" >Hover to open a popup</a>
Joe