var EventSelectors={version:"1.0_pre",cache:[],start:function(_1){
this.rules=_1||{};
this.timer=new Array();
this._extendRules();
this.assign(this.rules);
},assign:function(_2){
var _3=null;
this._unloadCache();
_2._each(function(_4){
var _5=$A(_4.key.split(","));
_5.each(function(_6){
var _7=_6.split(":");
var _8=_7[1];
$$(_7[0]).each(function(_9){
if(_7[1]==""||_7.length==1){
return _4.value(_9);
}
if(_8.toLowerCase()=="loaded"){
this.timer[_7[0]]=setInterval(this._checkLoaded.bind(this,_9,_7[0],_4),15);
}else{
_3=function(_a){
var _b=Event.element(_a);
if(_b.nodeType==3){
_b=_b.parentNode;
}
_4.value($(_b),_a);
};
this.cache.push([_9,_8,_3]);
Event.observe(_9,_8,_3);
}
}.bind(this));
}.bind(this));
}.bind(this));
},_unloadCache:function(){
if(!this.cache){
return;
}
for(var i=0;i<this.cache.length;i++){
Event.stopObserving.apply(this,this.cache[i]);
this.cache[i][0]=null;
}
this.cache=[];
},_checkLoaded:function(_d,_e,_f){
var _10=$(_d);
if(_d.tagName!="undefined"){
clearInterval(this.timer[_e]);
_f.value(_10);
}
},_extendRules:function(){
Object.extend(this.rules,{_each:function(_11){
for(key in this){
if(key=="_each"){
continue;
}
var _12=this[key];
var _13=[key,_12];
_13.key=key;
_13.value=_12;
_11(_13);
}
}});
}};
var Rules={};
Ajax.Responders.register({onComplete:function(){
EventSelectors.assign(Rules);
}});

