added arguments to initEvent for IE compatibility
remove extra vars