optimized code for js exception
add style for ie 7