function FillToolTip(){$("a.ToolTip").each(function(){$(this).prop("data-hasqtip")||$(this).qtip({suppress:!1,content:{text:"Načítám ...",title:{text:"Nápověda",button:"Zavřít"},ajax:{url:"/ToolTip/Lookup/",data:{id:$(this).attr("id")},type:"GET"}},position:{my:"top center",at:"center bottom"},show:{event:"click",solo:!0,ready:!1},hide:{event:"button",fixed:!0},style:{classes:"qtip-light qtip-bootstrap",width:300,tip:{corner:!0,border:!0}},events:{blur:null}})})}!function(n,t,i){!function(n){"use strict";"function"==typeof define&&define.amd?define(["jquery"],n):jQuery&&!jQuery.fn.qtip&&n(jQuery)}(function(r){"use strict";function ii(n,t,i,f){this.id=i;this.target=n;this.tooltip=s;this.elements={target:n};this._id=o+"-"+i;this.timers={img:{}};this.options=t;this.plugins={};this.cache={event:{},target:r(),disabled:u,attr:f,onTooltip:u,lastClass:""};this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=u}function ut(n){return n===s||"object"!==r.type(n)}function vi(n){return!(r.isFunction(n)||n&&n.attr||n.length||"object"===r.type(n)&&(n.jquery||n.then))}function pt(n){var t,e,i,o;return ut(n)?u:(ut(n.metadata)&&(n.metadata={type:n.metadata}),"content"in n&&(t=n.content,ut(t)||t.jquery||t.done?t=n.content={text:e=vi(t)?u:t}:e=t.text,"ajax"in t&&(i=t.ajax,o=i&&i.once!==u,delete t.ajax,t.text=function(n,t){var u=e||r(this).attr(t.options.content.attr)||"Loading...",f=r.ajax(r.extend({},i,{context:t})).then(i.success,s,i.error).then(function(n){return n&&o&&t.set("content.text",n),n},function(n,i,r){t.destroyed||0===n.status||t.set("content.text",i+": "+r)});return o?u:(t.set("content.text",u),f)}),"title"in t&&(r.isPlainObject(t.title)&&(t.button=t.title.button,t.title=t.title.text),vi(t.title||u)&&(t.title=u))),"position"in n&&ut(n.position)&&(n.position={my:n.position,at:n.position}),"show"in n&&ut(n.show)&&(n.show=n.show.jquery?{target:n.show}:n.show===f?{ready:f}:{event:n.show}),"hide"in n&&ut(n.hide)&&(n.hide=n.hide.jquery?{target:n.hide}:{event:n.hide}),"style"in n&&ut(n.style)&&(n.style={classes:n.style}),r.each(h,function(){this.sanitize&&this.sanitize(n)}),n)}function yi(n,t){for(var u,f=0,i=n,r=t.split(".");i=i[r[f++]];)f<r.length&&(u=i);return[u||n,r.pop()]}function fr(n,t){var i,r,u;for(i in this.checks)for(r in this.checks[i])(u=new RegExp(r,"i").exec(n))&&(t.push(u),("builtin"===i||this.plugins[i])&&this.checks[i][r].apply(this.plugins[i]||this,t))}function wt(n){return lr.concat("").join(n?"-"+n+" ":" ")}function bt(n,t){return t>0?setTimeout(r.proxy(n,this),t):void n.call(this)}function er(n){this.tooltip.hasClass(a)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=bt.call(this,function(){this.toggle(f,n)},this.options.show.delay))}function or(n){if(!this.tooltip.hasClass(a)&&!this.destroyed){var t=r(n.relatedTarget),i=t.closest(it)[0]===this.tooltip[0],f=t[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==t[0]&&"mouse"===this.options.position.target&&i||this.options.hide.fixed&&/mouse(out|leave|move)/.test(n.type)&&(i||f))try{n.preventDefault();n.stopImmediatePropagation()}catch(e){}else this.timers.hide=bt.call(this,function(){this.toggle(u,n)},this.options.hide.delay,this)}}function ri(n){!this.tooltip.hasClass(a)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=bt.call(this,function(){this.hide(n)},this.options.hide.inactive))}function pi(n){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(n)}function wi(n,i,u){r(t.body).delegate(n,(i.split?i:i.join("."+o+" "))+"."+o,function(){var n=c.api[r.attr(this,dt)];n&&!n.disabled&&u.apply(n,arguments)})}function sr(n,i,e){var y,l,v,h,b,k=r(t.body),p=n[0]===t?k:n,w=n.metadata?n.metadata(e.metadata):s,d="html5"===e.metadata.type&&w?w[e.metadata.name]:s,a=n.data(e.metadata.name||"qtipopts");try{a="string"==typeof a?r.parseJSON(a):a}catch(g){}if(h=r.extend(f,{},c.defaults,e,"object"==typeof a?pt(a):s,pt(d||w)),l=h.position,h.id=i,"boolean"==typeof h.content.text){if(v=n.attr(h.content.attr),h.content.attr===u||!v)return u;h.content.text=v}if(l.container.length||(l.container=k),l.target===u&&(l.target=p),h.show.target===u&&(h.show.target=p),h.show.solo===f&&(h.show.solo=l.container.closest("body")),h.hide.target===u&&(h.hide.target=p),h.position.viewport===f&&(h.position.viewport=l.container),l.container=l.container.eq(0),l.at=new nt(l.at,f),l.my=new nt(l.my),n.data(o))if(h.overwrite)n.qtip("destroy",!0);else if(h.overwrite===u)return u;return n.attr(ei,i),h.suppress&&(b=n.attr("title"))&&n.removeAttr("title").attr(rt,b).attr("title",""),y=new ii(n,h,i,!!v),n.data(o,y),y}function lt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function hr(n,t){var r,u,f=t.charAt(0).toUpperCase()+t.slice(1),e=(t+" "+vr.join(f+" ")+f).split(" "),o=0;if(ci[t])return n.css(ci[t]);for(;r=e[o++];)if((u=n.css(r))!==i)return ci[t]=r,u}function et(n,t){return Math.ceil(parseFloat(hr(n,t)))}function bi(n,t){this._ns="tip";this.options=t;this.offset=t.offset;this.size=[t.width,t.height];this.init(this.qtip=n)}function ki(n,t){this.options=t;this._ns="-modal";this.init(this.qtip=n)}var c,e,nt,ui,kt,f=!0,u=!1,s=null,p="x",v="y",at="width",fi="height",b="top",w="left",tt="bottom",k="right",l="center",cr="flipinvert",ft="shift",h={},o="qtip",ei="data-hasqtip",dt="data-qtip-id",lr=["ui-widget","ui-tooltip"],it="."+o,di="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),gi=o+"-fixed",oi=o+"-default",ot=o+"-focus",ar=o+"-hover",a=o+"-disabled",st="_replacedByqTip",rt="oldtitle",y={ie:function(){for(var n=4,i=t.createElement("div");(i.innerHTML="<!--[if gt IE "+n+"]><i><\/i><![endif]-->")&&i.getElementsByTagName("i")[0];n+=1);return n>4?n:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||u},nr,tr,vt,li,ai,d,ti,g;e=ii.prototype;e._when=function(n){return r.when.apply(r,n)};e.render=function(n){if(this.rendered||this.destroyed)return this;var w,i=this,t=this.options,s=this.cache,y=this.elements,p=t.content.text,l=t.content.title,b=t.content.button,e=t.position,v=("."+this._id+" ",[]);return r.attr(this.target[0],"aria-describedby",this._id),s.posClass=this._createPosClass((this.position={my:e.my,at:e.at}).my),this.tooltip=y.tooltip=w=r("<div/>",{id:this._id,"class":[o,oi,t.style.classes,s.posClass].join(" "),width:t.style.width||"",height:t.style.height||"",tracking:"mouse"===e.target&&e.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":u,"aria-describedby":this._id+"-content","aria-hidden":f}).toggleClass(a,this.disabled).attr(dt,this.id).data(o,this).appendTo(e.container).append(y.content=r("<div />",{"class":o+"-content",id:this._id+"-content","aria-atomic":f})),this.rendered=-1,this.positioning=f,l&&(this._createTitle(),r.isFunction(l)||v.push(this._updateTitle(l,u))),b&&this._createButton(),r.isFunction(p)||v.push(this._updateContent(p,u)),this.rendered=f,this._setWidget(),r.each(h,function(n){var t;"render"===this.initialize&&(t=this(i))&&(i.plugins[n]=t)}),this._unassignEvents(),this._assignEvents(),this._when(v).then(function(){i._trigger("render");i.positioning=u;i.hiddenDuringWait||!t.show.ready&&!n||i.toggle(f,s.event,u);i.hiddenDuringWait=u}),c.api[this.id]=this,this};e.destroy=function(n){function t(){if(!this.destroyed){this.destroyed=f;var t,n=this.target,i=n.attr(rt);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove();r.each(this.plugins,function(){this.destroy&&this.destroy()});for(t in this.timers)clearTimeout(this.timers[t]);n.removeData(o).removeAttr(dt).removeAttr(ei).removeAttr("aria-describedby");this.options.suppress&&i&&n.attr("title",i).removeAttr(rt);this._unassignEvents();this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=s;delete c.api[this.id]}}return this.destroyed?this.target:(n===f&&"hide"!==this.triggering||!this.rendered?t.call(this):(this.tooltip.one("tooltiphidden",r.proxy(t,this)),!this.triggering&&this.hide()),this.target)};ui=e.checks={builtin:{"^id$":function(n,t,i,e){var s=i===f?c.nextid:i,h=o+"-"+s;s!==u&&s.length>0&&!r("#"+h).length?(this._id=h,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):n[t]=e},"^prerender":function(n,t,i){i&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(n,t,i){this._updateContent(i)},"^content.attr$":function(n,t,i,r){this.options.content.text===this.target.attr(r)&&this._updateContent(this.target.attr(i))},"^content.title$":function(n,t,i){return i?(i&&!this.elements.title&&this._createTitle(),void this._updateTitle(i)):this._removeTitle()},"^content.button$":function(n,t,i){this._updateButton(i)},"^content.title.(text|button)$":function(n,t,i){this.set("content."+t,i)},"^position.(my|at)$":function(n,t,i){"string"==typeof i&&(this.position[t]=n[t]=new nt(i,"at"===t))},"^position.container$":function(n,t,i){this.rendered&&this.tooltip.appendTo(i)},"^show.ready$":function(n,t,i){i&&(!this.rendered&&this.render(f)||this.toggle(f))},"^style.classes$":function(n,t,i,r){this.rendered&&this.tooltip.removeClass(r).addClass(i)},"^style.(width|height)":function(n,t,i){this.rendered&&this.tooltip.css(t,i)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(n,t,i){this.rendered&&this.tooltip.toggleClass(oi,!!i)},"^events.(render|show|move|hide|focus|blur)$":function(n,t,i){this.rendered&&this.tooltip[(r.isFunction(i)?"":"un")+"bind"]("tooltip"+t,i)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var n=this.options.position;this.tooltip.attr("tracking","mouse"===n.target&&n.adjust.mouse);this._unassignEvents();this._assignEvents()}}}};e.get=function(n){if(this.destroyed)return this;var i=yi(this.options,n.toLowerCase()),t=i[0][i[1]];return t.precedance?t.string():t};nr=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i;tr=/^prerender|show\.ready/i;e.set=function(n,t){if(this.destroyed)return this;var o,h=this.rendered,i=u,e=this.options;return this.checks,"string"==typeof n?(o=n,n={},n[o]=t):n=r.extend({},n),r.each(n,function(t,u){if(h&&tr.test(t))return void delete n[t];var o,f=yi(e,t.toLowerCase());o=f[0][f[1]];f[0][f[1]]=u&&u.nodeType?r(u):u;i=nr.test(t)||i;n[t]=[f[0],f[1],u,o]}),pt(e),this.positioning=f,r.each(n,r.proxy(fr,this)),this.positioning=u,this.rendered&&this.tooltip[0].offsetWidth>0&&i&&this.reposition("mouse"===e.position.target?s:this.cache.event),this};e._update=function(n,t){var i=this,e=this.cache;return this.rendered&&n?(r.isFunction(n)&&(n=n.call(this.elements.target,e.event,this)||""),r.isFunction(n.then)?(e.waiting=f,n.then(function(n){return e.waiting=u,i._update(n,t)},s,function(n){return i._update(n,t)})):n===u||!n&&""!==n?u:(n.jquery&&n.length>0?t.empty().append(n.css({display:"block",visibility:"visible"})):t.html(n),this._waitForContent(t).then(function(n){i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(e.event,!n.length)}))):u};e._waitForContent=function(n){var t=this.cache;return t.waiting=f,(r.fn.imagesLoaded?n.imagesLoaded():r.Deferred().resolve([])).done(function(){t.waiting=u}).promise()};e._updateContent=function(n,t){this._update(n,this.elements.content,t)};e._updateTitle=function(n,t){this._update(n,this.elements.title,t)===u&&this._removeTitle(u)};e._createTitle=function(){var n=this.elements,t=this._id+"-title";n.titlebar&&this._removeTitle();n.titlebar=r("<div />",{"class":o+"-titlebar "+(this.options.style.widget?wt("header"):"")}).append(n.title=r("<div />",{id:t,"class":o+"-title","aria-atomic":f})).insertBefore(n.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(n){r(this).toggleClass("ui-state-active ui-state-focus","down"===n.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(n){r(this).toggleClass("ui-state-hover","mouseover"===n.type)});this.options.content.button&&this._createButton()};e._removeTitle=function(n){var t=this.elements;t.title&&(t.titlebar.remove(),t.titlebar=t.title=t.button=s,n!==u&&this.reposition())};e._createPosClass=function(n){return o+"-pos-"+(n||this.options.position.my).abbrev()};e.reposition=function(i,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=f;var a,v,ut,at,c=this.cache,d=this.tooltip,p=this.options.position,o=p.target,et=p.my,g=p.at,ot=p.viewport,ht=p.container,ft=p.adjust,vt=ft.method.split(" "),ct=d.outerWidth(u),lt=d.outerHeight(u),nt=0,it=0,yt=d.css("position"),s={left:0,top:0},wt=d[0].offsetWidth>0,bt=i&&"scroll"===i.type,st=r(n),pt=ht[0].ownerDocument,rt=this.mouse;if(r.isArray(o)&&2===o.length)g={x:w,y:b},s={left:o[0],top:o[1]};else if("mouse"===o)g={x:w,y:b},(!ft.mouse||this.options.hide.distance)&&c.origin&&c.origin.pageX?i=c.origin:!i||i&&("resize"===i.type||"scroll"===i.type)?i=c.event:rt&&rt.pageX&&(i=rt),"static"!==yt&&(s=ht.offset()),pt.body.offsetWidth!==(n.innerWidth||pt.documentElement.clientWidth)&&(v=r(t.body).offset()),s={left:i.pageX-s.left+(v&&v.left||0),top:i.pageY-s.top+(v&&v.top||0)},ft.mouse&&bt&&rt&&(s.left-=(rt.scrollX||0)-st.scrollLeft(),s.top-=(rt.scrollY||0)-st.scrollTop());else{if("event"===o?i&&i.target&&"scroll"!==i.type&&"resize"!==i.type?c.target=r(i.target):i.target||(c.target=this.elements.target):"event"!==o&&(c.target=r(o.jquery?o:this.elements.target)),o=c.target,o=r(o).eq(0),0===o.length)return this;o[0]===t||o[0]===n?(nt=y.iOS?n.innerWidth:o.width(),it=y.iOS?n.innerHeight:o.height(),o[0]===n&&(s={top:(ot||o).scrollTop(),left:(ot||o).scrollLeft()})):h.imagemap&&o.is("area")?a=h.imagemap(this,o,g,h.viewport?vt:u):h.svg&&o&&o[0].ownerSVGElement?a=h.svg(this,o,g,h.viewport?vt:u):(nt=o.outerWidth(u),it=o.outerHeight(u),s=o.offset());a&&(nt=a.width,it=a.height,v=a.offset,s=a.position);s=this.reposition.offset(o,s,ht);(y.iOS>3.1&&y.iOS<4.1||y.iOS>=4.3&&y.iOS<4.33||!y.iOS&&"fixed"===yt)&&(s.left-=st.scrollLeft(),s.top-=st.scrollTop());(!a||a&&a.adjustable!==u)&&(s.left+=g.x===k?nt:g.x===l?nt/2:0,s.top+=g.y===tt?it:g.y===l?it/2:0)}return s.left+=ft.x+(et.x===k?-ct:et.x===l?-ct/2:0),s.top+=ft.y+(et.y===tt?-lt:et.y===l?-lt/2:0),h.viewport?(ut=s.adjusted=h.viewport(this,s,p,nt,it,ct,lt),v&&ut.left&&(s.left+=v.left),v&&ut.top&&(s.top+=v.top),ut.my&&(this.position.my=ut.my)):s.adjusted={left:0,top:0},c.posClass!==(at=this._createPosClass(this.position.my))&&d.removeClass(c.posClass).addClass(c.posClass=at),this._trigger("move",[s,ot.elem||ot],i)?(delete s.adjusted,e===u||!wt||isNaN(s.left)||isNaN(s.top)||"mouse"===o||!r.isFunction(p.effect)?d.css(s):r.isFunction(p.effect)&&(p.effect.call(d,this,r.extend({},s)),d.queue(function(n){r(this).css({opacity:"",height:""});y.ie&&this.style.removeAttribute("filter");n()})),this.positioning=u,this):this};e.reposition.offset=function(n,i,u){function s(n,t){i.left+=t*n.scrollLeft();i.top+=t*n.scrollTop()}if(!u[0])return i;var o,h,e,c,l=r(n[0].ownerDocument),a=!!y.ie&&"CSS1Compat"!==t.compatMode,f=u[0];do"static"!==(h=r.css(f,"position"))&&("fixed"===h?(e=f.getBoundingClientRect(),s(l,-1)):(e=r(f).position(),e.left+=parseFloat(r.css(f,"borderLeftWidth"))||0,e.top+=parseFloat(r.css(f,"borderTopWidth"))||0),i.left-=e.left+(parseFloat(r.css(f,"marginLeft"))||0),i.top-=e.top+(parseFloat(r.css(f,"marginTop"))||0),o||"hidden"===(c=r.css(f,"overflow"))||"visible"===c||(o=r(f)));while(f=f.offsetParent);return o&&(o[0]!==l[0]||a)&&s(o,1),i};vt=(nt=e.reposition.Corner=function(n,t){n=(""+n).replace(/([A-Z])/," $1").replace(/middle/gi,l).toLowerCase();this.x=(n.match(/left|right/i)||n.match(/center/)||["inherit"])[0].toLowerCase();this.y=(n.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();this.forceY=!!t;var i=n.charAt(0);this.precedance="t"===i||"b"===i?v:p}).prototype;vt.invert=function(n,t){this[n]=this[n]===w?k:this[n]===k?w:t||this[n]};vt.string=function(n){var t=this.x,i=this.y,r=t!==i?"center"===t||"center"!==i&&(this.precedance===v||this.forceY)?[i,t]:[t,i]:[t];return n!==!1?r.join(" "):r};vt.abbrev=function(){var n=this.string(!1);return n[0].charAt(0)+(n[1]&&n[1].charAt(0)||"")};vt.clone=function(){return new nt(this.string(),this.forceY)};e.toggle=function(n,i){var c=this.cache,b=this.options,e=this.tooltip;if(i){if(/over|enter/.test(i.type)&&c.event&&/out|leave/.test(c.event.type)&&b.show.target.add(i.target).length===b.show.target.length&&e.has(i.relatedTarget).length)return this;c.event=r.event.fix(i)}if(this.waiting&&!n&&(this.hiddenDuringWait=f),!this.rendered)return n?this.render(1):this;if(this.destroyed||this.disabled)return this;var v,p,l,w=n?"show":"hide",h=this.options[w],k=(this.options[n?"hide":"show"],this.options.position),a=this.options.content,d=this.tooltip.css("width"),g=this.tooltip.is(":visible"),nt=n||1===h.target.length,tt=!i||h.target.length<2||c.target[0]===i.target;return(typeof n).search("boolean|number")&&(n=!g),v=!e.is(":animated")&&g===n&&tt,p=v?s:!!this._trigger(w,[90]),this.destroyed?this:(p!==u&&n&&this.focus(i),!p||v?this:(r.attr(e[0],"aria-hidden",!n),n?(this.mouse&&(c.origin=r.event.fix(this.mouse)),r.isFunction(a.text)&&this._updateContent(a.text,u),r.isFunction(a.title)&&this._updateTitle(a.title,u),!kt&&"mouse"===k.target&&k.adjust.mouse&&(r(t).bind("mousemove."+o,this._storeMouse),kt=f),d||e.css("width",e.outerWidth(u)),this.reposition(i,arguments[2]),d||e.css("width",""),h.solo&&("string"==typeof h.solo?r(h.solo):r(it,h.solo)).not(e).not(h.target).qtip("hide",r.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete c.origin,kt&&!r(it+'[tracking="true"]:visible',h.solo).not(e).length&&(r(t).unbind("mousemove."+o),kt=u),this.blur(i)),l=r.proxy(function(){n?(y.ie&&e[0].style.removeAttribute("filter"),e.css("overflow",""),"string"==typeof h.autofocus&&r(this.options.show.autofocus,e).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):e.css({display:"",visibility:"",opacity:"",left:"",top:""});this._trigger(n?"visible":"hidden")},this),h.effect===u||nt===u?(e[w](),l()):r.isFunction(h.effect)?(e.stop(1,1),h.effect.call(e,this),e.queue("fx",function(n){l();n()})):e.fadeTo(90,n?1:0,l),n&&h.target.trigger("qtip-"+this.id+"-inactive"),this))};e.show=function(n){return this.toggle(f,n)};e.hide=function(n){return this.toggle(u,n)};e.focus=function(n){if(!this.rendered||this.destroyed)return this;var t=r(it),i=this.tooltip,f=parseInt(i[0].style.zIndex,10),u=c.zindex+t.length;return i.hasClass(ot)||this._trigger("focus",[u],n)&&(f!==u&&(t.each(function(){this.style.zIndex>f&&(this.style.zIndex=this.style.zIndex-1)}),t.filter("."+ot).qtip("blur",n)),i.addClass(ot)[0].style.zIndex=u),this};e.blur=function(n){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(ot),this._trigger("blur",[this.tooltip.css("zIndex")],n),this)};e.disable=function(n){return this.destroyed?this:("toggle"===n?n=!(this.rendered?this.tooltip.hasClass(a):this.disabled):"boolean"!=typeof n&&(n=f),this.rendered&&this.tooltip.toggleClass(a,n).attr("aria-disabled",n),this.disabled=!!n,this)};e.enable=function(){return this.disable(u)};e._createButton=function(){var e=this,n=this.elements,i=n.tooltip,t=this.options.content.button,s="string"==typeof t,f=s?t:"Close tooltip";n.button&&n.button.remove();n.button=t.jquery?t:r("<a />",{"class":"qtip-close "+(this.options.style.widget?"":o+"-icon"),title:f,"aria-label":f}).prepend(r("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"}));n.button.appendTo(n.titlebar||i).attr("role","button").click(function(n){return i.hasClass(a)||e.hide(n),u})};e._updateButton=function(n){if(!this.rendered)return u;var t=this.elements.button;n?this._createButton():t.remove()};e._setWidget=function(){var t=this.options.style.widget,n=this.elements,i=n.tooltip,r=i.hasClass(a);i.removeClass(a);a=t?"ui-state-disabled":"qtip-disabled";i.toggleClass(a,r);i.toggleClass("ui-helper-reset "+wt(),t).toggleClass(oi,this.options.style.def&&!t);n.content&&n.content.toggleClass(wt("content"),t);n.titlebar&&n.titlebar.toggleClass(wt("header"),t);n.button&&n.button.toggleClass(o+"-icon",!t)};e._storeMouse=function(n){return(this.mouse=r.event.fix(n)).type="mousemove",this};e._bind=function(n,t,i,u,f){if(n&&i&&t.length){var e="."+this._id+(u?"-"+u:"");return r(n).bind((t.split?t:t.join(e+" "))+e,r.proxy(i,f||this)),this}};e._unbind=function(n,t){return n&&r(n).unbind("."+this._id+(t?"-"+t:"")),this};e._trigger=function(n,t,i){var f=r.Event("tooltip"+n);return f.originalEvent=i&&r.extend({},i)||this.cache.event||s,this.triggering=n,this.tooltip.trigger(f,[this].concat(t||[])),this.triggering=u,!f.isDefaultPrevented()};e._bindEvents=function(n,t,i,u,f,e){var o=i.filter(u).add(u.filter(i)),s=[];o.length&&(r.each(t,function(t,i){var u=r.inArray(i,n);u>-1&&s.push(n.splice(u,1)[0])}),s.length&&(this._bind(o,s,function(n){var t=this.rendered?this.tooltip[0].offsetWidth>0:!1;(t?e:f).call(this,n)}),i=i.not(o),u=u.not(o)));this._bind(i,n,f);this._bind(u,t,e)};e._assignInitialEvents=function(n){function i(n){return this.disabled||this.destroyed?u:(this.cache.event=n&&r.event.fix(n),this.cache.target=n&&r(n.target),clearTimeout(this.timers.show),void(this.timers.show=bt.call(this,function(){this.render("object"==typeof n||t.show.ready)},t.prerender?0:t.show.delay)))}var t=this.options,e=t.show.target,s=t.hide.target,h=t.show.event?r.trim(""+t.show.event).split(" "):[],o=t.hide.event?r.trim(""+t.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy");/mouse(over|enter)/i.test(t.show.event)&&!/mouse(out|leave)/i.test(t.hide.event)&&o.push("mouseleave");this._bind(e,"mousemove",function(n){this._storeMouse(n);this.cache.onTarget=f});this._bindEvents(h,o,e,s,i,function(){return this.timers?void clearTimeout(this.timers.show):u});(t.show.ready||t.prerender)&&i.call(this,n)};e._assignEvents=function(){var y=this,i=this.options,f=i.position,e=this.tooltip,s=i.show.target,o=i.hide.target,p=f.container,h=f.viewport,l=r(t),v=(r(t.body),r(n)),w=i.show.event?r.trim(""+i.show.event).split(" "):[],b=i.hide.event?r.trim(""+i.hide.event).split(" "):[];r.each(i.events,function(n,t){y._bind(e,"toggle"===n?["tooltipshow","tooltiphide"]:["tooltip"+n],t,null,e)});/mouse(out|leave)/i.test(i.hide.event)&&"window"===i.hide.leave&&this._bind(l,["mouseout","blur"],function(n){/select|option/.test(n.target.nodeName)||n.relatedTarget||this.hide(n)});i.hide.fixed?o=o.add(e.addClass(gi)):/mouse(over|enter)/i.test(i.show.event)&&this._bind(o,"mouseleave",function(){clearTimeout(this.timers.show)});(""+i.hide.event).indexOf("unfocus")>-1&&this._bind(p.closest("html"),["mousedown","touchstart"],function(n){var t=r(n.target),i=this.rendered&&!this.tooltip.hasClass(a)&&this.tooltip[0].offsetWidth>0,u=t.parents(it).filter(this.tooltip[0]).length>0;t[0]===this.target[0]||t[0]===this.tooltip[0]||u||this.target.has(t[0]).length||!i||this.hide(n)});"number"==typeof i.hide.inactive&&(this._bind(s,"qtip-"+this.id+"-inactive",ri,"inactive"),this._bind(o.add(e),c.inactiveEvents,ri));this._bindEvents(w,b,s,o,er,or);this._bind(s.add(e),"mousemove",function(n){if("number"==typeof i.hide.distance){var t=this.cache.origin||{},r=this.options.hide.distance,u=Math.abs;(u(n.pageX-t.pageX)>=r||u(n.pageY-t.pageY)>=r)&&this.hide(n)}this._storeMouse(n)});"mouse"===f.target&&f.adjust.mouse&&(i.hide.event&&this._bind(s,["mouseenter","mouseleave"],function(n){return this.cache?void(this.cache.onTarget="mouseenter"===n.type):u}),this._bind(l,"mousemove",function(n){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(a)&&this.tooltip[0].offsetWidth>0&&this.reposition(n)}));(f.adjust.resize||h.length)&&this._bind(r.event.special.resize?h:v,"resize",pi);f.adjust.scroll&&this._bind(v.add(f.container),"scroll",pi)};e._unassignEvents=function(){var u=this.options,f=u.show.target,e=u.hide.target,i=r.grep([this.elements.target[0],this.rendered&&this.tooltip[0],u.position.container[0],u.position.viewport[0],u.position.container.closest("html")[0],n,t],function(n){return"object"==typeof n});f&&f.toArray&&(i=i.concat(f.toArray()));e&&e.toArray&&(i=i.concat(e.toArray()));this._unbind(i)._unbind(i,"destroy")._unbind(i,"inactive")};r(function(){wi(it,["mouseenter","mouseleave"],function(n){var u="mouseenter"===n.type,i=r(n.currentTarget),f=r(n.relatedTarget||n.target),t=this.options;u?(this.focus(n),i.hasClass(gi)&&!i.hasClass(a)&&clearTimeout(this.timers.hide)):"mouse"===t.position.target&&t.position.adjust.mouse&&t.hide.event&&t.show.target&&!f.closest(t.show.target[0]).length&&this.hide(n);i.toggleClass(ar,u)});wi("["+dt+"]",di,ri)});c=r.fn.qtip=function(n,t,e){var a=(""+n).toLowerCase(),y=s,p=r.makeArray(arguments).slice(1),v=p[p.length-1],l=this[0]?r.data(this[0],o):s;return!arguments.length&&l||"api"===a?l:"string"==typeof n?(this.each(function(){var n=r.data(this,o);if(!n)return f;if(v&&v.timeStamp&&(n.cache.event=v),t&&("option"===a||"options"===a)){if(e===i&&!r.isPlainObject(t))return y=n.get(t),u;n.set(t,e)}else n[a]&&n[a].apply(n,p)}),y!==s?y:this):"object"!=typeof n&&arguments.length?void 0:(l=pt(r.extend(f,{},n)),this.each(function(n){var i,t;return t=r.isArray(l.id)?l.id[n]:l.id,t=!t||t===u||t.length<1||c.api[t]?c.nextid++:t,i=sr(r(this),t,l),i===u?f:(c.api[t]=i,r.each(h,function(){"initialize"===this.initialize&&this(i)}),void i._assignInitialEvents(v))}))};r.qtip=ii;c.api={};r.each({attr:function(n,t){if(this.length){var u=this[0],f="title",i=r.data(u,"qtip");if(n===f&&i&&"object"==typeof i&&i.options.suppress)return arguments.length<2?r.attr(u,rt):(i&&i.options.content.attr===f&&i.cache.attr&&i.set("content.text",t),this.attr(rt,t))}return r.fn["attr"+st].apply(this,arguments)},clone:function(n){var t=(r([]),r.fn["clone"+st].apply(this,arguments));return n||t.filter("["+rt+"]").attr("title",function(){return r.attr(this,rt)}).removeAttr(rt),t}},function(n,t){if(!t||r.fn[n+st])return f;var i=r.fn[n+st]=r.fn[n];r.fn[n]=function(){return t.apply(this,arguments)||i.apply(this,arguments)}});r.ui||(r["cleanData"+st]=r.cleanData,r.cleanData=function(n){for(var t,i=0;(t=r(n[i])).length;i++)if(t.attr(ei))try{t.triggerHandler("removeqtip")}catch(u){}r["cleanData"+st].apply(this,arguments)});c.version="2.2.1";c.nextid=0;c.inactiveEvents=di;c.zindex=15e3;c.defaults={prerender:u,id:u,overwrite:f,suppress:f,content:{text:f,attr:"title",title:u,button:u},position:{my:"top left",at:"bottom right",target:u,container:u,viewport:u,adjust:{x:0,y:0,mouse:f,scroll:f,resize:f,method:"flipinvert flipinvert"},effect:function(n,t){r(this).animate(t,{duration:200,queue:u})}},show:{target:u,event:"mouseenter",effect:f,delay:90,solo:u,ready:u,autofocus:u},hide:{target:u,event:"mouseleave",effect:f,delay:0,fixed:u,inactive:u,leave:"window",distance:u},style:{classes:"",widget:u,width:u,height:u,def:f},events:{render:s,move:s,show:s,hide:s,toggle:s,visible:s,hidden:s,focus:s,blur:s}};var si,hi="margin",gt="border",yt="color",ht="background-color",ir="transparent",rr=" !important",ni=!!t.createElement("canvas").getContext,ur=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ci={},vr=["Webkit","O","Moz","ms"];if(ni)var yr=n.devicePixelRatio||1,pr=function(){var n=t.createElement("canvas").getContext("2d");return n.backingStorePixelRatio||n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||1}(),ct=yr/pr;else li=function(n,t,i){return"<qtipvml:"+n+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(t||"")+' style="behavior: url(#default#VML); '+(i||"")+'" />'};r.extend(bi.prototype,{init:function(n){var t,i;i=this.element=n.elements.tip=r("<div />",{"class":o+"-tip"}).prependTo(n.tooltip);ni?(t=r("<canvas />").appendTo(this.element)[0].getContext("2d"),t.lineJoin="miter",t.miterLimit=1e5,t.save()):(t=li("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(t+t),n._bind(r("*",i).add(i),["click","mousedown"],function(n){n.stopPropagation()},this._ns));n._bind(n.tooltip,"tooltipmove",this.reposition,this._ns,this);this.create()},_swapDimensions:function(){this.size[0]=this.options.height;this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width;this.size[1]=this.options.height},_useTitle:function(n){var t=this.qtip.elements.titlebar;return t&&(n.y===b||n.y===l&&this.element.position().top+this.size[1]/2+this.options.offset<t.outerHeight(f))},_parseCorner:function(n){var t=this.qtip.options.position.my;return n===u||t===u?n=u:n===f?n=new nt(t.string()):n.string||(n=new nt(n),n.fixed=f),n},_parseWidth:function(n,t,i){var r=this.qtip.elements,u=gt+lt(t)+"Width";return(i?et(i,u):et(r.content,u)||et(this._useTitle(n)&&r.titlebar||r.content,u)||et(r.tooltip,u))||0},_parseRadius:function(n){var t=this.qtip.elements,i=gt+lt(n.y)+lt(n.x)+"Radius";return y.ie<9?0:et(this._useTitle(n)&&t.titlebar||t.content,i)||et(t.tooltip,i)||0},_invalidColour:function(n,t,i){var r=n.css(t);return!r||i&&r===n.css(i)||ur.test(r)?u:r},_parseColours:function(n){var i=this.qtip.elements,u=this.element.css("cssText",""),f=gt+lt(n[n.precedance])+lt(yt),o=this._useTitle(n)&&i.titlebar||i.content,t=this._invalidColour,e=[];return e[0]=t(u,ht)||t(o,ht)||t(i.content,ht)||t(i.tooltip,ht)||u.css(ht),e[1]=t(u,f,yt)||t(o,f,yt)||t(i.content,f,yt)||t(i.tooltip,f,yt)||i.tooltip.css(f),r("*",u).add(u).css("cssText",ht+":"+ir+rr+";"+gt+":0"+rr+";"),e},_calculateSize:function(n){var o,f,e,s=n.precedance===v,h=this.options.width,r=this.options.height,c="c"===n.abbrev(),l=(s?h:r)*(c?.5:1),i=Math.pow,a=Math.round,u=Math.sqrt(i(l,2)+i(r,2)),t=[this.border/l*u,this.border/r*u];return t[2]=Math.sqrt(i(t[0],2)-i(this.border,2)),t[3]=Math.sqrt(i(t[1],2)-i(this.border,2)),o=u+t[2]+t[3]+(c?0:t[0]),f=o/u,e=[a(f*h),a(f*r)],s?e:e.reverse()},_calculateTip:function(n,t,i){i=i||1;t=t||this.size;var r=t[0]*i,u=t[1]*i,e=Math.ceil(r/2),o=Math.ceil(u/2),f={br:[0,0,r,u,r,0],bl:[0,0,r,0,0,u],tr:[0,u,r,0,r,u],tl:[0,0,0,u,r,u],tc:[0,u,e,0,r,u],bc:[0,0,r,0,e,u],rc:[0,0,r,o,0,u],lc:[r,0,r,u,0,o]};return f.lt=f.br,f.rt=f.bl,f.lb=f.tr,f.rb=f.tl,f[n.abbrev()]},_drawCoords:function(n,t){n.beginPath();n.moveTo(t[0],t[1]);n.lineTo(t[2],t[3]);n.lineTo(t[4],t[5]);n.closePath()},create:function(){var n=this.corner=(ni||y.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=n.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(t,i){if(!this.enabled)return this;var a,ft,h,c,et,d,o,s,st=this.qtip.elements,ot=this.element,it=ot.children(),rt=this.options,g=this.size,e=rt.mimic,ut=Math.round;t||(t=this.qtip.cache.corner||this.corner);e===u?e=t:(e=new nt(e),e.precedance=t.precedance,"inherit"===e.x?e.x=t.x:"inherit"===e.y?e.y=t.y:e.x===e.y&&(e[t.precedance]=t[t.precedance]));ft=e.precedance;t.precedance===p?this._swapDimensions():this._resetDimensions();a=this.color=this._parseColours(t);a[1]!==ir?(s=this.border=this._parseWidth(t,t[t.precedance]),rt.border&&1>s&&!ur.test(a[1])&&(a[0]=a[1]),this.border=s=rt.border!==f?rt.border:s):this.border=s=0;o=this.size=this._calculateSize(t);ot.css({width:o[0],height:o[1],lineHeight:o[1]+"px"});d=t.precedance===v?[ut(e.x===w?s:e.x===k?o[0]-g[0]-s:(o[0]-g[0])/2),ut(e.y===b?o[1]-g[1]:0)]:[ut(e.x===w?o[0]-g[0]:0),ut(e.y===b?s:e.y===tt?o[1]-g[1]-s:(o[1]-g[1])/2)];ni?(h=it[0].getContext("2d"),h.restore(),h.save(),h.clearRect(0,0,6e3,6e3),c=this._calculateTip(e,g,ct),et=this._calculateTip(e,this.size,ct),it.attr(at,o[0]*ct).attr(fi,o[1]*ct),it.css(at,o[0]).css(fi,o[1]),this._drawCoords(h,et),h.fillStyle=a[1],h.fill(),h.translate(d[0]*ct,d[1]*ct),this._drawCoords(h,c),h.fillStyle=a[0],h.fill()):(c=this._calculateTip(e),c="m"+c[0]+","+c[1]+" l"+c[2]+","+c[3]+" "+c[4]+","+c[5]+" xe",d[2]=s&&/^(r|b)/i.test(t.string())?8===y.ie?2:1:0,it.css({coordsize:o[0]+s+" "+(o[1]+s),antialias:""+(e.string().indexOf(l)>-1),left:d[0]-d[2]*Number(ft===p),top:d[1]-d[2]*Number(ft===v),width:o[0]+s,height:o[1]+s}).each(function(n){var t=r(this);t[t.prop?"prop":"attr"]({coordsize:o[0]+s+" "+(o[1]+s),path:c,fillcolor:a[0],filled:!!n,stroked:!n}).toggle(!(!s&&!n));n||t.html(li("stroke",'weight="'+2*s+'px" color="'+a[1]+'" miterlimit="1000" joinstyle="miter"'))}));n.opera&&setTimeout(function(){st.tip.css({display:"inline-block",visibility:"visible"})},1);i!==u&&this.calculate(t,o)},calculate:function(n,t){if(!this.enabled)return u;var i,o,e=this,s=this.qtip.elements,c=this.element,h=this.options.offset,f=(s.tooltip.hasClass("ui-widget"),{});return n=n||this.corner,i=n.precedance,t=t||this._calculateSize(n),o=[n.x,n.y],i===p&&o.reverse(),r.each(o,function(r,u){var o,a,c;u===l?(o=i===v?w:b,f[o]="50%",f[hi+"-"+o]=-Math.round(t[i===v?0:1]/2)+h):(o=e._parseWidth(n,u,s.tooltip),a=e._parseWidth(n,u,s.content),c=e._parseRadius(n),f[u]=Math.max(-e.border,r?a:h+(c>o?c:-o)))}),f[n[i]]-=t[i===p?0:1],c.css({margin:"",top:"",bottom:"",left:"",right:""}).css(f),f},reposition:function(n,t,r){function it(n,t,i,r,u){n===ft&&s.precedance===t&&h[r]&&s[i]!==l?s.precedance=s.precedance===p?v:p:n!==ft&&h[r]&&(s[t]=s[t]===l?h[r]>0?r:u:s[t]===r?u:r)}function rt(n,t,f){s[n]===l?nt[hi+"-"+t]=o[n]=e[hi+"-"+t]-h[t]:(a=e[f]!==i?[h[t],-e[t]]:[-h[t],e[t]],(o[n]=Math.max(a[0],a[1]))>a[0]&&(r[t]-=h[t],o[t]=u),nt[e[f]!==i?f:t]=o[n])}if(this.enabled){var e,a,c=t.cache,s=this.corner.clone(),h=r.adjusted,y=t.options.position.adjust.method.split(" "),d=y[0],g=y[1]||y[0],o={left:u,top:u,x:0,y:0},nt={};this.corner.fixed!==f&&(it(d,p,v,w,k),it(g,v,p,b,tt),(s.string()!==c.corner.string()||c.cornerTop!==h.top||c.cornerLeft!==h.left)&&this.update(s,u));e=this.calculate(s);e.right!==i&&(e.left=-e.right);e.bottom!==i&&(e.top=-e.bottom);e.user=this.offset;(o.left=d===ft&&!!h.left)&&rt(p,w,k);(o.top=g===ft&&!!h.top)&&rt(v,b,tt);this.element.css(nt).toggle(!(o.x&&o.y||s.x===l&&o.y||s.y===l&&o.x));r.left-=e.left.charAt?e.user:d!==ft||o.top||!o.left&&!o.top?e.left+this.border:0;r.top-=e.top.charAt?e.user:g!==ft||o.left||!o.left&&!o.top?e.top+this.border:0;c.cornerLeft=h.left;c.cornerTop=h.top;c.corner=s.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns);this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}});si=h.tip=function(n){return new bi(n,n.options.style.tip)};si.initialize="render";si.sanitize=function(n){if(n.style&&"tip"in n.style){var t=n.style.tip;"object"!=typeof t&&(t=n.style.tip={corner:t});/string|boolean/i.test(typeof t.corner)||(t.corner=f)}};ui.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create();this.qtip.reposition()},"^style.tip.(height|width)$":function(n){this.size=[n.width,n.height];this.update();this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}};r.extend(f,c.defaults,{style:{tip:{corner:f,mimic:u,width:6,height:6,border:f,offset:0}}});h.viewport=function(i,r,f,e,o,s,h){function lt(n,t,i,u,f,e,o,s,h){var v=r[f],c=y[n],k=bt[n],it=i===ft,nt=c===f?h:c===e?-h:-h/2,rt=k===f?s:k===e?-s:-s/2,tt=ot[f]+g[f]-(vt?0:d[f]),b=tt-v,w=v+h-(o===at?ut:et)-tt,p=nt-(y.precedance===n||c===y[t]?rt:0)-(k===l?s/2:0);return it?(p=(c===f?1:-1)*nt,r[f]+=b>0?b:w>0?-w:0,r[f]=Math.max(-d[f]+g[f],v-p,Math.min(Math.max(-d[f]+g[f]+(o===at?ut:et),v+p),r[f],"center"===c?v-nt:1e9))):(u*=i===cr?2:0,b>0&&(c!==f||w>0)?(r[f]-=p+u,a.invert(n,f)):w>0&&(c!==e||b>0)&&(r[f]-=(c===l?-p:p)+u,a.invert(n,e)),r[f]<ot&&-r[f]>w&&(r[f]=v,a=y.clone())),r[f]-v}var rt,a,d,vt,ut,et,ot,g,yt=f.target,wt=i.elements.tooltip,y=f.my,bt=f.at,nt=f.adjust,st=nt.method.split(" "),ht=st[0],ct=st[1]||st[0],c=f.viewport,pt=f.container,it=(i.cache,{left:0,top:0});return c.jquery&&yt[0]!==n&&yt[0]!==t.body&&"none"!==nt.method?(d=pt.offset()||it,vt="static"===pt.css("position"),rt="fixed"===wt.css("position"),ut=c[0]===n?c.width():c.outerWidth(u),et=c[0]===n?c.height():c.outerHeight(u),ot={left:rt?0:c.scrollLeft(),top:rt?0:c.scrollTop()},g=c.offset()||it,("shift"!==ht||"shift"!==ct)&&(a=y.clone()),it={left:"none"!==ht?lt(p,v,ht,nt.x,w,k,at,e,s):0,top:"none"!==ct?lt(v,p,ct,nt.y,b,tt,fi,o,h):0,my:a}):it};h.polys={polygon:function(n,t){for(var r,h,c,i={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:u},f=0,e=[],o=1,s=1,a=0,v=0,f=n.length;f--;)r=[parseInt(n[--f],10),parseInt(n[f+1],10)],r[0]>i.position.right&&(i.position.right=r[0]),r[0]<i.position.left&&(i.position.left=r[0]),r[1]>i.position.bottom&&(i.position.bottom=r[1]),r[1]<i.position.top&&(i.position.top=r[1]),e.push(r);if(h=i.width=Math.abs(i.position.right-i.position.left),c=i.height=Math.abs(i.position.bottom-i.position.top),"c"===t.abbrev())i.position={left:i.position.left+i.width/2,top:i.position.top+i.height/2};else{for(;h>0&&c>0&&o>0&&s>0;)for(h=Math.floor(h/2),c=Math.floor(c/2),t.x===w?o=h:t.x===k?o=i.width-h:o+=Math.floor(h/2),t.y===b?s=c:t.y===tt?s=i.height-c:s+=Math.floor(c/2),f=e.length;f--&&!(e.length<2);)a=e[f][0]-i.position.left,v=e[f][1]-i.position.top,(t.x===w&&a>=o||t.x===k&&o>=a||t.x===l&&(o>a||a>i.width-o)||t.y===b&&v>=s||t.y===tt&&s>=v||t.y===l&&(s>v||v>i.height-s))&&e.splice(f,1);i.position={left:e[0][0],top:e[0][1]}}return i},rect:function(n,t,i,r){return{width:Math.abs(i-n),height:Math.abs(r-t),position:{left:Math.min(n,i),top:Math.min(t,r)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(n,t,i,r,f){var e=h.polys._angles[f.abbrev()],o=0===e?0:i*Math.cos(e*Math.PI),s=r*Math.sin(e*Math.PI);return{width:2*i-Math.abs(o),height:2*r-Math.abs(s),position:{left:n+o,top:t+s},adjustable:u}},circle:function(n,t,i,r){return h.polys.ellipse(n,t,i,i,r)}};h.imagemap=function(n,t,i){t.jquery||(t=r(t));var e,s,c,o,v,l=(t.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),f=r('img[usemap="#'+t.parent("map").attr("name")+'"]'),y=r.trim(t.attr("coords")),a=y.replace(/,$/,"").split(",");if(!f.length)return u;if("polygon"===l)o=h.polys.polygon(a,i);else{if(!h.polys[l])return u;for(c=-1,v=a.length,s=[];++c<v;)s.push(parseInt(a[c],10));o=h.polys[l].apply(this,s.concat(i))}return e=f.offset(),e.left+=Math.ceil((f.outerWidth(u)-f.width())/2),e.top+=Math.ceil((f.outerHeight(u)-f.height())/2),o.position.left+=e.left,o.position.top+=e.top,o};h.svg=function(n,i,f){for(var a,b,p,k,w,v,s,o,c,e=(r(t),i[0]),y=r(e.ownerSVGElement),l=e.ownerDocument,d=(parseInt(i.css("stroke-width"),10)||0)/2;!e.getBBox;)e=e.parentNode;if(!e.getBBox||!e.parentNode)return u;switch(e.nodeName){case"ellipse":case"circle":o=h.polys.ellipse(e.cx.baseVal.value,e.cy.baseVal.value,(e.rx||e.r).baseVal.value+d,(e.ry||e.r).baseVal.value+d,f);break;case"line":case"polygon":case"polyline":for(s=e.points||[{x:e.x1.baseVal.value,y:e.y1.baseVal.value},{x:e.x2.baseVal.value,y:e.y2.baseVal.value}],o=[],v=-1,k=s.numberOfItems||s.length;++v<k;)w=s.getItem?s.getItem(v):s[v],o.push.apply(o,[w.x,w.y]);o=h.polys.polygon(o,f);break;default:o=e.getBBox();o={width:o.width,height:o.height,position:{left:o.x,top:o.y}}}return c=o.position,y=y[0],y.createSVGPoint&&(b=e.getScreenCTM(),s=y.createSVGPoint(),s.x=c.left,s.y=c.top,p=s.matrixTransform(b),c.left=p.x,c.top=p.y),l!==t&&"mouse"!==n.position.target&&(a=r((l.defaultView||l.parentWindow).frameElement).offset(),a&&(c.left+=a.left,c.top+=a.top)),l=r(l),c.left+=l.scrollLeft(),c.top+=l.scrollTop(),o};ti="qtip-modal";g="."+ti;d=function(){function l(n){if(r.expr[":"].focusable)return r.expr[":"].focusable;var t,i,u,e=!isNaN(r.attr(n,"tabindex")),f=n.nodeName&&n.nodeName.toLowerCase();return"area"===f?(t=n.parentNode,i=t.name,n.href&&i&&"map"===t.nodeName.toLowerCase()?(u=r("img[usemap=#"+i+"]")[0],!!u&&u.is(":visible")):!1):/input|select|textarea|button|object/.test(f)?!n.disabled:"a"===f?n.href||e:e}function h(n){o.length<1&&n.length?n.not("body").blur():o.first().focus()}function a(t){if(n.is(":visible")){var e,f=r(t.target),s=i.tooltip,c=f.closest(it);e=c.length<1?u:parseInt(c[0].style.zIndex,10)>parseInt(s[0].style.zIndex,10);e||f.closest(it)[0]===s[0]||h(f);v=t.target===o[o.length-1]}}var i,v,c,n,e=this,o={};r.extend(e,{init:function(){return n=e.elem=r("<div />",{id:"qtip-overlay",html:"<div><\/div>",mousedown:function(){return u}}).hide(),r(t.body).bind("focusin"+g,a),r(t).bind("keydown"+g,function(n){i&&i.options.show.modal.escape&&27===n.keyCode&&i.hide(n)}),n.bind("click"+g,function(n){i&&i.options.show.modal.blur&&i.hide(n)}),e},update:function(n){i=n;o=n.options.show.modal.stealfocus!==u?n.tooltip.find("*").filter(function(){return l(this)}):[]},toggle:function(o,l,a){var p=(r(t.body),o.tooltip),v=o.options.show.modal,y=v.effect,w=l?"show":"hide",b=n.is(":visible"),k=r(g).filter(":visible:not(:animated)").not(p);return e.update(o),l&&v.stealfocus!==u&&h(r(":focus")),n.toggleClass("blurs",v.blur),l&&n.appendTo(t.body),n.is(":animated")&&b===l&&c!==u||!l&&k.length?e:(n.stop(f,u),r.isFunction(y)?y.call(n,l):y===u?n[w]():n.fadeTo(parseInt(a,10)||90,l?1:0,function(){l||n.hide()}),l||n.queue(function(t){n.css({left:"",top:""});r(g).length||n.detach();t()}),c=l,i.destroyed&&(i=s),e)}});e.init()};d=new d;r.extend(ki.prototype,{init:function(n){var t=n.tooltip;return this.options.on?(n.elements.overlay=d.elem,t.addClass(ti).css("z-index",c.modal_zindex+r(g).length),n._bind(t,["tooltipshow","tooltiphide"],function(n,i,u){var f=n.originalEvent;if(n.target===t[0])if(f&&"tooltiphide"===n.type&&/mouse(leave|enter)/.test(f.type)&&r(f.relatedTarget).closest(d.elem[0]).length)try{n.preventDefault()}catch(e){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(n,"tooltipshow"===n.type,u)},this._ns,this),n._bind(t,"tooltipfocus",function(n,i){if(!n.isDefaultPrevented()&&n.target===t[0]){var u=r(g),f=c.modal_zindex+u.length,e=parseInt(t[0].style.zIndex,10);d.elem[0].style.zIndex=f-1;u.each(function(){this.style.zIndex>e&&(this.style.zIndex-=1)});u.filter("."+ot).qtip("blur",n.originalEvent);t.addClass(ot)[0].style.zIndex=f;d.update(i);try{n.preventDefault()}catch(o){}}},this._ns,this),void n._bind(t,"tooltiphide",function(n){n.target===t[0]&&r(g).filter(":visible").not(t).last().qtip("focus",n)},this._ns,this)):this},toggle:function(n,t,i){return n&&n.isDefaultPrevented()?this:void d.toggle(this.qtip,!!t,i)},destroy:function(){this.qtip.tooltip.removeClass(ti);this.qtip._unbind(this.qtip.tooltip,this._ns);d.toggle(this.qtip,u);delete this.qtip.elements.overlay}});ai=h.modal=function(n){return new ki(n,n.options.show.modal)};ai.sanitize=function(n){n.show&&("object"!=typeof n.show.modal?n.show.modal={on:!!n.show.modal}:"undefined"==typeof n.show.modal.on&&(n.show.modal.on=f))};c.modal_zindex=c.zindex-200;ai.initialize="render";ui.modal={"^show.modal.(on|blur)$":function(){this.destroy();this.init();this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}};r.extend(f,c.defaults,{show:{modal:{on:u,effect:f,blur:f,stealfocus:f,escape:f}}})})}(window,document);$(document).ready(FillToolTip())