Minor Bug with Math.trunc()

This Javascript function needs to be replaced by Math.floor().
Math.trunc() only works in Firefox.
Merge pull request #12 from geocot/master

Minor Bug with Math.trunc()