if(!$oe$||!$||!$oe$.ui){throw new Error("Core libs missing");
}(function(){var A=$oe$.getNamespace("competencebox");
DEFAULT_CB_OPTIONS={expandDelay:800};
function B(M,J){var L=this;
M=$oe$.obj.extend(M||{},DEFAULT_CB_OPTIONS);
var G=null;
var J=J;
var F={};
this.timerId=1;
function K(O){clearTimeout(L.timerId);
L.timerId=false;
F.waitFor=O;
var N={idx:O[0].itemIdx,filled:O[0].filled,lifeTime:new Date().getTime()-O[0].lifeTime};
if($oe$.val.isFunction(J)){return J(O,N);
}return true;
}this.bindEvents=function(){G=$("#inner_local_compbox");
if(G.length==0){$oe$.log("bindEvents: failed - missing 'inner_local_compbox'");
return;
}G=$(G[0]);
var P={header:"a.head_compbox",active:".active",alwaysOpen:false,onClick:K.getBinding(L)};
G.accordion(P);
var N=G.children("a.head_compbox");
for(var O=0;
O<N.length;
O++){var Q=N[O];
Q.itemIdx=O;
Q.filled=C($(Q)).trim()!="";
Q.lifeTime=new Date().getTime();
$(Q).bind("mouseenter",L,D);
$(Q).bind("mouseleave",L,I);
}};
function D(N){$oe$.log("MouseEnter: ItemIdx="+this.itemIdx);
clearTimeout(L.timerId);
L.timerId=false;
if(!L.timerId){L.timerId=E.getBinding(L).callDelayed(M.expandDelay,this);
}}function I(N){$oe$.log("MouseLeave: ItemIdx="+this.itemIdx);
if(L.timerId){clearTimeout(L.timerId);
L.timerId=false;
}}function E(N){G.accordion("activate",N);
clearTimeout(L.timerId);
}this.active=function(P,O,N){if(O!=""){H(P,O,N);
}if(F.waitFor!=P){return;
}G.accordion("activate",P,true);
};
function H(P,O,N){P[0].filled=(O!="");
if(!P[0].filled){return;
}P.next(".cb_content").html(O);
P.find(".head_content").html(N);
P[0].lifeTime=new Date().getTime();
}function C(N){return(N.next(".cb_content").html()?N.next(".cb_content").html():"");
}}A.CompetenceBoxHandler=B;
}());

