Little modifications for IE 6, 7 and 8 compatibility

Check the modifications in code. I ran all the tests fine!