1.remove a needless 'var'. 2.add attchEvent fot support old IE, especially for IE9