// ***************************
// js.compressed/jquery/jquery.qtip.min.js
// ***************************
/*
* qTip2 - Pretty powerful tooltips
* http://craigsworks.com/projects/qtip2/
*
* Version: nightly
* Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com
*
* Dual licensed under MIT or GPLv2 licenses
*   http://en.wikipedia.org/wiki/MIT_License
*   http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Mon Dec 19 15:43:28.0000000000 2011
*//*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true *//*global window: false, jQuery: false, console: false */(function(a,b,c){function E(b){var c=this,d=b.elements,e=d.tooltip,f=".bgiframe-"+b.id;a.extend(c,{init:function(){d.bgiframe=a('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>'),d.bgiframe.appendTo(e),e.bind("tooltipmove"+f,c.adjust)},adjust:function(){var a=b.get("dimensions"),c=b.plugins.tip,f=d.tip,g,h;h=parseInt(e.css("border-left-width"),10)||0,h={left:-h,top:-h},c&&f&&(g=c.corner.precedance==="x"?["width","left"]:["height","top"],h[g[1]]-=f[g[0]]()),d.bgiframe.css(h).css(a)},destroy:function(){d.bgiframe.remove(),e.unbind(f)}}),c.init()}function D(c){var f=this,g=c.options.show.modal,i=c.elements,j=i.tooltip,k="#qtip-overlay",l=".qtipmodal",m=l+c.id,o="is-modal-qtip",q=a(document.body),r;c.checks.modal={"^show.modal.(on|blur)$":function(){f.init(),i.overlay.toggle(j.is(":visible"))}},a.extend(f,{init:function(){if(!g.on)return f;r=f.create(),j.attr(o,d).css("z-index",h.modal.zindex+a(n+"["+o+"]").length).unbind(l).unbind(m).bind("tooltipshow"+l+" tooltiphide"+l,function(b,c,d){var e=b.originalEvent;if(e&&b.type==="tooltiphide"&&/mouse(leave|enter)/.test(e.type)&&a(e.relatedTarget).closest(r[0]).length)try{b.preventDefault()}catch(g){}else(!e||e&&!e.solo)&&f[b.type.replace("tooltip","")](b,d)}).bind("tooltipfocus"+l,function(b){if(!b.isDefaultPrevented()){var c=a(n).filter("["+o+"]"),d=h.modal.zindex+c.length,e=parseInt(j[0].style.zIndex,10);r[0].style.zIndex=d-1,c.each(function(){this.style.zIndex>e&&(this.style.zIndex-=1)}),c.end().filter("."+p).qtip("blur",b.originalEvent),j.addClass(p)[0].style.zIndex=d;try{b.preventDefault()}catch(f){}}}).bind("tooltiphide"+l,function(b){a("["+o+"]").filter(":visible").not(j).last().qtip("focus",b)}),g.escape&&a(b).unbind(m).bind("keydown"+m,function(a){a.keyCode===27&&j.hasClass(p)&&c.hide(a)}),g.blur&&i.overlay.unbind(m).bind("click"+m,function(a){j.hasClass(p)&&c.hide(a)});return f},create:function(){var c=a(k);if(c.length)return i.overlay=c.insertAfter(a(n).last());r=i.overlay=a("<div />",{id:k.substr(1),html:"<div></div>",mousedown:function(){return e}}).insertAfter(a(n).last()),a(b).unbind(l).bind("resize"+l,function(){r.css({height:a(b).height(),width:a(b).width()})}).triggerHandler("resize");return r},toggle:function(b,c,h){if(b&&b.isDefaultPrevented())return f;var i=g.effect,k=c?"show":"hide",l=r.is(":visible"),p=a("["+o+"]").filter(":visible").not(j),s;r||(r=f.create());if(r.is(":animated")&&l===c||!c&&p.length)return f;c?(r.css({left:0,top:0}),r.toggleClass("blurs",g.blur),q.bind("focusin"+m,function(b){var c=a(b.target),d=c.closest(".qtip"),f=d.length<1?e:parseInt(d[0].style.zIndex,10)>parseInt(j[0].style.zIndex,10);!f&&a(b.target).closest(n)[0]!==j[0]&&j.find("input:visible").filter(":first").focus()})):q.undelegate("*","focusin"+m),r.stop(d,e),a.isFunction(i)?i.call(r,c):i===e?r[k]():r.fadeTo(parseInt(h,10)||90,c?1:0,function(){c||a(this).hide()}),c||r.queue(function(a){r.css({left:"",top:""}),a()});return f},show:function(a,b){return f.toggle(a,d,b)},hide:function(a,b){return f.toggle(a,e,b)},destroy:function(){var d=r;d&&(d=a("["+o+"]").not(j).length<1,d?(i.overlay.remove(),a(b).unbind(l)):i.overlay.unbind(l+c.id),q.undelegate("*","focusin"+m));return j.removeAttr(o).unbind(l)}}),f.init()}function C(b,g){function w(a){var b=a.precedance==="y",c=n[b?"width":"height"],d=n[b?"height":"width"],e=a.string().indexOf("center")>-1,f=c*(e?.5:1),g=Math.pow,h=Math.round,i,j,k,l=Math.sqrt(g(f,2)+g(d,2)),m=[p/f*l,p/d*l];m[2]=Math.sqrt(g(m[0],2)-g(p,2)),m[3]=Math.sqrt(g(m[1],2)-g(p,2)),i=l+m[2]+m[3]+(e?0:m[0]),j=i/l,k=[h(j*d),h(j*c)];return{height:k[b?0:1],width:k[b?1:0]}}function v(b){var c=k.titlebar&&b.y==="top",d=c?k.titlebar:k.content,e=a.browser.mozilla,f=e?"-moz-":a.browser.webkit?"-webkit-":"",g=b.y+(e?"":"-")+b.x,h=f+(e?"border-radius-"+g:"border-"+g+"-radius");return parseInt(d.css(h),10)||parseInt(l.css(h),10)||0}function u(a,b,c){b=b?b:a[a.precedance];var d=l.hasClass(r),e=k.titlebar&&a.y==="top",f=e?k.titlebar:k.content,g="border-"+b+"-width",h;l.addClass(r),h=parseInt(f.css(g),10),h=(c?h||parseInt(l.css(g),10):h)||0,l.toggleClass(r,d);return h}function t(a,f,g,h){if(k.tip){var l=i.corner.clone(),n=g.adjusted,o=b.options.position.adjust.method.split(" "),p=o[0],q=o[1]||o[0],r={left:e,top:e,x:0,y:0},s,t={},u;i.corner.fixed!==d&&(p==="shift"&&l.precedance==="x"&&n.left&&l.y!=="center"?l.precedance=l.precedance==="x"?"y":"x":p==="flip"&&n.left&&(l.x=l.x==="center"?n.left>0?"left":"right":l.x==="left"?"right":"left"),q==="shift"&&l.precedance==="y"&&n.top&&l.x!=="center"?l.precedance=l.precedance==="y"?"x":"y":q==="flip"&&n.top&&(l.y=l.y==="center"?n.top>0?"top":"bottom":l.y==="top"?"bottom":"top"),l.string()!==m.corner.string()&&(m.top!==n.top||m.left!==n.left)&&i.update(l,e)),s=i.position(l,n),s.right!==c&&(s.left=-s.right),s.bottom!==c&&(s.top=-s.bottom),s.user=Math.max(0,j.offset);if(r.left=p==="shift"&&!!n.left)l.x==="center"?t["margin-left"]=r.x=s["margin-left"]-n.left:(u=s.right!==c?[n.left,-s.left]:[-n.left,s.left],(r.x=Math.max(u[0],u[1]))>u[0]&&(g.left-=n.left,r.left=e),t[s.right!==c?"right":"left"]=r.x);if(r.top=q==="shift"&&!!n.top)l.y==="center"?t["margin-top"]=r.y=s["margin-top"]-n.top:(u=s.bottom!==c?[n.top,-s.top]:[-n.top,s.top],(r.y=Math.max(u[0],u[1]))>u[0]&&(g.top-=n.top,r.top=e),t[s.bottom!==c?"bottom":"top"]=r.y);k.tip.css(t).toggle(!(r.x&&r.y||l.x==="center"&&r.y||l.y==="center"&&r.x)),g.left-=s.left.charAt?s.user:p!=="shift"||r.top||!r.left&&!r.top?s.left:0,g.top-=s.top.charAt?s.user:q!=="shift"||r.left||!r.left&&!r.top?s.top:0,m.left=n.left,m.top=n.top,m.corner=l.clone()}}var i=this,j=b.options.style.tip,k=b.elements,l=k.tooltip,m={top:0,left:0},n={width:j.width,height:j.height},o={},p=j.border||0,q=".qtip-tip",s=!!(a("<canvas />")[0]||{}).getContext;i.mimic=i.corner=f,i.border=p,i.offset=j.offset,i.size=n,b.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){i.init()||i.destroy(),b.reposition()},"^style.tip.(height|width)$":function(){n={width:j.width,height:j.height},i.create(),i.update(),b.reposition()},"^content.title.text|style.(classes|widget)$":function(){k.tip&&i.update()}},a.extend(i,{init:function(){var b=i.detectCorner()&&(s||a.browser.msie);b&&(i.create(),i.update(),l.unbind(q).bind("tooltipmove"+q,t));return b},detectCorner:function(){var a=j.corner,c=b.options.position,f=c.at,g=c.my.string?c.my.string():c.my;if(a===e||g===e&&f===e)return e;a===d?i.corner=new h.Corner(g):a.string||(i.corner=new h.Corner(a),i.corner.fixed=d);return i.corner.string()!=="centercenter"},detectColours:function(c){var d,e,f,g=k.tip.css("cssText",""),h=c||i.corner,m=h[h.precedance],p="border-"+m+"-color",q="border"+m.charAt(0)+m.substr(1)+"Color",s=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,t="background-color",u="transparent",v=" !important",w=a(document.body).css("color"),x=b.elements.content.css("color"),y=k.titlebar&&(h.y==="top"||h.y==="center"&&g.position().top+n.height/2+j.offset<k.titlebar.outerHeight(1)),z=y?k.titlebar:k.content;l.addClass(r),o.fill=e=g.css(t),o.border=f=g[0].style[q]||g.css(p)||l.css(p);if(!e||s.test(e))o.fill=z.css(t)||u,s.test(o.fill)&&(o.fill=l.css(t)||e);if(!f||s.test(f)||f===w)o.border=z.css(p)||u,s.test(o.border)&&(o.border=f);a("*",g).add(g).css("cssText",t+":"+u+v+";border:0"+v+";"),l.removeClass(r)},create:function(){var b=n.width,c=n.height,d;k.tip&&k.tip.remove(),k.tip=a("<div />",{"class":"ui-tooltip-tip"}).css({width:b,height:c}).prependTo(l),s?a("<canvas />").appendTo(k.tip)[0].getContext("2d").save():(d='<vml:shape coordorigin="0,0" style="display:inline-block; position:absolute; behavior:url(#default#VML);"></vml:shape>',k.tip.html(d+d),a("*",k.tip).bind("click mousedown",function(a){a.stopPropagation()}))},update:function(b,c){var g=k.tip,l=g.children(),q=n.width,r=n.height,t="px solid ",v="px dashed transparent",x=j.mimic,y=Math.round,z,A,C,D,E;b||(b=m.corner||i.corner),x===e?x=b:(x=new h.Corner(x),x.precedance=b.precedance,x.x==="inherit"?x.x=b.x:x.y==="inherit"?x.y=b.y:x.x===x.y&&(x[b.precedance]=b[b.precedance])),z=x.precedance,i.detectColours(b),o.border!=="transparent"&&o.border!=="#123456"?(p=u(b,f,d),j.border===0&&p>0&&(o.fill=o.border),i.border=p=j.border!==d?j.border:p):i.border=p=0,C=B(x,q,r),i.size=E=w(b),g.css(E),b.precedance==="y"?D=[y(x.x==="left"?p:x.x==="right"?E.width-q-p:(E.width-q)/2),y(x.y==="top"?E.height-r:0)]:D=[y(x.x==="left"?E.width-q:0),y(x.y==="top"?p:x.y==="bottom"?E.height-r-p:(E.height-r)/2)],s?(l.attr(E),A=l[0].getContext("2d"),A.restore(),A.save(),A.clearRect(0,0,3e3,3e3),A.translate(D[0],D[1]),A.beginPath(),A.moveTo(C[0][0],C[0][1]),A.lineTo(C[1][0],C[1][1]),A.lineTo(C[2][0],C[2][1]),A.closePath(),A.fillStyle=o.fill,A.strokeStyle=o.border,A.lineWidth=p*2,A.lineJoin="miter",A.miterLimit=100,p&&A.stroke(),A.fill()):(C="m"+C[0][0]+","+C[0][1]+" l"+C[1][0]+","+C[1][1]+" "+C[2][0]+","+C[2][1]+" xe",D[2]=p&&/^(r|b)/i.test(b.string())?parseFloat(a.browser.version,10)===8?2:1:0,l.css({antialias:""+(x.string().indexOf("center")>-1),left:D[0]-D[2]*Number(z==="x"),top:D[1]-D[2]*Number(z==="y"),width:q+p,height:r+p}).each(function(b){var c=a(this);c[c.prop?"prop":"attr"]({coordsize:q+p+" "+(r+p),path:C,fillcolor:o.fill,filled:!!b,stroked:!b}).css({display:p||b?"block":"none"}),!b&&c.html()===""&&c.html('<vml:stroke weight="'+p*2+'px" color="'+o.border+'" miterlimit="1000" joinstyle="miter"  style="behavior:url(#default#VML); display:inline-block;" />')})),c!==e&&i.position(b)},position:function(b){var c=k.tip,f={},g=Math.max(0,j.offset),h,l,m;if(j.corner===e||!c)return e;b=b||i.corner,h=b.precedance,l=w(b),m=[b.x,b.y],h==="x"&&m.reverse(),a.each(m,function(a,c){var e,i;c==="center"?(e=h==="y"?"left":"top",f[e]="50%",f["margin-"+e]=-Math.round(l[h==="y"?"width":"height"]/2)+g):(e=u(b,c,d),i=v(b),f[c]=a?p?u(b,c):0:g+(i>e?i:0))}),f[b[h]]-=l[h==="x"?"width":"height"],c.css({top:"",bottom:"",left:"",right:"",margin:""}).css(f);return f},destroy:function(){k.tip&&k.tip.remove(),l.unbind(q)}}),m.corner=new h.Corner(i.init())}function B(a,b,c){var d=Math.ceil(b/2),e=Math.ceil(c/2),f={bottomright:[[0,0],[b,c],[b,0]],bottomleft:[[0,0],[b,0],[0,c]],topright:[[0,c],[b,0],[b,c]],topleft:[[0,0],[0,c],[b,c]],topcenter:[[0,c],[d,0],[b,c]],bottomcenter:[[0,0],[b,0],[d,c]],rightcenter:[[0,0],[b,e],[0,c]],leftcenter:[[b,0],[b,c],[0,e]]};f.lefttop=f.bottomright,f.righttop=f.bottomleft,f.leftbottom=f.topright,f.rightbottom=f.topleft;return f[a.string()]}function A(b){var c=this,f=b.elements.tooltip,g=b.options.content.ajax,h=".qtip-ajax",i=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,j=d;b.checks.ajax={"^content.ajax":function(a,b,d){b==="ajax"&&(g=d),b==="once"?c.init():g&&g.url?c.load():f.unbind(h)}},a.extend(c,{init:function(){g&&g.url&&f.unbind(h)[g.once?"one":"bind"]("tooltipshow"+h,c.load);return c},load:function(d,f){function p(a,c,d){a.status!==0&&b.set("content.text",c+": "+d)}function o(c){k&&(c=a("<div/>").append(c.replace(i,"")).find(k)),b.set("content.text",c)}function n(){l&&(b.show(d.originalEvent),f=e),a.isFunction(g.complete)&&g.complete.apply(this,arguments)}var h=g.url.indexOf(" "),j=g.url,k,l=g.once&&!g.loading&&f;if(l)try{d.preventDefault()}catch(m){}else if(d&&d.isDefaultPrevented())return c;h>-1&&(k=j.substr(h),j=j.substr(0,h)),a.ajax(a.extend({success:o,error:p,context:b},g,{url:j,complete:n}))}}),c.init()}function z(b,c){var i,j,k,l,m,n=a(this),o=a(document.body),p=this===document?o:n,q=n.metadata?n.metadata(c.metadata):f,r=c.metadata.type==="html5"&&q?q[c.metadata.name]:f,s=n.data(c.metadata.name||"qtipopts");try{s=typeof s==="string"?(new Function("return "+s))():s}catch(t){w("Unable to parse HTML5 attribute data: "+s)}l=a.extend(d,{},g.defaults,c,typeof s==="object"?x(s):f,x(r||q)),j=l.position,l.id=b;if("boolean"===typeof l.content.text){k=n.attr(l.content.attr);if(l.content.attr!==e&&k)l.content.text=k;else{w("Unable to locate content for tooltip! Aborting render of tooltip on element: ",n);return e}}j.container.length||(j.container=o),j.target===e&&(j.target=p),l.show.target===e&&(l.show.target=p),l.show.solo===d&&(l.show.solo=o),l.hide.target===e&&(l.hide.target=p),l.position.viewport===d&&(l.position.viewport=j.container),j.at=new h.Corner(j.at),j.my=new h.Corner(j.my);if(a.data(this,"qtip"))if(l.overwrite)n.qtip("destroy");else if(l.overwrite===e)return e;l.suppress&&(m=a.attr(this,"title"))&&a(this).removeAttr("title").attr(u,m),i=new y(n,l,b,!!k),a.data(this,"qtip",i),n.bind("remove.qtip-"+b,function(){i.destroy()});return i}function y(s,t,w,y){function R(){var c=[t.show.target[0],t.hide.target[0],z.rendered&&G.tooltip[0],t.position.container[0],t.position.viewport[0],b,document];z.rendered?a([]).pushStack(a.grep(c,function(a){return typeof a==="object"})).unbind(F):t.show.target.unbind(F+"-create")}function Q(){function p(a){E.is(":visible")&&z.reposition(a)}function o(a){if(E.hasClass(m))return e;clearTimeout(z.timers.inactive),z.timers.inactive=setTimeout(function(){z.hide(a)},t.hide.inactive)}function l(b){if(E.hasClass(m)||C||D)return e;var d=a(b.relatedTarget||b.target),g=d.closest(n)[0]===E[0],h=d[0]===f.show[0];clearTimeout(z.timers.show),clearTimeout(z.timers.hide);if(c.target==="mouse"&&g||t.hide.fixed&&(/mouse(out|leave|move)/.test(b.type)&&(g||h)))try{b.preventDefault(),b.stopImmediatePropagation()}catch(i){}else t.hide.delay>0?z.timers.hide=setTimeout(function(){z.hide(b)},t.hide.delay):z.hide(b)}function k(a){if(E.hasClass(m))return e;clearTimeout(z.timers.show),clearTimeout(z.timers.hide);var b=function(){z.toggle(d,a)};t.show.delay>0?z.timers.show=setTimeout(b,t.show.delay):b()}var c=t.position,f={show:t.show.target,hide:t.hide.target,viewport:a(c.viewport),document:a(document),body:a(document.body),window:a(b)},h={show:a.trim(""+t.show.event).split(" "),hide:a.trim(""+t.hide.event).split(" ")},j=a.browser.msie&&parseInt(a.browser.version,10)===6;E.bind("mouseenter"+F+" mouseleave"+F,function(a){var b=a.type==="mouseenter";b&&z.focus(a),E.toggleClass(q,b)}),t.hide.fixed&&(f.hide=f.hide.add(E),E.bind("mouseover"+F,function(){E.hasClass(m)||clearTimeout(z.timers.hide)})),/mouse(out|leave)/i.test(t.hide.event)?t.hide.leave==="window"&&f.window.bind("mouseout"+F+" blur"+F,function(a){/select|option/.test(a.target)&&!a.relatedTarget&&z.hide(a)}):/mouse(over|enter)/i.test(t.show.event)&&f.hide.bind("mouseleave"+F,function(a){clearTimeout(z.timers.show)}),(""+t.hide.event).indexOf("unfocus")>-1&&f.body.bind("mousedown"+F,function(b){var c=a(b.target),d=!E.hasClass(m)&&E.is(":visible");c[0]!==E[0]&&c.parents(n).length===0&&c.add(s).length>1&&!c.attr("disabled")&&z.hide(b)}),"number"===typeof t.hide.inactive&&(f.show.bind("qtip-"+w+"-inactive",o),a.each(g.inactiveEvents,function(a,b){f.hide.add(G.tooltip).bind(b+F+"-inactive",o)})),a.each(h.hide,function(b,c){var d=a.inArray(c,h.show),e=a(f.hide);d>-1&&e.add(f.show).length===e.length||c==="unfocus"?(f.show.bind(c+F,function(a){E.is(":visible")?l(a):k(a)}),delete h.show[d]):f.hide.bind(c+F,l)}),a.each(h.show,function(a,b){f.show.bind(b+F,k)}),"number"===typeof t.hide.distance&&f.show.add(E).bind("mousemove"+F,function(a){var b=H.origin||{},c=t.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&z.hide(a)}),c.target==="mouse"&&(f.show.bind("mousemove"+F,function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),c.adjust.mouse&&(t.hide.event&&E.bind("mouseleave"+F,function(a){(a.relatedTarget||a.target)!==f.show[0]&&z.hide(a)}),f.document.bind("mousemove"+F,function(a){!E.hasClass(m)&&E.is(":visible")&&z.reposition(a||i)}))),(c.adjust.resize||f.viewport.length)&&(a.event.special.resize?f.viewport:f.window).bind("resize"+F,p),(f.viewport.length||j&&E.css("position")==="fixed")&&f.viewport.bind("scroll"+F,p)}function P(b,d){function g(b){function i(c){c&&(delete h[c.src],clearTimeout(z.timers.img[c.src]),a(c).unbind(F)),a.isEmptyObject(h)&&(z.redraw(),d!==e&&z.reposition(H.event),b())}var g,h={};if((g=f.find("img:not([height]):not([width])")).length===0)return i();g.each(function(b,d){if(h[d.src]===c){var e=0,f=3;(function g(){if(d.height||d.width||e>f)return i(d);e+=1,z.timers.img[d.src]=setTimeout(g,700)})(),a(d).bind("error"+F+" load"+F,function(){i(this)}),h[d.src]=d}})}var f=G.content;if(!z.rendered||!b)return e;a.isFunction(b)&&(b=b.call(s,H.event,z)||""),b.jquery&&b.length>0?f.empty().append(b.css({display:"block"})):f.html(b),z.rendered<0?E.queue("fx",g):(D=0,g(a.noop));return z}function O(b,c){var d=G.title;if(!z.rendered||!b)return e;a.isFunction(b)&&(b=b.call(s,H.event,z));if(b===e)return K(e);b.jquery&&b.length>0?d.empty().append(b.css({display:"block"})):d.html(b),z.redraw(),c!==e&&z.rendered&&E.is(":visible")&&z.reposition(H.event)}function N(a){var b=G.button,c=G.title;if(!z.rendered)return e;a?(c||M(),L()):b.remove()}function M(){var b=B+"-title";G.titlebar&&K(),G.titlebar=a("<div />",{"class":k+"-titlebar "+(t.style.widget?"ui-widget-header":"")}).append(G.title=a("<div />",{id:b,"class":k+"-title","aria-atomic":d})).insertBefore(G.content).delegate(".ui-tooltip-close","mousedown keydown mouseup keyup mouseout",function(b){a(this).toggleClass("ui-state-active ui-state-focus",b.type.substr(-4)==="down")}).delegate(".ui-tooltip-close","mouseover mouseout",function(b){a(this).toggleClass("ui-state-hover",b.type==="mouseover")}),t.content.title.button?L():z.rendered&&z.redraw()}function L(){var b=t.content.title.button,c=typeof b==="string",d=c?b:"Close tooltip";G.button&&G.button.remove(),b.jquery?G.button=b:G.button=a("<a />",{"class":"ui-state-default ui-tooltip-close "+(t.style.widget?"":k+"-icon"),title:d,"aria-label":d}).prepend(a("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),G.button.appendTo(G.titlebar).attr("role","button").click(function(a){E.hasClass(m)||z.hide(a);return e}),z.redraw()}function K(a){G.title&&(G.titlebar.remove(),G.titlebar=G.title=G.button=f,a!==e&&z.reposition())}function J(){var a=t.style.widget;E.toggleClass(l,a).toggleClass(o,t.style["default"]&&!a),G.content.toggleClass(l+"-content",a),G.titlebar&&G.titlebar.toggleClass(l+"-header",a),G.button&&G.button.toggleClass(k+"-icon",!a)}function I(a){var b=0,c,d=t,e=a.split(".");while(d=d[e[b++]])b<e.length&&(c=d);return[c||t,e.pop()]}var z=this,A=document.body,B=k+"-"+w,C=0,D=0,E=a(),F=".qtip-"+w,G,H;z.id=w,z.rendered=e,z.elements=G={target:s},z.timers={img:{}},z.options=t,z.checks={},z.plugins={},z.cache=H={event:{},target:a(),disabled:e,attr:y},z.checks.builtin={"^id$":function(b,c,f){var h=f===d?g.nextid:f,i=k+"-"+h;h!==e&&h.length>0&&!a("#"+i).length&&(E[0].id=i,G.content[0].id=i+"-content",G.title[0].id=i+"-title")},"^content.text$":function(a,b,c){P(c)},"^content.title.text$":function(a,b,c){if(!c)return K();!G.title&&c&&M(),O(c)},"^content.title.button$":function(a,b,c){N(c)},"^position.(my|at)$":function(a,b,c){"string"===typeof c&&(a[b]=new h.Corner(c))},"^position.container$":function(a,b,c){z.rendered&&E.appendTo(c)},"^show.ready$":function(){z.rendered?z.toggle(d):z.render(1)},"^style.classes$":function(a,b,c){E.attr("class",k+" qtip ui-helper-reset "+c)},"^style.widget|content.title":J,"^events.(render|show|move|hide|focus|blur)$":function(b,c,d){E[(a.isFunction(d)?"":"un")+"bind"]("tooltip"+c,d)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var a=t.position;E.attr("tracking",a.target==="mouse"&&a.adjust.mouse),R(),Q()}},a.extend(z,{render:function(b){if(z.rendered)return z;var c=t.content.text,f=t.content.title.text,g=t.position,i=a.Event("tooltiprender");a.attr(s[0],"aria-describedby",B),E=G.tooltip=a("<div/>",{id:B,"class":k+" qtip ui-helper-reset "+o+" "+t.style.classes+" "+k+"-pos-"+t.position.my.abbrev(),width:t.style.width||"",height:t.style.height||"",tracking:g.target==="mouse"&&g.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":e,"aria-describedby":B+"-content","aria-hidden":d}).toggleClass(m,H.disabled).data("qtip",z).appendTo(t.position.container).append(G.content=a("<div />",{"class":k+"-content",id:B+"-content","aria-atomic":d})),z.rendered=-1,C=D=1,f&&(M(),a.isFunction(f)||O(f,e)),a.isFunction(c)||P(c,e),z.rendered=d,J(),a.each(t.events,function(b,c){a.isFunction(c)&&E.bind(b==="toggle"?"tooltipshow tooltiphide":"tooltip"+b,c)}),a.each(h,function(){this.initialize==="render"&&this(z)}),Q(),E.queue("fx",function(a){i.originalEvent=H.event,E.trigger(i,[z]),C=D=0,z.redraw(),(t.show.ready||b)&&z.toggle(d,H.event,e),a()});return z},get:function(a){var b,c;switch(a.toLowerCase()){case"dimensions":b={height:E.outerHeight(),width:E.outerWidth()};break;case"offset":b=h.offset(E,t.position.container);break;default:c=I(a.toLowerCase()),b=c[0][c[1]],b=b.precedance?b.string():b}return b},set:function(b,c){function m(a,b){var c,d,e;for(c in k)for(d in k[c])if(e=(new RegExp(d,"i")).exec(a))b.push(e),k[c][d].apply(z,b)}var g=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,h=/^content\.(title|attr)|style/i,i=e,j=e,k=z.checks,l;"string"===typeof b?(l=b,b={},b[l]=c):b=a.extend(d,{},b),a.each(b,function(c,d){var e=I(c.toLowerCase()),f;f=e[0][e[1]],e[0][e[1]]="object"===typeof d&&d.nodeType?a(d):d,b[c]=[e[0],e[1],d,f],i=g.test(c)||i,j=h.test(c)||j}),x(t),C=D=1,a.each(b,m),C=D=0,E.is(":visible")&&z.rendered&&(i&&z.reposition(t.position.target==="mouse"?f:H.event),j&&z.redraw());return z},toggle:function(b,c){function q(){b?(a.browser.msie&&E[0].style.removeAttribute("filter"),E.css("overflow",""),"string"===typeof h.autofocus&&a(h.autofocus,E).focus(),p=a.Event("tooltipvisible"),p.originalEvent=c?H.event:f,E.trigger(p,[z]),h.target.trigger("qtip-"+w+"-inactive")):E.css({display:"",visibility:"",opacity:"",left:"",top:""})}if(!z.rendered)return b?z.render(1):z;var g=b?"show":"hide",h=t[g],j=E.is(":visible"),k=!c||t[g].target.length<2||H.target[0]===c.target,l=t.position,m=t.content,o,p;(typeof b).search("boolean|number")&&(b=!j);if(!E.is(":animated")&&j===b&&k)return z;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(H.event.type)&&c.target===t.show.target[0]&&E.has(c.relatedTarget).length)return z;H.event=a.extend({},c)}p=a.Event("tooltip"+g),p.originalEvent=c?H.event:f,E.trigger(p,[z,90]);if(p.isDefaultPrevented())return z;a.attr(E[0],"aria-hidden",!b),b?(H.origin=a.extend({},i),z.focus(c),a.isFunction(m.text)&&P(m.text,e),a.isFunction(m.title.text)&&O(m.title.text,e),!v&&l.target==="mouse"&&l.adjust.mouse&&(a(document).bind("mousemove.qtip",function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),v=d),z.reposition(c,arguments[2]),(p.solo=!!h.solo)&&a(n,h.solo).not(E).qtip("hide",p)):(clearTimeout(z.timers.show),delete H.origin,v&&!a(n+'[tracking="true"]:visible',h.solo).not(E).length&&(a(document).unbind("mousemove.qtip"),v=e),z.blur(c)),k&&E.stop(0,1),h.effect===e?(E[g](),q.call(E)):a.isFunction(h.effect)?(h.effect.call(E,z),E.queue("fx",function(a){q(),a()})):E.fadeTo(90,b?1:0,q),b&&h.target.trigger("qtip-"+w+"-inactive");return z},show:function(a){return z.toggle(d,a)},hide:function(a){return z.toggle(e,a)},focus:function(b){if(!z.rendered)return z;var c=a(n),d=parseInt(E[0].style.zIndex,10),e=g.zindex+c.length,f=a.extend({},b),h,i;E.hasClass(p)||(i=a.Event("tooltipfocus"),i.originalEvent=f,E.trigger(i,[z,e]),i.isDefaultPrevented()||(d!==e&&(c.each(function(){this.style.zIndex>d&&(this.style.zIndex=this.style.zIndex-1)}),c.filter("."+p).qtip("blur",f)),E.addClass(p)[0].style.zIndex=e));return z},blur:function(b){var c=a.extend({},b),d;E.removeClass(p),d=a.Event("tooltipblur"),d.originalEvent=c,E.trigger(d,[z]);return z},reposition:function(c,d){if(!z.rendered||C)return z;C=1;var f=t.position.target,g=t.position,j=g.my,l=g.at,m=g.adjust,n=m.method.split(" "),o=E.outerWidth(),p=E.outerHeight(),q=0,r=0,s=a.Event("tooltipmove"),u=E.css("position")==="fixed",v=g.viewport,w={left:0,top:0},x=g.container,y=e,B=z.plugins.tip,D={horizontal:n[0],vertical:n[1]=n[1]||n[0],enabled:v.jquery&&f[0]!==b&&f[0]!==A&&m.method!=="none",left:function(a){var b=D.horizontal==="shift",c=-x.offset.left+v.offset.left+v.scrollLeft,d=j.x==="left"?o:j.x==="right"?-o:-o/2,e=l.x==="left"?q:l.x==="right"?-q:-q/2,f=B&&B.size?B.size.width||0:0,g=B&&B.corner&&B.corner.precedance==="x"&&!b?f:0,h=c-a+g,i=a+o-v.width-c+g,k=d-(j.precedance==="x"||j.x===j.y?e:0),n=j.x==="center";b?(g=B&&B.corner&&B.corner.precedance==="y"?f:0,k=(j.x==="left"?1:-1)*d-g,w.left+=h>0?h:i>0?-i:0,w.left=Math.max(-x.offset.left+v.offset.left+(g&&B.corner.x==="center"?B.offset:0),a-k,Math.min(Math.max(-x.offset.left+v.offset.left+v.width,a+k),w.left))):(h>0&&(j.x!=="left"||i>0)?w.left-=k:i>0&&(j.x!=="right"||h>0)&&(w.left-=n?-k:k),w.left!==a&&n&&(w.left-=m.x),w.left<c&&-w.left>i&&(w.left=a));return w.left-a},top:function(a){var b=D.vertical==="shift",c=-x.offset.top+v.offset.top+v.scrollTop,d=j.y==="top"?p:j.y==="bottom"?-p:-p/2,e=l.y==="top"?r:l.y==="bottom"?-r:-r/2,f=B&&B.size?B.size.height||0:0,g=B&&B.corner&&B.corner.precedance==="y"&&!b?f:0,h=c-a+g,i=a+p-v.height-c+g,k=d-(j.precedance==="y"||j.x===j.y?e:0),n=j.y==="center";b?(g=B&&B.corner&&B.corner.precedance==="x"?f:0,k=(j.y==="top"?1:-1)*d-g,w.top+=h>0?h:i>0?-i:0,w.top=Math.max(-x.offset.top+v.offset.top+(g&&B.corner.x==="center"?B.offset:0),a-k,Math.min(Math.max(-x.offset.top+v.offset.top+v.height,a+k),w.top))):(h>0&&(j.y!=="top"||i>0)?w.top-=k:i>0&&(j.y!=="bottom"||h>0)&&(w.top-=n?-k:k),w.top!==a&&n&&(w.top-=m.y),w.top<0&&-w.top>i&&(w.top=a));return w.top-a}},F;if(a.isArray(f)&&f.length===2)l={x:"left",y:"top"},w={left:f[0],top:f[1]};else if(f==="mouse"&&(c&&c.pageX||H.event.pageX))l={x:"left",y:"top"},c=(c&&(c.type==="resize"||c.type==="scroll")?H.event:c&&c.pageX&&c.type==="mousemove"?c:i&&i.pageX&&(m.mouse||!c||!c.pageX)?{pageX:i.pageX,pageY:i.pageY}:!m.mouse&&H.origin&&H.origin.pageX?H.origin:c)||c||H.event||i||{},w={top:c.pageY,left:c.pageX};else{f==="event"?c&&c.target&&c.type!=="scroll"&&c.type!=="resize"?f=H.target=a(c.target):f=H.target:H.target=a(f),f=a(f).eq(0);if(f.length===0)return z;f[0]===document||f[0]===b?(q=h.iOS?b.innerWidth:f.width(),r=h.iOS?b.innerHeight:f.height(),f[0]===b&&(w={top:u||h.iOS?(v||f).scrollTop():0,left:u||h.iOS?(v||f).scrollLeft():0})):f.is("area")&&h.imagemap?w=h.imagemap(f,l,D.enabled?n:e):f[0].namespaceURI==="http://www.w3.org/2000/svg"&&h.svg?w=h.svg(f,l):(q=f.outerWidth(),r=f.outerHeight(),w=h.offset(f,x)),w.offset&&(q=w.width,r=w.height,y=w.flipoffset,w=w.offset);if(h.iOS<4.1&&h.iOS>3.1||h.iOS==4.3||!h.iOS&&u)F=a(b),w.left-=F.scrollLeft(),w.top-=F.scrollTop();w.left+=l.x==="right"?q:l.x==="center"?q/2:0,w.top+=l.y==="bottom"?r:l.y==="center"?r/2:0}w.left+=m.x+(j.x==="right"?-o:j.x==="center"?-o/2:0),w.top+=m.y+(j.y==="bottom"?-p:j.y==="center"?-p/2:0),D.enabled?(v={elem:v,height:v[(v[0]===b?"h":"outerH")+"eight"](),width:v[(v[0]===b?"w":"outerW")+"idth"](),scrollLeft:u?0:v.scrollLeft(),scrollTop:u?0:v.scrollTop(),offset:v.offset()||{left:0,top:0}},x={elem:x,scrollLeft:x.scrollLeft(),scrollTop:x.scrollTop(),offset:x.offset()||{left:0,top:0}},w.adjusted={left:D.horizontal!=="none"?D.left(w.left):0,top:D.vertical!=="none"?D.top(w.top):0},w.adjusted.left+w.adjusted.top&&E.attr("class",E[0].className.replace(/ui-tooltip-pos-\w+/i,k+"-pos-"+j.abbrev())),y&&w.adjusted.left&&(w.left+=y.left),y&&w.adjusted.top&&(w.top+=y.top)):w.adjusted={left:0,top:0},s.originalEvent=a.extend({},c),E.trigger(s,[z,w,v.elem||v]);if(s.isDefaultPrevented())return z;delete w.adjusted,d===e||isNaN(w.left)||isNaN(w.top)||f==="mouse"||!a.isFunction(g.effect)?E.css(w):a.isFunction(g.effect)&&(g.effect.call(E,z,a.extend({},w)),E.queue(function(b){a(this).css({opacity:"",height:""}),a.browser.msie&&this.style.removeAttribute("filter"),b()})),C=0;return z},redraw:function(){if(z.rendered<1||D)return z;var a=t.position.container,b,c,d,e;D=1,t.style.height&&E.css("height",t.style.height),t.style.width?E.css("width",t.style.width):(E.css("width","").addClass(r),c=E.width()+1,d=E.css("max-width")||"",e=E.css("min-width")||"",b=(d+e).indexOf("%")>-1?a.width()/100:0,d=(d.indexOf("%")>-1?b:1)*parseInt(d,10)||c,e=(e.indexOf("%")>-1?b:1)*parseInt(e,10)||0,c=d+e?Math.min(Math.max(c,e),d):c,E.css("width",Math.round(c)).removeClass(r)),D=0;return z},disable:function(b){"boolean"!==typeof b&&(b=!E.hasClass(m)&&!H.disabled),z.rendered?(E.toggleClass(m,b),a.attr(E[0],"aria-disabled",b)):H.disabled=!!b;return z},enable:function(){return z.disable(e)},destroy:function(){var b=s[0],c=a.attr(b,u),d=s.data("qtip");z.rendered&&(E.remove(),a.each(z.plugins,function(){this.destroy&&this.destroy()})),clearTimeout(z.timers.show),clearTimeout(z.timers.hide),R();if(!d||z===d)a.removeData(b,"qtip"),t.suppress&&c&&(a.attr(b,"title",c),s.removeAttr(u)),s.removeAttr("aria-describedby");s.unbind(".qtip-"+w),delete j[z.id];return s}})}function x(b){var c;if(!b||"object"!==typeof b)return e;if(b.metadata===f||"object"!==typeof b.metadata)b.metadata={type:b.metadata};if("content"in b){if(b.content===f||"object"!==typeof b.content||b.content.jquery)b.content={text:b.content};c=b.content.text||e,!a.isFunction(c)&&(!c&&!c.attr||c.length<1||"object"===typeof c&&!c.jquery)&&(b.content.text=e);if("title"in b.content){if(b.content.title===f||"object"!==typeof b.content.title)b.content.title={text:b.content.title};c=b.content.title.text||e,!a.isFunction(c)&&(!c&&!c.attr||c.length<1||"object"===typeof c&&!c.jquery)&&(b.content.title.text=e)}}if("position"in b)if(b.position===f||"object"!==typeof b.position)b.position={my:b.position,at:b.position};if("show"in b)if(b.show===f||"object"!==typeof b.show)b.show.jquery?b.show={target:b.show}:b.show={event:b.show};if("hide"in b)if(b.hide===f||"object"!==typeof b.hide)b.hide.jquery?b.hide={target:b.hide}:b.hide={event:b.hide};if("style"in b)if(b.style===f||"object"!==typeof b.style)b.style={classes:b.style};a.each(h,function(){this.sanitize&&this.sanitize(b)});return b}function w(){w.history=w.history||[],w.history.push(arguments);if("object"===typeof console){var a=console[console.warn?"warn":"log"],b=Array.prototype.slice.call(arguments),c;typeof arguments[0]==="string"&&(b[0]="qTip2: "+b[0]),c=a.apply?a.apply(console,b):a(b)}}"use strict";var d=!0,e=!1,f=null,g,h,i,j={},k="ui-tooltip",l="ui-widget",m="ui-state-disabled",n="div.qtip."+k,o=k+"-default",p=k+"-focus",q=k+"-hover",r=k+"-fluid",s="-31000px",t="_replacedByqTip",u="oldtitle",v;g=a.fn.qtip=function(b,h,i){var j=(""+b).toLowerCase(),k=f,l=a.makeArray(arguments).slice(1),m=l[l.length-1],n=this[0]?a.data(this[0],"qtip"):f;if(!arguments.length&&n||j==="api")return n;if("string"===typeof b){this.each(function(){var b=a.data(this,"qtip");if(!b)return d;m&&m.timeStamp&&(b.cache.event=m);if(j!=="option"&&j!=="options"||!h)b[j]&&b[j].apply(b[j],l);else if(a.isPlainObject(h)||i!==c)b.set(h,i);else{k=b.get(h);return e}});return k!==f?k:this}if("object"===typeof b||!arguments.length){n=x(a.extend(d,{},b));return g.bind.call(this,n,m)}},g.bind=function(b,f){return this.each(function(k){function r(b){function d(){p.render(typeof b==="object"||l.show.ready),m.show.add(m.hide).unbind(o)}if(p.cache.disabled)return e;p.cache.event=a.extend({},b),p.cache.target=b?a(b.target):[c],l.show.delay>0?(clearTimeout(p.timers.show),p.timers.show=setTimeout(d,l.show.delay),n.show!==n.hide&&m.hide.bind(n.hide,function(){clearTimeout(p.timers.show)})):d()}var l,m,n,o,p,q;q=a.isArray(b.id)?b.id[k]:b.id,q=!q||q===e||q.length<1||j[q]?g.nextid++:j[q]=q,o=".qtip-"+q+"-create",p=z.call(this,q,b);if(p===e)return d;l=p.options,a.each(h,function(){this.initialize==="initialize"&&this(p)}),m={show:l.show.target,hide:l.hide.target},n={show:a.trim(""+l.show.event).replace(/ /g,o+" ")+o,hide:a.trim(""+l.hide.event).replace(/ /g,o+" ")+o},/mouse(over|enter)/i.test(n.show)&&!/mouse(out|leave)/i.test(n.hide)&&(n.hide+=" mouseleave"+o),m.show.bind("mousemove"+o,function(a){i={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),m.show.bind(n.show,r),(l.show.ready||l.prerender)&&r(f)})},h=g.plugins={Corner:function(a){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();var b=a.charAt(0);this.precedance=b==="t"||b==="b"?"y":"x",this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y},this.abbrev=function(){var a=this.x.substr(0,1),b=this.y.substr(0,1);return a===b?a:a==="c"||a!=="c"&&b!=="c"?b+a:a+b},this.clone=function(){return{x:this.x,y:this.y,precedance:this.precedance,string:this.string,abbrev:this.abbrev,clone:this.clone}}},offset:function(a,b){function i(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}var c=a.offset(),d=b,e=0,f=document.body,g,h;if(d){do{d.css("position")!=="static"&&(g=d[0]===f?{left:parseInt(d.css("left"),10)||0,top:parseInt(d.css("top"),10)||0}:d.position(),c.left-=g.left+(parseInt(d.css("borderLeftWidth"),10)||0)+(parseInt(d.css("marginLeft"),10)||0),c.top-=g.top+(parseInt(d.css("borderTopWidth"),10)||0),h=d.css("overflow"),(h==="scroll"||h==="auto")&&++e);if(d[0]===f)break}while(d=d.offsetParent());b[0]!==f&&e&&i(b,1)}return c},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_","."))||e,fn:{attr:function(b,c){if(this.length){var d=this[0],e="title",f=a.data(d,"qtip");if(b===e&&f&&"object"===typeof f&&f.options.suppress){if(arguments.length<2)return a.attr(d,u);f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",c);return this.attr(u,c)}}return a.fn["attr"+t].apply(this,arguments)},clone:function(b){var c=a([]),d="title",e=a.fn["clone"+t].apply(this,arguments);b||e.filter("["+u+"]").attr("title",function(){return a.attr(this,u)}).removeAttr(u);return e},remove:a.ui?f:function(b,c){a.ui||a(this).each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})}}},a.each(h.fn,function(b,c){if(!c||a.fn[b+t])return d;var e=a.fn[b+t]=a.fn[b];a.fn[b]=function(){return c.apply(this,arguments)||e.apply(this,arguments)}}),g.version="nightly",g.nextid=0,g.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),g.zindex=15e3,g.defaults={prerender:e,id:e,overwrite:d,suppress:d,content:{text:d,attr:"title",title:{text:e,button:e}},position:{my:"top left",at:"bottom right",target:e,container:e,viewport:e,adjust:{x:0,y:0,mouse:d,resize:d,method:"flip flip"},effect:function(b,c,d){a(this).animate(c,{duration:200,queue:e})}},show:{target:e,event:"mouseenter",effect:d,delay:90,solo:e,ready:e,autofocus:e},hide:{target:e,event:"mouseleave",effect:d,delay:0,fixed:e,inactive:e,leave:"window",distance:e},style:{classes:"",widget:e,width:e,height:e,"default":d},events:{render:f,move:f,show:f,hide:f,toggle:f,visible:f,focus:f,blur:f}},h.ajax=function(a){var b=a.plugins.ajax;return"object"===typeof b?b:a.plugins.ajax=new A(a)},h.ajax.initialize="render",h.ajax.sanitize=function(a){var b=a.content,c;b&&"ajax"in b&&(c=b.ajax,typeof c!=="object"&&(c=a.content.ajax={url:c}),"boolean"!==typeof c.once&&c.once&&(c.once=!!c.once))},a.extend(d,g.defaults,{content:{ajax:{loading:d,once:d}}}),h.imagemap=function(b,c,d){function n(a,b,c){var d=0,e=1,f=1,g=0,h=0,i=a.width,j=a.height;while(i>0&&j>0&&e>0&&f>0){i=Math.floor(i/2),j=Math.floor(j/2),c.x==="left"?e=i:c.x==="right"?e=a.width-i:e+=Math.floor(i/2),c.y==="top"?f=j:c.y==="bottom"?f=a.height-j:f+=Math.floor(j/2),d=b.length;while(d--){if(b.length<2)break;g=b[d][0]-a.offset.left,h=b[d][1]-a.offset.top,(c.x==="left"&&g>=e||c.x==="right"&&g<=e||c.x==="center"&&(g<e||g>a.width-e)||c.y==="top"&&h>=f||c.y==="bottom"&&h<=f||c.y==="center"&&(h<f||h>a.height-f))&&b.splice(d,1)}}return{left:b[0][0],top:b[0][1]}}b.jquery||(b=a(b));var e=(b[0].shape||b.attr("shape")).toLowerCase(),f=(b[0].coords||b.attr("coords")).split(","),g=[],h=a('img[usemap="#'+b.parent("map").attr("name")+'"]'),i=h.offset(),j={width:0,height:0,offset:{top:1e10,right:0,bottom:0,left:1e10}},k=0,l=0,m;i.left+=Math.ceil((h.outerWidth()-h.width())/2),i.top+=Math.ceil((h.outerHeight()-h.height())/2);if(e==="poly"){k=f.length;while(k--)l=[parseInt(f[--k],10),parseInt(f[k+1],10)],l[0]>j.offset.right&&(j.offset.right=l[0]),l[0]<j.offset.left&&(j.offset.left=l[0]),l[1]>j.offset.bottom&&(j.offset.bottom=l[1]),l[1]<j.offset.top&&(j.offset.top=l[1]),g.push(l)}else g=a.map(f,function(a){return parseInt(a,10)});switch(e){case"rect":j={width:Math.abs(g[2]-g[0]),height:Math.abs(g[3]-g[1]),offset:{left:Math.min(g[0],g[2]),top:Math.min(g[1],g[3])}};break;case"circle":j={width:g[2]+2,height:g[2]+2,offset:{left:g[0],top:g[1]}};break;case"poly":a.extend(j,{width:Math.abs(j.offset.right-j.offset.left),height:Math.abs(j.offset.bottom-j.offset.top)}),c.string()==="centercenter"?j.offset={left:j.offset.left+j.width/2,top:j.offset.top+j.height/2}:(j.offset=n(j,g.slice(),c),d&&(d[0]==="flip"||d[1]==="flip")&&(j.flipoffset=n(j,g.slice(),{x:c.x==="left"?"right":c.x==="right"?"left":"center",y:c.y==="top"?"bottom":c.y==="bottom"?"top":"center"}),j.flipoffset.left-=j.offset.left,j.flipoffset.top-=j.offset.top)),j.width=j.height=0}j.offset.left+=i.left,j.offset.top+=i.top;return j},h.tip=function(a){var b=a.plugins.tip;return"object"===typeof b?b:a.plugins.tip=new C(a)},h.tip.initialize="render",h.tip.sanitize=function(a){var b=a.style,c;b&&"tip"in b&&(c=a.style.tip,typeof c!=="object"&&(a.style.tip={corner:c}),/string|boolean/i.test(typeof c.corner)||(c.corner=d),typeof c.width!=="number"&&delete c.width,typeof c.height!=="number"&&delete c.height,typeof c.border!=="number"&&c.border!==d&&delete c.border,typeof c.offset!=="number"&&delete c.offset)},a.extend(d,g.defaults,{style:{tip:{corner:d,mimic:e,width:6,height:6,border:d,offset:0}}}),h.svg=function(b,c){var d=a(document),e=b[0],f={width:0,height:0,offset:{top:1e10,left:1e10}},g,h,i,j,k;if(e.getBBox&&e.parentNode){g=e.getBBox(),h=e.getScreenCTM(),i=e.farthestViewportElement||e;if(!i.createSVGPoint)return f;j=i.createSVGPoint(),j.x=g.x,j.y=g.y,k=j.matrixTransform(h),f.offset.left=k.x,f.offset.top=k.y,j.x+=g.width,j.y+=g.height,k=j.matrixTransform(h),f.width=k.x-f.offset.left,f.height=k.y-f.offset.top,f.offset.left+=d.scrollLeft(),f.offset.top+=d.scrollTop()}return f},h.modal=function(a){var b=a.plugins.modal;return"object"===typeof b?b:a.plugins.modal=new D(a)},h.modal.initialize="render",h.modal.sanitize=function(a){a.show&&(typeof a.show.modal!=="object"?a.show.modal={on:!!a.show.modal}:typeof a.show.modal.on==="undefined"&&(a.show.modal.on=d))},h.modal.zindex=g.zindex+1e3,a.extend(d,g.defaults,{show:{modal:{on:e,effect:d,blur:d,escape:d}}}),h.bgiframe=function(b){var c=a.browser,d=b.plugins.bgiframe;if(a("select, object").length<1||(!c.msie||(""+c.version).charAt(0)!=="6"))return e;return"object"===typeof d?d:b.plugins.bgiframe=new E(b)},h.bgiframe.initialize="render"})(jQuery,window);

// ***************************
// js.compressed/qtip.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["no_preview_text_available","loading"]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["threadpreview"]);(function(){$(".js-tooltip[title]").qtip({style:{classes:"ui-tooltip-shadow"}});if(vBulletin.options.get("threadpreview")>0&&(($(".channel-content-widget").length>0&&$(".channel-content-widget").eq(0).attr("data-canviewtopiccontent"))||$(".search-results-widget").length>0)){var A=function(){var B=$(this);if(B.data("vb-qtip-preview-initialized")=="1"){return }B.data("vb-qtip-preview-initialized","1");var C=B.closest(".topic-item").attr("data-node-id")||B.closest(".js-post").attr("data-node-id");B.qtip({content:{text:function(E,D){console.log("Qtip fetching topic preview.");$.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/fetch-node-preview?nodeid="+C,dataType:"json"}).done(function(F){if(typeof (F)!="string"&&typeof (F[0])=="string"){F=F[0]}if($.trim(F)!=""){var G='<div class="b-topicpreview__previewtext">'+F+"</div>";D.set("content.text",G)}else{var G='<div class="b-topicpreview__previewtext">'+vBulletin.phrase.get("no_preview_text_available")+"</div>";D.set("content.text",G)}}).fail(function(H,F,G){D.set("content.text",F+": "+G)});return vBulletin.phrase.get("loading")}},show:{delay:500},position:{my:"top left",at:"bottom right",viewport:$(window)},style:{classes:"ui-tooltip-shadow ui-tooltip-rounded b-topicpreview"}});console.log("Qtip topic preview initialized.");B.trigger("mouseover")};$(document).off("mouseover",".topic-list-container .topic-title, .conversation-list .post-title, .conversation-list .b-post__title").on("mouseover",".topic-list-container .topic-title, .conversation-list .post-title, .conversation-list .b-post__title",A)}})();;

// ***************************
// js.compressed/tag-editor.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["error","error_adding_search_tips_code_x","error_adding_tags_code_x","invalid_server_response_please_try_again","invalid_x_tag_length","popular_tags_cloud","you_may_add_one_more_tag","you_may_add_x_more_tags","you_may_not_add_any_more_tags","error_fetching_popular_tags","add_tags","tag_cloud","loading"]);window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["tagmaxlen","tagminlen","tagforcelower"]);(function(A){vBulletin.tagEditor=vBulletin.tagEditor||{};vBulletin.tagEditor.instance=function(L,S,d){var U=this,P,W=false,a=false,Z=window.vBulletin.options.get("tagmaxlen")||25,G=window.vBulletin.options.get("tagminlen")||3,C=0,K=0,N=false,g=A(L),H=g.closest(".tag-editor-container"),F=g.closest(".tag-editor-wrapper"),M=H.data("node-id")||0,c=false,J=g.attr("placeholder")?g.attr("placeholder"):"",I=J?J.length:10,f=function(){if(g.length==0){return false}g.attr("maxlength",Z);c=new vBulletin_Autocomplete(g,{apiClass:"Tags",containerClass:(d||"")+" entry-field h-clearfix",placeholderText:J,editorContext:{type:"tags",context:U},minLength:G,beforeAdd:function(i,j){W=a?true:false;if(h()==0){return false}return true},afterAdd:function(i,j){var k=b();if(k==0){g.hide()}g.attr("placeholder","");e(H.find(".tagcloudlink"),H)},afterDelete:function(j,k){W=a?true:false;var l=b();if(S||l>0){g.show();setTimeout(function(){g[0].focus()},10)}g.attr("placeholder",function(){var m=B();return(!m||m.length==0)?J:""});if(g.attr("placeholder")){g.placeholder()}var i=H.find(".tag-cloud .tagcloudlink");if(i.length==0){i=A(".ui-tooltip-popular-tags{0} .tag-cloud .tagcloudlink".format(F.data("tag-editor-class")?"."+F.data("tag-editor-class"):""))}i.each(function(){if(A(this).data("tag")==j){A(this).removeClass("added")}})}});g=c.getInputField();if(g.attr("placeholder")){g.placeholder()}},V=function(i){if(window.vBulletin.options.get("tagforcelower")==1){i=i.toLowerCase()}if(i.length>Z){i=i.substr(0,Z)}return i},X=function(l,j){if(!c){return false}if(typeof j=="undefined"||j<1){j=pageData.userid}var i=c.getMinLength();if(l.length<i){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_x_tag_length",i),iconType:"warning"});return false}l=V(l);var k=c.addElement(l,j);g.val("");b();return k},O=function(l){var j=l.length,k;for(k=0;k<j;++k){X(l[k])}},Y=function(i){if(!c){return false}c.clearElements();O(i)},R=function(){g.attr("size",I);var i=JShtmlEncode(A.trim(g.val()));if(i==""||(i==J&&J)){return false}var j="Adding tag: "+i;if(h()>0){setTimeout(function(){X(i)},10);j+=" (Tag added)"}console.log(j)},h=function(){if(S||(C==0&&K==0)){console.log("Tag limits not enforced.");return true}var m=c.countElements(),i=A(c.getElements()).filter(function(n,o){return(pageData.userid==0||o.value==pageData.userid)}).size(),l=C>0?C-m:K-m,k=K==0?l:K-i,j=Math.min(k,l);console.log(["tagCount: "+m,"userTagCount: "+i,"maxTags: "+C,"maxUserTags: "+K,"totalCanAdd: "+l,"userCanAdd: "+k,"canAdd: "+j]);return j},b=function(){var i=H.find(".you-may-add-x-tags");var j=h();if(j===true){return true}else{if(j>1){i.removeClass("warning").html(vBulletin.phrase.get("you_may_add_x_more_tags",j))}else{if(j==1){i.removeClass("warning").html(vBulletin.phrase.get("you_may_add_one_more_tag"))}else{i.addClass("warning").html(vBulletin.phrase.get("you_may_not_add_any_more_tags"));return 0}}}return j},T=function(){c.clearElements()},B=function(){if(!c){return false}return c.getLabels()},E=function(i){if(S){g[0].focus();return }else{if(!vBulletin.tagEditor.tagLimits||!vBulletin.tagEditor.tagLimits[i]){vBulletin.tagEditor.tagLimits={};vBulletin.tagEditor.tagLimits[i]={}}else{if(vBulletin.tagEditor.tagLimits&&vBulletin.tagEditor.tagLimits[i]){C=vBulletin.tagEditor.tagLimits[i].maxTags;K=vBulletin.tagEditor.tagLimits[i].maxUserTags;N=vBulletin.tagEditor.tagLimits[i].canManageTags;Q();return }}}A.ajax({url:vBulletin.getAjaxBaseurl()+"/ajax/api/tags/getNodeTags",data:({nodeid:i}),type:"POST",dataType:"json",complete:function(){console.log("/ajax/api/tags/getNodeTags complete")},success:function(j){console.log("/ajax/api/tags/getNodeTags successful");if(j&&A.isArray(j.tags)){C=parseInt(j.maxtags,10);K=parseInt(j.maxusertags,10);N=j.canmanagetags;vBulletin.tagEditor.tagLimits={};vBulletin.tagEditor.tagLimits[i]={maxTags:C,maxUserTags:K,canManageTags:N};Q()}else{console.log("result: "+JSON.stringify(j))}},error:function(l,k,j){console.log("/ajax/api/tags/getNodeTags failed, error: "+j)}})};if(F.data("initialized")){console.log("Tag Editor is already initialized.");return }else{F.attr("data-initialized",true)}this.addTag=function(j,i){X(j,i)};this.addTags=function(i){O(i)};this.setTags=function(i){Y(i)};this.removeAllTags=function(){T()};this.getTags=function(){return B()};this.getTagEditor=function(){return g};f();g.off("keydown").on("keydown",function(j){var i=A(j.target).val().length;A(j.target).attr("size",(i>I?i:I));if(j.which==13){W=a?true:false;R();j.preventDefault();return false}});g.off("blur").on("blur",function(i){a=window.setTimeout(function(){if(!W){R()}W=false;a=false},200)});g.off("click").on("click",function(i){if(!A(i.target).hasClass("tag-input")){A(".tag-input",A(this)).focus();W=a?true:false}return false});g.each(function(){var i=A(this);i.closest("form").submit(function(){R()})});var Q=function(){if(!C&&!K){H.find(".you-may-add-text").addClass("h-hide")}else{if(C&&!K){H.find(".you-may-add-text span").text(C)}else{if(!C&&K){H.find(".you-may-add-text span").text(K)}else{H.find(".you-may-add-text span").text(Math.min(C,K))}}}if(!h()){g.hide()}else{if(g.is(":visible")){g[0].focus()}}};A(".tag-cloud-text.inline-tag-cloud .popular-tags-link",H).off("click").on("click",function(){var i=H.find(".tag-cloud");vBulletin.tagEditor.fetchPopularTags({type:"nodes",noformat:1,success:function(j){i.html(j);e(i.find(".tagcloudlink"),H)},error:function(j){i.html('<span class="error">{0}</span>'.format(j))}})});A(".tag-cloud-text:not(.inline-tag-cloud) .popular-tags-link",H).qtip({content:{text:vBulletin.phrase.get("loading")+"...",ajax:{url:vBulletin.getAjaxBaseurl()+"/search/fetchTagCloud",data:({type:"nodes",noformat:1}),type:"POST",dataType:"json",success:function(i,l,k){console.log("/search/fetchTagCloud successful, response: "+JSON.stringify(i));if(i){if(i.errors){this.set("content.text",'<span class="error">{0} {1}</span>'.format(vBulletin.phrase.get("error_fetching_popular_tags"),vBulletin.phrase.get(i.errors[0][0])))}else{this.set("content.text",'<div class="tag-cloud">{0}</div>'.format(i));A(".ui-tooltip-popular-tags").delegate(".tag-cloud .tagcloudlink label","click",D);var j=A(".ui-tooltip-popular-tags{0} .tag-cloud .tagcloudlink".format(F.data("tag-editor-id")?"."+F.data("tag-editor-id"):""));e(j,F)}}else{this.set("content.text",'<span class="error">{0}</span>'.format(vBulletin.phrase.get("error_fetching_popular_tags")))}},error:function(k,j,i){console.log("/search/fetchTagCloud failed, error: "+i);this.set("content.text",'<span class="error">{0}</span>'.format(vBulletin.phrase.get("error_fetching_popular_tags")))}},title:{text:vBulletin.phrase.get("tag_cloud"),button:false}},position:{at:"bottom center",my:"top center",viewport:A(window),effect:false},show:{event:"click",solo:true},hide:"unfocus",style:{classes:"ui-tooltip-shadow ui-tooltip-light ui-tooltip-rounded ui-tooltip-popular-tags "+(F.data("tag-editor-class")||""),width:280},events:{show:function(k,j){var i=A(".ui-tooltip-popular-tags{0} .tag-cloud .tagcloudlink".format(F.data("tag-editor-class")?"."+F.data("tag-editor-class"):""));e(i,F)}}});var D=function(j){var i=A(this);if(!i.parent().hasClass("added")&&X(i.text())){i.parent().addClass("added");if(g.is(":visible")){g[0].focus()}}return false};var e=function(i,j){if(i.length>0){var k=(j.find(".tag-input").val()||"").split(",");A.each(k,function(l,m){var n=A.trim(m);i.each(function(){if(A(this).data("tag")==n){A(this).addClass("added")}})})}};H.delegate(".tag-cloud .tagcloudlink label","click",D);F.delegate(".add-tag-link","click",function(j){j.stopPropagation();var i=A(this);var k=F.find(".tag-editor-container");if(k.length==1){k.dialog({title:vBulletin.phrase.get("add_tags"),autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:500,dialogClass:"dialog-container tag-editor-dialog-container dialog-box",open:function(){T();var l=F.find(".tag-input").val();if(l){var o=l.split(",");for(var n in o){X(A.trim(o[n]))}}else{if(J&&!g.attr("placeholder")){g.attr("placeholder",J)}}var p=b();if(p>0){g.show()}E(i.data("node-id"));var m=A(".tag-cloud",k);vBulletin.tagEditor.fetchPopularTags({type:F.data("type")||"nodes",noformat:1,success:function(q){m.html(q);e(m.find(".tagcloudlink"),F)},error:function(q){m.html('<span class="error">{0}</span>'.format(q))}})}}).dialog("open");i.data("tag-dialog",k);k.data("parent",i.closest("form, .search-controls-tags, .form_row"))}else{k=i.data("tag-dialog")||A();k.dialog("open")}return false})};vBulletin.tagEditor.fetchPopularTags=function(B){B=B||{};B.type=B.type!="search"?"nodes":B.type;A.ajax({url:vBulletin.getAjaxBaseurl()+"/search/fetchTagCloud",data:({type:B.type,noformat:B.noformat}),type:"POST",dataType:"json",success:function(C,E,D){console.log("/search/fetchTagCloud successful, response: "+JSON.stringify(C));if(C){if(C.errors){if(typeof B.error=="function"){B.error("{0} {1}".format(vBulletin.phrase.get("error_fetching_popular_tags"),vBulletin.phrase.get(C.errors[0][0])))}}else{if(typeof B.success=="function"){B.success(C,E,D)}}}else{if(typeof B.error=="function"){B.error(vBulletin.phrase.get("error_fetching_popular_tags"))}}},error:function(E,D,C){console.log("/search/fetchTagCloud failed, error: "+C);if(typeof B.error=="function"){B.error(vBulletin.phrase.get("error_fetching_popular_tags"))}},complete:function(C,D){if(typeof B.complete=="function"){B.complete(C,D)}}})};A(document).ready(function(){A(document).off("click",".tag-editor-container .cancel-tag-btn").on("click",".tag-editor-container .cancel-tag-btn",function(){A(".tag-editor-container").dialog("close")});A(document).off("click",".tag-editor-container .save-tag-btn").on("click",".tag-editor-container .save-tag-btn",function(){var E=A(this).closest(".tag-editor-container"),D=E.find(".tag-input").val(),B=D.replace(/\,/g,", "),C=E.data("parent");C.find(".tag-list span").html(B);C.find(".tag-input").val(D);C.find(".tag-list").toggleClass("h-hide",!D);E.dialog("close")});A(document).off("mousedown",".tag-editor-container .autocomplete-container").on("mousedown",".tag-editor-container .autocomplete-container",function(){var B=this;setTimeout(function(){var C=A(".autocompleteHelper:visible",B);if(C.length>0){C[0].focus()}},10);return false});if(A(".js-content-entry-tag-editor").length>0&&vBulletin.tagEditor){new vBulletin.tagEditor.instance(".js-content-entry-tag-editor")}})})(jQuery);;

// ***************************
// js.compressed/sb_search.js
// ***************************
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["error","error_adding_search_tips_code_x","invalid_json_string","invalid_search_syntax","invalid_server_response_please_try_again","search_tag_cloud","please_select_past_date","please_select_valid_date_range","content_type_Text","content_type_Gallery","content_type_Link","content_type_Photo","content_type_Poll","content_type_PrivateMessage","content_type_Video","save_as_search_module","saved_search_module_as_x","search_module_already_exists","search_module_not_found","please_enter_search_module_name","error_saving_search_module_x"]);(function(A){var B=[".search-fields-widget",".search-results-widget","#search-config-dialog"];if(!vBulletin.pageHasSelectors(B)){return false}window.vBulletin.search=window.vBulletin.search||{};window.vBulletin.search.SearchControl=function(G){var C=A(G),F=false,D=false,K=function(){var Q=C.find(".searchSwitchToAdvanced");var O=C.find(".searchSwitchToForm");var M=Q.is(":visible");var P=O.is(":visible");if(M==P){Q.toggle(true);O.toggle(false);C.find(".form_row.form-row-json").addClass("h-hide-imp").nextAll().show()}Q.off("click").on("click",function(){var T=J();if(!T){return false}var U=JSON.stringify(T);C.find(".searchFields_searchJSON").val(U);C.find(".form_row.form-row-json").removeClass("h-hide-imp").nextAll().hide();Q.toggle(false);O.toggle(true)});O.off("click").on("click",function(){if(I(C.find(".searchFields_searchJSON").val())){Q.toggle(true);O.toggle(false);C.find(".form_row.form-row-json").addClass("h-hide-imp").nextAll().show()}});var N=C.find(".advSearchForm");if(N.length>0){N.submit(H)}var R=C.find(".searchSubmitBtn");if(R.length>0){R.off("click").on("click",H)}var S=C.find(".searchResetBtn");if(S.length>0){S.off("click").on("click",function(){I("{}")})}F=new vBulletin.tagEditor.instance("{0}-searchFields_tag".format(G.replace(/\#/g,".")),true);var L=C.find(".searchFields_author");if(L.length>0){D=new vBulletin_Autocomplete(L,{apiClass:"user",containerClass:"entry-field h-clearfix"})}C.find(".searchFields_keywords").off("keydown").on("keydown",function(T){if(T.which==13){if(N.length>0){N.submit()}}});C.find(".searchFields_last_visit").off("click").on("click",function(T){C.find(".datefield").prop("disabled",A(this).prop("checked"));if(A(this).is(":checked")){C.find(".searchFields_from_date").datepicker("disable");C.find(".searchFields_to_date").datepicker("disable")}else{C.find(".searchFields_from_date").datepicker("enable");C.find(".searchFields_to_date").datepicker("enable")}});C.find(".searchFields_channel_param").off("click").on("click",function(T){if(A(this).prop("checked")){C.find(".searchFields_channel").selectBox("disable")}else{C.find(".searchFields_channel").selectBox("enable")}});C.find(".search-tips").off("click").on("click",function(T){A(".search-tips-dialog").first().dialog({title:vBulletin.phrase.get("search_tips"),autoOpen:false,modal:true,resizable:false,closeOnEscape:true,showCloseButton:true,width:500,dialogClass:"dialog-container search-tips-dialog-container dialog-box"}).dialog("open");T.stopPropagation();return false});C.find(".searchFields_channel").selectBox();C.find(".searchFields_order_field").selectBox();C.find(".searchFields_order_direction").selectBox();C.find(".searchFields_view").selectBox()},H=function(M){if(!C.find(".searchAdvancedFields").is(":visible")){var L=J();if(!L){return false}if(!L.author&&!L.channel&&!L.keywords&&!L.tag&&!L.type&&!L.date&&!L.last_visit){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("error_no_criteria"),iconType:"warning"});return false}C.find(".searchFields_searchJSON").val(JSON.stringify(L));C.find("form.advSearchForm").append(A("<input>").attr("name","humanverify[input]").attr("type","hidden").val(A('div.humanverify [name="humanverify[input]"]').val())).append(A("<input>").attr("name","humanverify[hash]").attr("type","hidden").val(A('div.humanverify [name="humanverify[hash]"]').val()))}},J=function(){var P={};if(C.find(".searchSwitchToForm").is(":visible")){P=JSON.parse(C.find(".searchFields_searchJSON").val()||"{}");if(P.length==0){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_json_string"),iconType:"warning"});return }return P}C.find("input[placeholder].placeholder").each(function(){if(A(this).val()==A(this).attr("placeholder")){A(this).val("")}});var o=C.find(".searchFields_keywords");if(o.length>0&&A.trim(o.val()).length>0){P.keywords=A.trim(o.val())}var L=C.find(".searchFields_title_only");if(L.length>0&&L.prop("checked")){P.title_only=1}var k=C.find(".searchFields_starter_only");if(k.length>0&&k.prop("checked")){P.starter_only=1}var O=C.find(".searchFields_myFriends");var d=C.find(".searchFields_iFollow");if(O.length>0&&O.prop("checked")){P.author="myFriends"}else{if(d.length>0&&d.prop("checked")){P.author="iFollow"}else{if(D){var n=D.getLabels();if(n.length>0){P.author=n}}}}var X=C.find(".tag-input");if(X.length>0){var N=C.find(".tag-input").val();if(N.length>0){var a=N.split(",");if(a.length>0){P.tag=a}}}var j=C.find(".searchFields_last_visit");if(j.length>0&&j.prop("checked")){P.last_visit=1}else{var M={};var R=C.find(".searchFields_from_days");if(R.length>0&&A.trim(R.val()).length>0){M.from=A.trim(R.val())}else{var h=C.find(".searchFields_from_date");var g=new Date();var i=g.getTime();if(h.length>0&&A.trim(h.val()).length>0){var Y=Date.parse(h.val());if(Y<=0){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_start_date"),iconType:"warning"});return false}else{if(Y>i){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("please_select_past_date"),iconType:"warning"});return false}}M.from=A.trim(h.val())}var b=C.find(".searchFields_to_date");if(b.length>0&&A.trim(b.val()).length>0){var W=Date.parse(b.val());if(W<=0){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_end_date"),iconType:"warning"});return false}else{if(W>i){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("please_select_past_date"),iconType:"warning"});return false}}if(Y&&Y>W){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("please_select_valid_date_range"),iconType:"warning"});return false}M.to=A.trim(b.val())}}if(!A.isEmptyObject(M)){P.date=M}}var c=C.find(".searchFields_featured");if(c.length>0&&c.prop("checked")){P.featured=1}var V=C.find(".searchFields_my_following");if(V.length>0&&V.prop("checked")){P.my_following=1}var Z=[];C.find(".searchFields_type:checked").each(function(p,q){Z.push(A(q).val())});if(A(Z).length>0){P.type=Z}var f=C.find(".searchFields_channel_param");if(f.length>0&&f.prop("checked")){P.channel={param:"channelid"}}else{var l=C.find("select.searchFields_channel");if(l.length>0){var S=l.val();if(S){P.channel=S}}}var Q=C.find(".searchFields_order_field");var U=C.find(".searchFields_order_direction");if(Q.length>0&&U.length>0&&Q.val()!=""){P.sort=Q.val();if(U.val()!=""){P.sort={};P.sort[Q.val()]=U.val()}}var T=C.find(".searchFields_view");if(T.length>0){P.view=T.val()}var m=C.find(".searchFields_exclude");if(m.length>0&&A.trim(m.val()).length>0){P.exclude=A.trim(m.val()).split(",")}var e=C.find(".searchFields_exclude_type");if(e.length>0&&A.trim(e.val()).length>0){P.exclude_type=A.trim(e.val()).split(",")}return P},I=function(f,j,u,R){var P=f;if(typeof f=="string"){try{f=JSON.parse(f||"{}");if(f.length==0){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_json_string"),iconType:"warning"});return false}}catch(q){openAlertDialog({title:vBulletin.phrase.get("error"),message:vBulletin.phrase.get("invalid_json_string"),iconType:"warning"});return false}}else{P=JSON.stringify(f)}var L=C.find(".searchFields_keywords");if(L.length>0){L.val(f.keywords||"");delete f.keywords}var i=C.find(".searchFields_title_only");if(i){i.prop("checked",f.title_only?true:false);delete f.title_only}var N=C.find(".searchFields_myFriends");var d=false;if(N.length>0){if(f.author&&f.author=="myFriends"){d=true;delete f.author}N.prop("checked",d)}var c=C.find(".searchFields_iFollow");var k=false;if(c.length>0){if(f.author&&f.author=="iFollow"){k=true;delete f.author}c.prop("checked",k)}var U=C.find(".searchFields_author");if(U.length>0){var Y=false;if(A.isArray(f.author)){Y=f.author}else{if(f.exactname){Y=[f.author]}}if(Y){D.setElements(Y);delete f.author;delete f.exactname}}var W=C.find(".searchFields_starter_only");if(W.length>0){W.prop("checked",f.starter_only?true:false);delete f.starter_only}var o=C.find(".tag-input");if(o.length>0){var n=f.tag||[];o.val(n);F.setTags(n);C.find(".tag-list span").html(n.join(", "));delete f.tag}var O=C.find(".searchFields_last_visit");var Q=false;if(f.last_visit||(f.date&&f.date.from&&f.date.from=="lastVisit")){Q=true}if(O.length>0){O.prop("checked",Q);C.find(".datefield").prop("disabled",Q);if(f.last_visit){delete f.last_visit}if(f.date&&f.date.from&&f.date.from=="lastVisit"){delete f.date["from"]}}var r=C.find(".searchFields_from_date");var w=C.find(".searchFields_to_date");var M=C.find(".searchFields_from_days");if(!Q){if(r.length>0){var g="";if(f.date&&f.date.from){g=f.date.from;delete f.date["from"]}r.val(g)}if(w.length>0){var t="";if(f.date&&f.date.to){t=f.date.to;delete f.date["to"]}w.val(t)}if(M.length>0){var g="";if(f.date&&f.date.from){g=f.date.from;delete f.date["from"]}M.val(g)}if(A.isEmptyObject(f.date)){delete f.date}}if(r.length>0){r.datepicker(O.is(":checked")?"disable":"enable")}if(w.length>0){w.datepicker(O.is(":checked")?"disable":"enable")}var m=C.find(".searchFields_featured");if(m.length>0){m.prop("checked",f.featured?true:false);delete f.featured}var V=C.find(".searchFields_my_following");if(V.length>0){V.prop("checked",f.my_following?true:false);delete f.my_following}var s=C.find(".searchFields_type_container");if(s.length>0){if(j){var X=s.find(".field-desc");X.prevAll().remove();A.each(j,function(y,x){if(y!="vBForum_PrivateMessage"){X.before(A('<label><input type="checkbox" name="searchFields[type][]" class="searchFields_type" value="'+y+'" /><span>'+vBulletin.phrase.get("content_type_"+x["class"])+"</span></label>"))}})}C.find(".searchFields_type").val(f.type||[]);delete f.type;delete f.exclude_type}var p=C.find(".searchFields_channel_param");var a=false;if(p.length>0){if(typeof f.channel=="object"&&f.channel.param){a=true;delete f.channel}p.prop("checked",a)}var l=C.find(".searchFields_channel");if(l.length>0){var v=false;if(p.length>0){l.prop("disabled",a)}if(u){l.children().remove();E(u,l);v=true}if(!a){l.val(f.channel||"");delete f.channel;v=true}if(v){resetSelectBox(l)}}var b=C.find("select.searchFields_order_direction");var S=C.find("select.searchFields_order_field");var h="";var Z="";if(f.sort){if(typeof f.sort=="string"){h=f.sort}else{if(typeof f.sort=="object"){A.each(f.sort,function(x,y){h=x;Z=y})}}delete f.sort}if(b.length>0){b.val(Z);resetSelectBox(b)}if(S.length>0){S.val(h);resetSelectBox(S)}var e=C.find("select.searchFields_view");if(e.length>0){e.val(f.view||"");resetSelectBox(e);delete f.view}if(!A.isEmptyObject(f)){var T=C.find(".searchSwitchToAdvanced");if(T.length>0){C.find(".form_row.form-row-json").removeClass("h-hide-imp").nextAll().hide();T.hide();C.find(".searchSwitchToForm").show();C.find(".searchFields_searchJSON").val(P)}return false}return true},E=function(L,M){A.each(L,function(O,N){M.append(A("<option></option>").val(O).html(str_repeat("&nbsp;",N.depth*3).concat(N.htmltitle)));if(N.channels){E(N.channels,M)}})};this.load=function(){return J()};this.set=function(O,M,L,N){return I(O,M,L,N)};K()};A(document).ready(function(){var C=A("#advancedSearchFields"),I=A(".search-results-widget");vBulletin.truncatePostContent(I);if(C.length>0){var D=new vBulletin.search.SearchControl(C.selector);searchJSONStr=C.find(".searchFields_searchJSON").val();if(searchJSONStr.length>0&&searchJSONStr!=C.find(".searchFields_searchJSON").attr("placeholder")){D.set(searchJSONStr,false,false,true)}C.find(".searchFields_from_date").datepicker({showOn:"both",gotoCurrent:true,maxDate:(new Date()),buttonImage:vBulletin.getAjaxBaseurl()+"/images/calendar-blue.png",buttonImageOnly:true,changeMonth:true,changeYear:true,onSelect:function(O,N){C.find(".searchFields_to_date").datepicker("option","minDate",new Date(O))}});C.find(".searchFields_to_date").datepicker({showOn:"both",gotoCurrent:true,maxDate:(new Date()),buttonImage:vBulletin.getAjaxBaseurl()+"/images/calendar-blue.png",buttonImageOnly:true,changeMonth:true,changeYear:true,onSelect:function(Q,P){var N=new Date();var O=new Date(Q);if(N.getTime()>O.getTime()){N=O}var R=C.find(".searchFields_from_date");R.datepicker("option","maxDate",N)}})}var J=A(".sort-controls",I);if(J.length>0){J.find(".searchFields_order_field").selectBox().change(function(){var O=L.find(".searchResults_searchJSON").val()||"{}";var N=JSON.parse(O);N.sort={};N.sort[A(this).val()]=J.find(".searchFields_order_direction").selectBox().val();L.find(".searchResults_searchJSON").val(JSON.stringify(N));A(".resultSearchForm").submit()});J.find(".searchFields_order_direction").selectBox().change(function(){var O=L.find(".searchResults_searchJSON").val()||"{}";var N=JSON.parse(O);N.sort={};N.sort[J.find(".searchFields_order_field").selectBox().val()]=A(this).val();L.find(".searchResults_searchJSON").val(JSON.stringify(N));A(".resultSearchForm").submit()});J.removeClass("h-invisible")}var L=A(".search-controls",I);if(L.length>0){var H=false;var M=false;L.find(".resultPopupControl").off("click").on("click",function(N){if(A(this).hasClass("open")){A(this).removeClass("open");A(this).siblings(".PopupContent").hide()}else{L.find(".resultPopupControl.open").each(function(P,O){A(O).siblings(".PopupContent").hide();A(O).removeClass("open")});A(this).addClass("open");A(this).siblings(".PopupContent").show()}N.stopPropagation();return false});var E=L.find(".searchFields_author");if(E.length>0){H=new vBulletin_Autocomplete(E,{apiClass:"user",containerClass:"entry-field h-clearfix"});L.find(".search-controls-members .removable-element .element-text").each(function(O,N){H.addElement(A(N).html())})}if(L.find(".searchResultTagEditor").length>0){M=new vBulletin.tagEditor.instance(".search-controls .searchResultTagEditor",true);L.find(".search-controls-tags .removable-element .element-text").each(function(O,N){M.addTag(A(N).html())})}L.find(".searchPopupBody button").off("click").on("click",function(P){var Q=L.find(".searchResults_searchJSON").val()||"{}";var N=JSON.parse(Q);var O=A(this).val();switch(O){case"keywords":N.keywords=L.find(".searchFields_keywords").val();N.title_only=L.find(".searchFields_title_only").is(":checked");break;case"author":N.author=H.getLabels();N.starter_only=L.find(".searchFields_starter_only").is(":checked");break;case"tags":N.tag=M.getTags();break;default:return ;break}L.find(".searchResults_searchJSON").val(JSON.stringify(N));A(".resultSearchForm").submit()});L.find(".removable-element .element-x").off("click").on("click",function(R){var S=L.find(".searchResults_searchJSON").val()||"{}";var O=JSON.parse(S);var Q=A(this).parents(".search-control-popup");if(Q.hasClass("search-controls-members")){A(this).parents(".removable-element").remove();var N=[];Q.find(".removable-element .element-text").each(function(U,T){N.push(A(T).html())});O.author=N;if(N.length==0){delete O.author}}if(Q.hasClass("search-controls-tags")){A(this).parents(".removable-element").remove();var P=[];Q.find(".removable-element .element-text").each(function(U,T){P.push(A(T).html())});O.tag=P;if(P.length==0){delete O.tag}}L.find(".searchResults_searchJSON").val(JSON.stringify(O));A(".resultSearchForm").submit()})}var G=A(".search-stats",I);if(G.length>0){}A("html").off("click.searchpopup").on("click.searchpopup",function(N){var O=A(N.target);if(L.length>0&&O.closest(".PopupContent").length==0&&O.closest(".ui-autocomplete").length==0&&L.find(".resultPopupControl.open").length>0&&(A(".tag-editor-container").length==0||A(".tag-editor-container").dialog("isOpen")!==true)){L.find(".resultPopupControl.open").siblings(".PopupContent").hide();L.find(".resultPopupControl.open").removeClass("open")}});if(vBulletin.inlinemod&&typeof vBulletin.inlinemod.init=="function"){vBulletin.inlinemod.init(I)}I.off("click",".js-post-control__ip-address").on("click",".js-post-control__ip-address",vBulletin.conversation.showIp);I.off("click",".js-post-control__vote").on("click",".js-post-control__vote",function(N){if(A(N.target).closest(".bubble-flyout").length==1){vBulletin.conversation.showWhoVoted.apply(N.target,[N])}else{vBulletin.conversation.votePost.apply(this,[N])}return false});I.off("click",".js-post-control__edit").on("click",".js-post-control__edit",vBulletin.conversation.editPost);I.off("click",".js-post-control__flag").on("click",".js-post-control__flag",vBulletin.conversation.flagPost);I.off("click",".js-post-control__comment").on("click",".js-post-control__comment",vBulletin.conversation.toggleCommentBox);I.off("click",".js-comment-entry__post").on("click",".js-comment-entry__post",function(N){vBulletin.conversation.postComment.apply(this,[N,function(O){location.reload()}])});var F=(typeof I.data("keywords")!="undefined")?I.data("keywords").toString():"";if(F.length>0){var K;A(F.split(" ")).each(function(O,N){K=N.toUpperCase();if(K=="OR"||K=="AND"){return }A(".post-header",I).highlight(N);if(!A(".searchFields_title_only",I).attr("checked")){A(".post-content",I).highlight(N)}})}})})(jQuery);function resetSelectBox(A){A.selectBox("destroy");A.removeData("selectBoxControl");A.removeData("selectBoxSettings");A.selectBox()};;

