added IE support

use Object.prototype.toString instead of window.toString.
Merge pull request #1 from sejoker/master

added IE support