First: get the Web Developer Toolbar for Firefox Then run your page in it and if you have JavaScript errors, then the icon on the far right of the toolbar will be red... you can click it to view the error...
for example have you assigned values to the fileName and filePath variables?