use Object.toString() instead of window.toString() to prevent IE errors, refs #214