function EventHandler(){
this.init();
}
EventHandler.prototype.init=function(){
this.traceBackEvents=new Array();
};
EventHandler.prototype.addOnClickEvent=function(_1,_2,_3,_4){
this.addEvent(_1,"click",_2,_3,_4);
};
EventHandler.prototype.addOnKeyUpEvent=function(_5,_6,_7,_8){
this.addEvent(_5,"keyup",_6,_7,_8);
};
EventHandler.prototype.addOnKeyPressEvent=function(_9,_a,_b,_c){
this.addEvent(_9,"keypress",_a,_b,_c);
};
EventHandler.prototype.addOnFocusEvent=function(_d,_e,_f,_10){
this.addEvent(_d,"focus",_e,_f,_10);
};
EventHandler.prototype.addOnBeforeDeactivateEvent=function(_11,_12,_13,_14){
this.addEvent(_11,"beforedeactivate",_12,_13,_14);
};
EventHandler.prototype.addOnMouseDownEvent=function(_15,_16,_17,_18){
this.addEvent(_15,"mousedown",_16,_17,_18);
};
EventHandler.prototype.addOnMouseMoveEvent=function(_19,_1a,_1b,_1c){
this.addEvent(_19,"mousemove",_1a,_1b,_1c);
};
EventHandler.prototype.addOnMouseUpEvent=function(_1d,_1e,_1f,_20){
this.addEvent(_1d,"mouseup",_1e,_1f,_20);
};
EventHandler.prototype.addOnMouseOutEvent=function(_21,_22,_23,_24){
this.addEvent(_21,"mouseout",_22,_23,_24);
};
EventHandler.prototype.addFakeEvent=function(_25,_26,_27,_28){
fakeElement=new Object();
fakeElement["id"]=_25;
this.addTraceBackEvent(fakeElement,"fake_event",_26,_27,_28);
};
EventHandler.prototype.addEvent=function(_29,_2a,_2b,_2c,_2d){
_29["on"+_2a]=handleEvent;
this.addTraceBackEvent(_29,_2a,_2b,_2c,_2d);
};
EventHandler.prototype.addTraceBackEvent=function(_2e,_2f,_30,_31,_32){
this.traceBackEvents[EventHandler.getEventMapping(_2e,_2f)]=[_30,_31,_32];
};
EventHandler.prototype.getTraceBackEvent=function(_33,_34){
return this.traceBackEvents[EventHandler.getEventMapping(_33,_34)];
};
EventHandler.autoIdCounter=0;
EventHandler.getEventMapping=function(_35,_36){
if(!_35.id){
var id="EventHandlerAutoId_"+EventHandler.autoIdCounter;
EventHandler.autoIdCounter++;
_35.id=id;
}
return _35.id+";"+_36;
};
EventHandler.prototype.addParamsToFakeEvent=function(_38,_39){
fakeElement=new Object();
fakeElement["id"]=_38;
aFunction=this.getTraceBackEvent(fakeElement,"fake_event");
if(aFunction){
this.addTraceBackEvent(fakeElement,"fake_event",aFunction[0],aFunction[1],_39);
}
};
EventHandler.prototype.triggerFakeEvent=function(_3a){
fakeElement=new Object();
fakeElement["id"]=_3a;
aFunction=this.getTraceBackEvent(fakeElement,"fake_event");
if(aFunction){
oEventHandler=aFunction[0];
oEventHandler[aFunction[1]](aFunction[2]);
}
};
EventHandler.getEvent=function(e){
if(isIE){
return event;
}else{
return e;
}
};
EventHandler.getDomElementFromEvent=function(e){
if(isIE){
return e.srcElement;
}else{
return e.target;
}
};
EventHandler.prototype.handleEvent=function(e){
aFunction=null;
e=EventHandler.getEvent(e);
eventType=e.type;
DomElement=EventHandler.getDomElementFromEvent(e);
if(DomElement.nodeType==3){
DomElement=DomElement.parentNode;
}
aFunction=this.getTraceBackEvent(DomElement,eventType);
while(!aFunction&&DomElement.parentNode){
DomElement=DomElement.parentNode;
aFunction=this.getTraceBackEvent(DomElement,eventType);
}
if(aFunction){
oController=aFunction[0];
eventName=aFunction[1];
if(eventName){
return oController[aFunction[1]](e,aFunction[2]);
}
}
};
EventHandler.prototype.handleEventByDom=function(_3e,_3f){
if(_3e.nodeType==3){
_3e=_3e.parentNode;
}
aFunction=this.getTraceBackEvent(_3e,_3f);
if(aFunction){
oController=aFunction[0];
oController[aFunction[1]](null,aFunction[2]);
}
};
EventHandler.oInstance=null;
EventHandler.getInstance=function(){
if(!EventHandler.oInstance){
EventHandler.oInstance=new EventHandler();
}
return EventHandler.oInstance;
};
function handleEvent(e){
EventHandler.getInstance().handleEvent(e);
return true;
}
function handleEventByDom(_41,_42){
EventHandler.getInstance().handleEventByDom(_41,_42);
}


