IE8 fix

Fixes Issue #13:

returns the following error on IE8:

Line: 843
Error: Object doesn't support this property or method
Merge pull request #39 from rasmusbe/master

IE 8 Fix (issue #13)