(function(){if(LI.BalloonCalloutManager!==undefined){return
}LI.define("BalloonCalloutManager");
LI.BalloonCalloutManager=(function(){var f=500,p=f,d=100,u="callout-overlay",y="callout-",n='<span class="callout-arrow"></span>',h={},j={zIndex:10,constraintoviewport:true},v=null,A=false,i=null,l=null,m=null,c=false,s={},g=new YAHOO.util.KeyListener(document,{keys:27},{fn:function(){if(i){i.close(null)
}}});
var b=function(C,B){h[C]=B
};
var x=function(B){delete h[B]
};
var q=function(){A=true
};
var r=function(){A=false;
k()
};
var w=function(J){var G=J.config,I,D;
if(m){window.clearTimeout(m);
m=null;
i=null;
YDom.removeClass(l,"shown")
}if(i){i.close()
}i=J;
if(G.relativeToTrigger===true){v.cfg.setProperty("constraintoviewport",false)
}if(G.zIndex!==null&&G.zIndex!==undefined){v.cfg.setProperty("zIndex",G.zIndex)
}f=G.persist?d:p;
YDom.setStyle(l,"width",G.width);
l.className=[G.type," ",y,G.orientation," ",G.id].join("");
if(!G.cacheCalloutContent&&G.id){v.setBody(document.getElementById(G.id).innerHTML+n)
}else{v.setBody(G.content+n)
}v.render(document.body);
v.cfg.setProperty("context",[J.el,G.overlayCorner,G.contextCorner]);
l.dimensions=o(l);
J.el.dimensions=o(J.el);
I=G.orientation.split("-");
D=s[I[0]](J.el,l,I);
D.dx+=G.offsetX;
D.dy+=G.offsetY;
YDom.setXY(l,[l.dimensions.x+D.dx,l.dimensions.y+D.dy]);
if(YAHOO.env.ua.ie===6){v.moveTo([l.dimensions.x+D.dx,l.dimensions.y+D.dy])
}YDom.addClass(l,"shown");
if(G.eventsOnInternalElements){var C=G.eventsOnInternalElements;
if(C.elementClass&&C.elementClass!==""){var F=YDom.getElementsByClassName(C.elementClass),H=F.length;
for(var E=0,B;
E<H;
E++){B=F[E];
YEvent.purgeElement(B,false,C.elementEvent);
YEvent.on(B,C.elementEvent,J[C.elementAction],J,true)
}}c=true
}if(G.persist){g.enable()
}};
s={top:function(H,C,B,E){var I=H.dimensions||o(H),G=C.dimensions||o(C),D,F;
E=E||{};
if(B[0]==="top"){E.dx=I.x+0.5*I.width-(G.x+0.5*G.width);
E.dy=I.y+I.height-G.y;
if(B[1]){this[B[1]](H,C,B,E)
}}else{D=Y$(".callout-arrow",C,true);
F=o(D);
F.height=F.height||0;
E.dy+=(0.5*G.height-0.5*F.height)
}return E
},right:function(H,C,B,E){var I=H.dimensions||o(H),G=C.dimensions||o(C),D,F;
E=E||{};
if(B[0]==="right"){E.dx=I.x-(G.x+G.width);
E.dy=I.y+0.5*I.height-(G.y+0.5*G.height);
if(B[1]){this[B[1]](H,C,B,E)
}}else{D=Y$(".callout-arrow",C,true);
F=o(D);
F.width=F.width||0;
E.dx+=(-0.5*G.width+0.5*F.width)
}return E
},bottom:function(H,C,B,E){var I=H.dimensions||o(H),G=C.dimensions||o(C),D,F;
E=E||{};
if(B[0]==="bottom"){E.dx=I.x+0.5*I.width-(G.x+0.5*G.width);
E.dy=I.y-(G.y+G.height);
if(B[1]){this[B[1]](H,C,B,E)
}}else{D=Y$(".callout-arrow",C,true);
F=o(D);
F.height=F.height||0;
E.dy+=(-0.5*G.height+0.5*F.height)
}return E
},left:function(H,C,B,E){var I=H.dimensions||o(H),G=C.dimensions||o(C),D,F;
E=E||{};
if(B[0]==="left"){E.dx=I.x+I.width-G.x;
E.dy=I.y+0.5*I.height-(G.y+0.5*G.height);
if(B[1]){this[B[1]](H,C,B,E)
}}else{D=Y$(".callout-arrow",C,true);
F=o(D);
F.width=F.width||0;
E.dx+=(0.5*G.width-0.5*F.width)
}return E
}};
var o=function(D){var C=YDom.getXY(D),F,B,E;
if(!C||!C.length){return{}
}F=D.getBoundingClientRect();
E=parseInt(F.right-F.left,10);
B=parseInt(F.bottom-F.top,10);
return{height:B,width:E,x:C[0],y:C[1]}
};
var z=function(C){var B=i&&!i.isActive();
if((!A&&B)||C){v.setBody("");
i=null;
YDom.removeClass(l,"shown");
g.disable()
}};
var k=function(){if(!m){m=window.setTimeout(function(){window.clearTimeout(m);
m=null;
z(false)
},LI.BALLOON_CALLOUT_HIDE_DELAY||f)
}};
var t=function(){z(true)
};
var e=function(){v=new YAHOO.widget.Overlay(u,j);
v.render(document.body);
l=YDom.get(u);
YEvent.on(l,"mouseover",q);
YEvent.on(l,"mouseout",r);
if(LI.Events&&typeof LI.Events.trigger==="function"){LI.Events.trigger("LI.BalloonCalloutManager:initialized")
}};
var a=function(){return i
};
YEvent.onDOMReady(function(){if(YAHOO&&YAHOO.widget&&YAHOO.widget.Overlay){e()
}else{var B;
if(!(LI&&LI.UrlPackage&&LI.UrlPackage.containerCore)){throw new Error("The package url for container-core does not exist.")
}B=LI.UrlPackage.containerCore;
YAHOO.util.Get.script(B,{onSuccess:e,onFailure:function(){throw new Error("Failed to load dependency: "+B)
}})
}});
return{register:b,destroy:x,overlay:v,show:w,hide:k,showing:a,forceClose:t}
})()
})();
LI.define("BalloonCallout");
LI.BalloonCallout=function(c,r){var p=LI.BalloonCalloutManager,b=null,f=350,d="hover",a=YDom.get("callout-overlay")||null,m={"left":["tl","tr",5,0],"right":["tr","tl",-5,0],"top":["tl","tl",0,5],"bottom":["bl","tl",0,-5],"top-left":["tl","bl",0,5],"top-right":["tr","br",0,5],"right-top":["tr","tl",-5,0],"right-bottom":["br","bl",-5,0],"bottom-right":["br","tr",0,-5],"bottom-left":["bl","tl",0,-5],"left-bottom":["bl","br",5,0],"left-top":["tl","tr",5,0]},n,k,h,g;
r=r||{};
if(c.tagName&&c.tagName.toLowerCase()==="a"&&c.href.indexOf("#")>-1){r.anchor=true;
r.id=c.href.substring(c.href.indexOf("#")+1)
}else{r.anchor=false
}r={anchor:r.anchor,width:r.width||300,id:r.id||"",overlayCorner:r.overlayCorner||null,contextCorner:r.contextCorner||null,orientation:r.orientation||"left-top",content:r.content||null,events:r.events||["mouseover","mouseout"],eventsOnInternalElements:r.eventsOnInternalElements||null,type:r.type||"balloon-callout",offsetX:r.offsetX||0,offsetY:r.offsetY||0,relativeToTrigger:r.relativeToTrigger||false,zIndex:r.zIndex,persist:r.persist||false,delayOpen:r.delayOpen||false,cacheCalloutContent:r.cacheCalloutContent!==undefined?r.cacheCalloutContent:true,toolTipTextAttr:r.toolTipTextAttr||null,openCallback:r.openCallback||null,closeCallback:r.closeCallback||null};
var o=function(s){YEvent.preventDefault(s);
if(r.persist){YEvent.stopPropagation(s)
}};
var q=function(s){this.persist=true;
if(YAHOO.util.Dom.hasClass(s.target,"callout-close")){j()
}};
var e=function(s){var t=false;
if(s.button){t=(s.button===2);
this.persist=t?true:false
}if(!this.persist){j.call(this,s)
}else{this.persist=false
}};
var i=function(){var t=this;
this.active=true;
YDom.addClass(c,d);
if(g){n=c.title;
c.title=""
}function s(){p.show(t);
t.openEvent.fire();
if(!a){a=YDom.get("callout-overlay")
}if(r.persist){YEvent.on(a,"click",q,t,true);
YEvent.on(document,"click",e,t,true);
var u=YDom.getElementsByClassName("callout-close",null,a);
if(u.length>0){u[0].focus()
}}else{YEvent.removeListener(a,"click",q);
YEvent.removeListener(document,"click",e)
}if(r.openCallback&&typeof(r.openCallback)==="function"){r.openCallback(t)
}}if(r.delayOpen&&!b){b=window.setTimeout(function(){b=null;
s()
},f)
}else{s()
}};
var j=function(s){var t=this;
this.active=false;
this.persist=false;
YDom.removeClass(c,d);
if(g){c.title=n
}if(r.delayOpen&&b){window.clearTimeout(b);
b=null
}if(s){p.hide()
}else{p.forceClose()
}if(r.persist){YEvent.removeListener(a,"click",q);
YEvent.removeListener(document,"click",e);
if(c){c.focus()
}}if(r.closeCallback&&typeof(r.closeCallback)==="function"){r.closeCallback(t)
}};
var l=function(s){this.active=!this.active;
if(this.active||this!==p.showing()){i.call(this,s)
}else{if(!r.persist||(r.events[0]!=="mouseover")){j.call(this,s)
}else{this.active=true
}}};
this.isActive=function(){return this.active
};
this.destroy=function(){if(r.anchor){YEvent.removeListener(c,"click",o)
}if(r.persist){YEvent.removeListener(c,r.events[0],l)
}else{YEvent.removeListener(c,r.events[0],i);
YEvent.removeListener(c,r.events[1],j)
}if(r.eventsOnInternalElements){var w=r.eventsOnInternalElements;
if(w.elementClass&&w.elementClass!==""){var t=YDom.getElementsByClassName(w.elementClass),v=t.length;
for(var u=0,s;
u<v;
u++){s=t[u];
YEvent.removeListener(s,w.elementEvent,w.elementAction)
}}}j();
p.destroy(c.id)
};
this.setContent=function(s){if(!s){s=document.getElementById(r.id).innerHTML
}r.content=s
};
if(!r.content){r.content=document.getElementById(r.id);
if(!r.content){throw"Could not find info element"
}else{k=r.content.innerHTML;
if(r.toolTipTextAttr){n=c.getAttribute(r.toolTipTextAttr);
k=k.replace("__PLACEHOLDER__",LI.htmlEncode(n))
}r.content=k
}}if(r.width!=="auto"){r.width+="px"
}if(r.anchor){YEvent.on(c,"click",o)
}if(!r.overlayCorner){r.overlayCorner=m[r.orientation][0]
}if(!r.contextCorner){r.contextCorner=m[r.orientation][1]
}r.offsetX+=m[r.orientation][2];
r.offsetY+=m[r.orientation][3];
this.openEvent=new YAHOO.util.CustomEvent("open");
YDom.generateId(c,"callout-trigger-");
g=(r.toolTipTextAttr==="title");
this.config=r;
this.el=c;
this.active=false;
this.close=j;
this.open=i;
this.toggle=l;
this.persist=false;
p.register(c.id,this);
if(r.persist){YEvent.on(c,r.events[0],l,this,true)
}else{YEvent.on(c,r.events[0],i,this,true);
YEvent.on(c,r.events[1],j,this,true)
}};
LI.Controls.register("LI.BalloonCallout");
LI.define("BalloonCalloutDelegator");
LI.BalloonCalloutDelegator=function(c,a){var b={};
a=a||{};
a.dataId=a.dataId?("data"+a.dataId):"data-li-tooltip-id";
function d(g,e){if(e&&!b[e.id]){a.id=g;
var f=new LI.BalloonCallout(e,a);
f.toggle();
b[e.id]=true
}}YEvent.on(c,"mouseover",function(e){var f=YEvent.getTarget(e),g=YDom.getAttribute(f,a.dataId);
if(!g&&YDom.getAttribute(f.parentNode,a.dataId)){f=f.parentNode;
g=YDom.getAttribute(f,a.dataId)
}if(g){YDom.generateId(f);
d(g,f);
YEvent.stopPropagation(e)
}})
};