function addEvent(obj,sEvent,fn){ if(obj.attachEvent){ obj.attachEvent("on"+sEvent,fn); }else{ obj.addEventListener(sEvent,fn,false); } }