made code compatible with IE8.
mouse events not supported on IE8 yet.