The javascript and css code used in a lotus form can also be useful in other forms, and so it is best to save it only one time in a shared place.
The pages works well for this purpose and in this post I explain how to create page containing JavaScript code and css and attach it to a form.