make JS compatible with IE 8
Merge pull request #18 from svoboda-jan/fix_js_for_ie_8

make JS compatible with IE 8