I am getting the follow error on the following line in IE8 ( not in IE9 or chrome or firefox )
popup = document.createElement(\'div\');
Error :
Changed the line to
var popup = document.createElement('div');
and it works. funny.