Referencing Objects Before They are Loaded.
To rectify these problems move the processing of the object to the onload event handler for the web page.
Reserved Word Used as Variable Name
The best way to avoid this is to become familiar with the reserved word list so that you know what words to avoid. If you choose and follow an appropriate naming standard for your variable names you will be able to avoid using reserved words as variable names because your standard naming convention will make sure that they don't get used.