Added the .gitignore file to ignore IDE and workspace files.

No need to save these sort of files as they just clutter up the repository. The project therefore just ignores them.
Signed-off-by: Nassar Zeitoune <nassar.z@slair.com.au>
Updated the code to fix errors.

The existing code had some JavaScript errors that would only pop up under certain browsers. Fixed the code to be more standards compliant.
Signed-off-by: Nassar Zeitoune <nassar.z@slair.com.au>