fix a bug on JS module
Add some functions to JavaScript.Document
Merge pull request #404 from tetsurom/JSFix

JS fix