Function.prototype.method=function(_1,_2){
this.prototype[_1]=_2;
return this;
};
if(typeof EventsManager=="undefined"){
EventsManager=function(_3){
function Constructor(){
this.manager=(_3)?_3:this;
this.debugManager=(this.manager.debugManager)?this.manager.debugManager:new DebugManager(this,"");
}
with(Constructor){
method("modify",function(_4,_5,_6){
var _7="EventsManager.modify(eventName,functionName,eventPlacement)";
var _8="EventsManager.modify("+_4+","+_5+","+_6+")";
try{
var _0=this.manager;
if(eval("typeof("+_4+")")!="function"&&_6!="override"){
eval(_4+" = function() {\t"+_5.replace("this.","_0.")+";\t}");
}else{
if(!eval("_0.old"+_4.replace(/\./g,"dot"))){
eval("_0.old"+_4.replace(/\./g,"dot")+" = "+_4);
}
if(_6=="null"||typeof (_6)=="undefined"||_6==""){
_6="afterExisting";
}
switch(_6){
case "beforeExisting":
eval(_4+" = function() {\t"+_5.replace("this.","_0.")+";\t_0.old"+_4.replace(/\./g,"dot")+"(); }");
break;
case "afterExisting":
eval(_4+" = function() {\t_0.old"+_4.replace(/\./g,"dot")+"();\t"+_5.replace("this.","_0.")+";\t}");
break;
case "replace":
eval(_4+" = function() {\t"+_5.replace("this.","_0.")+";\t}");
case "override":
eval(_4+" = "+_5.replace("this.","_0."));
break;
default:
this.debugManager.output(_7,_8,"Invalid eventPlacement("+_6+")","error");
return false;
}
}
}
catch(e){
this.debugManager.output(_7,_8,"TRY/CATCH - "+e.description,"error");
}
});
}
return new Constructor();
};
}


