function addEventSamp(obj,evt,fn){ if(!oTarget){return;} if (obj.addEventListener) { obj.addEventListener(evt, fn, false); }else if(obj.attachEvent){ obj.attachEvent('on'+evt,fn); }else{ oTarget["on" + sEvtType] = fn; } }