How to call Javascript in external dialog file

How to call Javascript in external dialog file

Is it possible to execute javascript on a linked dialog where the dialog is defined in a seperate external file? I need to do javascript validation on my dialog and I cannot get any Javascript to fire when I launch the dialog from an external file.
 
 
However, if I put the dialog definition in the same HTML as the page with the dialog launching link (that is a multi page HTML) the javascript works fine. 
 
I would like to have my dialog code in seperate files to decompose the multi-page HTML page into simpler parts that are more manageable.