(function(f){f.fn.qtip=function(C,v){var z,u,B,t,y,x,w,A;if(typeof C=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(C=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(C=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!C){C={}}if(typeof C.content!=="object"||(C.content.jquery&&C.content.length>0)){C.content={text:C.content}}if(typeof C.content.title!=="object"){C.content.title={text:C.content.title}}if(typeof C.position!=="object"){C.position={corner:C.position}}if(typeof C.position.corner!=="object"){C.position.corner={target:C.position.corner,tooltip:C.position.corner}}if(typeof C.show!=="object"){C.show={when:C.show}}if(typeof C.show.when!=="object"){C.show.when={event:C.show.when}}if(typeof C.show.effect!=="object"){C.show.effect={type:C.show.effect}}if(typeof C.hide!=="object"){C.hide={when:C.hide}}if(typeof C.hide.when!=="object"){C.hide.when={event:C.hide.when}}if(typeof C.hide.effect!=="object"){C.hide.effect={type:C.hide.effect}}if(typeof C.style!=="object"){C.style={name:C.style}}C.style=c(C.style);t=f.extend(true,{},f.fn.qtip.defaults,C);t.style=a.call({options:t},t.style);t.user=f.extend(true,{},C)}return f(this).each(function(){if(typeof C=="string"){x=C.toLowerCase();B=f(this).qtip("interfaces");if(typeof B=="object"){if(v===true&&x=="destroy"){while(B.length>0){B[B.length-1].destroy()}}else{if(v!==true){B=[f(this).qtip("api")]}for(z=0;z<B.length;z++){if(x=="destroy"){B[z].destroy()}else{if(B[z].status.rendered===true){if(x=="show"){B[z].show()}else{if(x=="hide"){B[z].hide()}else{if(x=="focus"){B[z].focus()}else{if(x=="disable"){B[z].disable(true)}else{if(x=="enable"){B[z].disable(false)}}}}}}}}}}}else{w=f.extend(true,{},t);w.hide.effect.length=t.hide.effect.length;w.show.effect.length=t.show.effect.length;if(w.position.container===false){w.position.container=f(document.body)}if(w.position.target===false){w.position.target=f(this)}if(w.show.when.target===false){w.show.when.target=f(this)}if(w.hide.when.target===false){w.hide.when.target=f(this)}u=f.fn.qtip.interfaces.length;for(z=0;z<u;z++){if(typeof f.fn.qtip.interfaces[z]=="undefined"){u=z;break}}y=new d(f(this),w,u);f.fn.qtip.interfaces[u]=y;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(y)}else{f(this).data("qtip",{current:0,interfaces:[y]})}if(w.content.prerender===false&&w.show.when.event!==false&&w.show.ready!==true){w.show.when.target.bind(w.show.when.event+".qtip-"+u+"-create",{qtip:u},function(D){A=f.fn.qtip.interfaces[D.data.qtip];A.options.show.when.target.unbind(A.options.show.when.event+".qtip-"+D.data.qtip+"-create");A.cache.mouse={x:D.pageX,y:D.pageY};q.call(A);A.options.show.when.target.trigger(A.options.show.when.event)})}else{y.cache.mouse={x:w.show.when.target.offset().left,y:w.show.when.target.offset().top};q.call(y)}}})};function d(v,u,w){var t=this;t.id=w;t.options=u;t.status={animated:false,rendered:false,disabled:false,focused:false};t.elements={target:v.addClass(t.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};t.cache={mouse:{},position:{},toggle:0};t.timers={};f.extend(t,t.options.api,{show:function(z){var y,A;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(t.elements.tooltip.css("display")!=="none"){return t}t.elements.tooltip.stop(true,false);y=t.beforeShow.call(t,z);if(y===false){return t}function x(){if(t.options.position.type!=="static"){t.focus()}t.onShow.call(t,z);if(f.browser.msie){t.elements.tooltip.get(0).style.removeAttribute("filter")}}t.cache.toggle=1;if(t.options.position.type!=="static"){t.updatePosition(z,(t.options.show.effect.length>0))}if(typeof t.options.show.solo=="object"){A=f(t.options.show.solo)}else{if(t.options.show.solo===true){A=f("div.qtip").not(t.elements.tooltip)}}if(A){A.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof t.options.show.effect.type=="function"){t.options.show.effect.type.call(t.elements.tooltip,t.options.show.effect.length);t.elements.tooltip.queue(function(){x();f(this).dequeue()})}else{switch(t.options.show.effect.type.toLowerCase()){case"fade":t.elements.tooltip.fadeIn(t.options.show.effect.length,x);break;case"slide":t.elements.tooltip.slideDown(t.options.show.effect.length,function(){x();if(t.options.position.type!=="static"){t.updatePosition(z,true)}});break;case"grow":t.elements.tooltip.show(t.options.show.effect.length,x);break;default:t.elements.tooltip.show(null,x);break}t.elements.tooltip.addClass(t.options.style.classes.active)}return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(z){var y;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(t.elements.tooltip.css("display")==="none"){return t}}clearTimeout(t.timers.show);t.elements.tooltip.stop(true,false);y=t.beforeHide.call(t,z);if(y===false){return t}function x(){t.onHide.call(t,z)}t.cache.toggle=0;if(typeof t.options.hide.effect.type=="function"){t.options.hide.effect.type.call(t.elements.tooltip,t.options.hide.effect.length);t.elements.tooltip.queue(function(){x();f(this).dequeue()})}else{switch(t.options.hide.effect.type.toLowerCase()){case"fade":t.elements.tooltip.fadeOut(t.options.hide.effect.length,x);break;case"slide":t.elements.tooltip.slideUp(t.options.hide.effect.length,x);break;case"grow":t.elements.tooltip.hide(t.options.hide.effect.length,x);break;default:t.elements.tooltip.hide(null,x);break}t.elements.tooltip.removeClass(t.options.style.classes.active)}return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(x,y){var D,H,M,K,I,F,z,J,C,E,L,B,G,A;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(t.options.position.type=="static"){return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}H={position:{left:0,top:0},dimensions:{height:0,width:0},corner:t.options.position.corner.target};M={position:t.getPosition(),dimensions:t.getDimensions(),corner:t.options.position.corner.tooltip};if(t.options.position.target!=="mouse"){if(t.options.position.target.get(0).nodeName.toLowerCase()=="area"){K=t.options.position.target.attr("coords").split(",");for(D=0;D<K.length;D++){K[D]=parseInt(K[D])}I=t.options.position.target.parent("map").attr("name");F=f('img[usemap="#'+I+'"]:first').offset();H.position={left:Math.floor(F.left+K[0]),top:Math.floor(F.top+K[1])};switch(t.options.position.target.attr("shape").toLowerCase()){case"rect":H.dimensions={width:Math.ceil(Math.abs(K[2]-K[0])),height:Math.ceil(Math.abs(K[3]-K[1]))};break;case"circle":H.dimensions={width:K[2]+1,height:K[2]+1};break;case"poly":H.dimensions={width:K[0],height:K[1]};for(D=0;D<K.length;D++){if(D%2==0){if(K[D]>H.dimensions.width){H.dimensions.width=K[D]}if(K[D]<K[0]){H.position.left=Math.floor(F.left+K[D])}}else{if(K[D]>H.dimensions.height){H.dimensions.height=K[D]}if(K[D]<K[1]){H.position.top=Math.floor(F.top+K[D])}}}H.dimensions.width=H.dimensions.width-(H.position.left-F.left);H.dimensions.height=H.dimensions.height-(H.position.top-F.top);break;default:return f.fn.qtip.log.error.call(t,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}H.dimensions.width-=2;H.dimensions.height-=2}else{if(t.options.position.target.add(document.body).length===1){H.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};H.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof t.options.position.target.attr("qtip")!=="undefined"){H.position=t.options.position.target.qtip("api").cache.position}else{H.position=t.options.position.target.offset()}H.dimensions={height:t.options.position.target.outerHeight(),width:t.options.position.target.outerWidth()}}}z=f.extend({},H.position);if(H.corner.search(/right/i)!==-1){z.left+=H.dimensions.width}if(H.corner.search(/bottom/i)!==-1){z.top+=H.dimensions.height}if(H.corner.search(/((top|bottom)Middle)|center/)!==-1){z.left+=(H.dimensions.width/2)}if(H.corner.search(/((left|right)Middle)|center/)!==-1){z.top+=(H.dimensions.height/2)}}else{H.position=z={left:t.cache.mouse.x,top:t.cache.mouse.y};H.dimensions={height:1,width:1}}if(M.corner.search(/right/i)!==-1){z.left-=M.dimensions.width}if(M.corner.search(/bottom/i)!==-1){z.top-=M.dimensions.height}if(M.corner.search(/((top|bottom)Middle)|center/)!==-1){z.left-=(M.dimensions.width/2)}if(M.corner.search(/((left|right)Middle)|center/)!==-1){z.top-=(M.dimensions.height/2)}J=(f.browser.msie)?1:0;C=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(t.options.style.border.radius>0){if(M.corner.search(/Left/)!==-1){z.left-=t.options.style.border.radius}else{if(M.corner.search(/Right/)!==-1){z.left+=t.options.style.border.radius}}if(M.corner.search(/Top/)!==-1){z.top-=t.options.style.border.radius}else{if(M.corner.search(/Bottom/)!==-1){z.top+=t.options.style.border.radius}}}if(J){if(M.corner.search(/top/)!==-1){z.top-=J}else{if(M.corner.search(/bottom/)!==-1){z.top+=J}}if(M.corner.search(/left/)!==-1){z.left-=J}else{if(M.corner.search(/right/)!==-1){z.left+=J}}if(M.corner.search(/leftMiddle|rightMiddle/)!==-1){z.top-=1}}if(t.options.position.adjust.screen===true){z=o.call(t,z,H,M)}if(t.options.position.target==="mouse"&&t.options.position.adjust.mouse===true){if(t.options.position.adjust.screen===true&&t.elements.tip){L=t.elements.tip.attr("rel")}else{L=t.options.position.corner.tooltip}z.left+=(L.search(/right/i)!==-1)?-6:6;z.top+=(L.search(/bottom/i)!==-1)?-6:6}if(!t.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){B=f(this).offset();B.bottom=B.top+f(this).height();B.right=B.left+f(this).width();if(z.top+M.dimensions.height>=B.top&&z.left+M.dimensions.width>=B.left){k.call(t)}})}z.left+=t.options.position.adjust.x;z.top+=t.options.position.adjust.y;G=t.getPosition();if(z.left!=G.left||z.top!=G.top){A=t.beforePositionUpdate.call(t,x);if(A===false){return t}t.cache.position=z;if(y===true){t.status.animated=true;t.elements.tooltip.animate(z,200,"swing",function(){t.status.animated=false})}else{t.elements.tooltip.css(z)}t.onPositionUpdate.call(t,x);if(typeof x!=="undefined"&&x.type&&x.type!=="mousemove"){f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return t},updateWidth:function(x){var y;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(x&&typeof x!=="number"){return f.fn.qtip.log.error.call(t,2,"newWidth must be of type number","updateWidth")}}y=t.elements.contentWrapper.siblings().add(t.elements.tip).add(t.elements.button);if(!x){if(typeof t.options.style.width.value=="number"){x=t.options.style.width.value}else{t.elements.tooltip.css({width:"auto"});y.hide();if(f.browser.msie){t.elements.wrapper.add(t.elements.contentWrapper.children()).css({zoom:"normal"})}x=t.getDimensions().width+1;if(!t.options.style.width.value){if(x>t.options.style.width.max){x=t.options.style.width.max}if(x<t.options.style.width.min){x=t.options.style.width.min}}}}if(x%2!==0){x-=1}t.elements.tooltip.width(x);y.show();if(t.options.style.border.radius){t.elements.tooltip.find(".qtip-betweenCorners").each(function(z){f(this).width(x-(t.options.style.border.radius*2))})}if(f.browser.msie){t.elements.wrapper.add(t.elements.contentWrapper.children()).css({zoom:"1"});t.elements.wrapper.width(x);if(t.elements.bgiframe){t.elements.bgiframe.width(x).height(t.getDimensions.height)}}return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(x){var A,B,y,z,C;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof x!=="string"||!f.fn.qtip.styles[x]){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}t.options.style=a.call(t,f.fn.qtip.styles[x],t.options.user.style);t.elements.content.css(r(t.options.style));if(t.options.content.title.text!==false){t.elements.title.css(r(t.options.style.title,true))}t.elements.contentWrapper.css({borderColor:t.options.style.border.color});if(t.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){A=t.elements.tooltip.find(".qtip-tip canvas:first");y=A.get(0).getContext("2d");y.clearRect(0,0,300,300);z=A.parent("div[rel]:first").attr("rel");C=b(z,t.options.style.tip.size.width,t.options.style.tip.size.height);h.call(t,A,C,t.options.style.tip.color||t.options.style.border.color)}else{if(f.browser.msie){A=t.elements.tooltip.find('.qtip-tip [nodeName="shape"]');A.attr("fillcolor",t.options.style.tip.color||t.options.style.border.color)}}}if(t.options.style.border.radius>0){t.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:t.options.style.border.color});if(f("<canvas>").get(0).getContext){B=g(t.options.style.border.radius);t.elements.tooltip.find(".qtip-wrapper canvas").each(function(){y=f(this).get(0).getContext("2d");y.clearRect(0,0,300,300);z=f(this).parent("div[rel]:first").attr("rel");s.call(t,f(this),B[z],t.options.style.border.radius,t.options.style.border.color)})}else{if(f.browser.msie){t.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",t.options.style.border.color)})}}}return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(B,z){var A,y,x;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!B){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}A=t.beforeContentUpdate.call(t,B);if(typeof A=="string"){B=A}else{if(A===false){return}}if(f.browser.msie){t.elements.contentWrapper.children().css({zoom:"normal"})}if(B.jquery&&B.length>0){B.clone(true).appendTo(t.elements.content).show()}else{t.elements.content.html(B)}y=t.elements.content.find("img[complete=false]");if(y.length>0){x=0;y.each(function(D){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++x==y.length){C()}})})}else{C()}function C(){t.updateWidth();if(z!==false){if(t.options.position.type!=="static"){t.updatePosition(t.elements.tooltip.is(":visible"),true)}if(t.options.style.tip.corner!==false){n.call(t)}}}t.onContentUpdate.call(t);return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(x,A,B){var z;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}z=t.beforeContentLoad.call(t);if(z===false){return t}if(B=="post"){f.post(x,A,y)}else{f.get(x,A,y)}function y(C){t.onContentLoad.call(t);f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");t.updateContent(C)}return t},updateTitle:function(x){if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!x){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=t.beforeTitleUpdate.call(t);if(returned===false){return t}if(t.elements.button){t.elements.button=t.elements.button.clone(true)}t.elements.title.html(x);if(t.elements.button){t.elements.title.prepend(t.elements.button)}t.onTitleUpdate.call(t);return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(B){var z,y,x,A;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(t.options.position.type=="static"){return f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}z=parseInt(t.elements.tooltip.css("z-index"));y=6000+f("div.qtip[qtip]").length-1;if(!t.status.focused&&z!==y){A=t.beforeFocus.call(t,B);if(A===false){return t}f("div.qtip[qtip]").not(t.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){x=parseInt(f(this).css("z-index"));if(typeof x=="number"&&x>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});t.elements.tooltip.css({zIndex:y});t.status.focused=true;t.onFocus.call(t,B);f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return t},disable:function(x){if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(x){if(!t.status.disabled){t.status.disabled=true;f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(t.status.disabled){t.status.disabled=false;f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return t},destroy:function(){var x,y,z;y=t.beforeDestroy.call(t);if(y===false){return t}if(t.status.rendered){t.options.show.when.target.unbind("mousemove.qtip",t.updatePosition);t.options.show.when.target.unbind("mouseout.qtip",t.hide);t.options.show.when.target.unbind(t.options.show.when.event+".qtip");t.options.hide.when.target.unbind(t.options.hide.when.event+".qtip");t.elements.tooltip.unbind(t.options.hide.when.event+".qtip");t.elements.tooltip.unbind("mouseover.qtip",t.focus);t.elements.tooltip.remove()}else{t.options.show.when.target.unbind(t.options.show.when.event+".qtip-create")}if(typeof t.elements.target.data("qtip")=="object"){z=t.elements.target.data("qtip").interfaces;if(typeof z=="object"&&z.length>0){for(x=0;x<z.length-1;x++){if(z[x].id==t.id){z.splice(x,1)}}}}delete f.fn.qtip.interfaces[t.id];if(typeof z=="object"&&z.length>0){t.elements.target.data("qtip").current=z.length-1}else{t.elements.target.removeData("qtip")}t.onDestroy.call(t);f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return t.elements.target},getPosition:function(){var x,y;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}x=(t.elements.tooltip.css("display")!=="none")?false:true;if(x){t.elements.tooltip.css({visiblity:"hidden"}).show()}y=t.elements.tooltip.offset();if(x){t.elements.tooltip.css({visiblity:"visible"}).hide()}return y},getDimensions:function(){var x,y;if(!t.status.rendered){return f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}x=(!t.elements.tooltip.is(":visible"))?true:false;if(x){t.elements.tooltip.css({visiblity:"hidden"}).show()}y={height:t.elements.tooltip.outerHeight(),width:t.elements.tooltip.outerWidth()};if(x){t.elements.tooltip.css({visiblity:"visible"}).hide()}return y}})}function q(){var t,x,v,u,w,z,y;t=this;t.beforeRender.call(t);t.status.rendered=true;t.elements.tooltip='<div qtip="'+t.id+'" class="qtip '+(t.options.style.classes.tooltip||t.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+t.options.position.type+';">  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;">    <div class="qtip-contentWrapper" style="overflow:hidden;">       <div class="qtip-content '+t.options.style.classes.content+'"></div></div></div></div>';t.elements.tooltip=f(t.elements.tooltip);t.elements.tooltip.appendTo(t.options.position.container);t.elements.tooltip.data("qtip",{current:0,interfaces:[t]});t.elements.wrapper=t.elements.tooltip.children("div:first");t.elements.contentWrapper=t.elements.wrapper.children("div:first").css({background:t.options.style.background});t.elements.content=t.elements.contentWrapper.children("div:first").css(r(t.options.style));if(f.browser.msie){t.elements.wrapper.add(t.elements.content).css({zoom:1})}if(t.options.hide.when.event=="unfocus"){t.elements.tooltip.attr("unfocus",true)}if(typeof t.options.style.width.value=="number"){t.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(t.options.style.border.radius>0){m.call(t)}else{t.elements.contentWrapper.css({border:t.options.style.border.width+"px solid "+t.options.style.border.color})}if(t.options.style.tip.corner!==false){e.call(t)}}else{t.elements.contentWrapper.css({border:t.options.style.border.width+"px solid "+t.options.style.border.color});t.options.style.border.radius=0;t.options.style.tip.corner=false;f.fn.qtip.log.error.call(t,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof t.options.content.text=="string"&&t.options.content.text.length>0)||(t.options.content.text.jquery&&t.options.content.text.length>0)){v=t.options.content.text}else{if(typeof t.elements.target.attr("title")=="string"&&t.elements.target.attr("title").length>0){v=t.elements.target.attr("title").replace("\\n","<br />");t.elements.target.attr("title","")}else{if(typeof t.elements.target.attr("alt")=="string"&&t.elements.target.attr("alt").length>0){v=t.elements.target.attr("alt").replace("\\n","<br />");t.elements.target.attr("alt","")}else{v=" ";f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(t.options.content.title.text!==false){j.call(t)}t.updateContent(v);l.call(t);if(t.options.show.ready===true){t.show()}if(t.options.content.url!==false){u=t.options.content.url;w=t.options.content.data;z=t.options.content.method||"get";t.loadContent(u,w,z)}t.onRender.call(t);f.fn.qtip.log.error.call(t,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var G,A,u,C,y,F,v,H,E,z,x,D,B,t,w;G=this;G.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();u=G.options.style.border.width;C=G.options.style.border.radius;y=G.options.style.border.color||G.options.style.tip.color;F=g(C);v={};for(A in F){v[A]='<div rel="'+A+'" style="'+((A.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+C+"px; width:"+C+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){v[A]+='<canvas height="'+C+'" width="'+C+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){H=C*2+3;v[A]+='<v:arc stroked="false" fillcolor="'+y+'" startangle="'+F[A][0]+'" endangle="'+F[A][1]+'" style="width:'+H+"px; height:"+H+"px; margin-top:"+((A.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((A.search(/Right/)!==-1)?F[A][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}v[A]+="</div>"}E=G.getDimensions().width-(Math.max(u,C)*2);z='<div class="qtip-betweenCorners" style="height:'+C+"px; width:"+E+"px; overflow:hidden; background-color:"+y+'; line-height:0.1px; font-size:1px;">';x='<div class="qtip-borderTop" dir="ltr" style="height:'+C+"px; margin-left:"+C+'px; line-height:0.1px; font-size:1px; padding:0;">'+v.topLeft+v.topRight+z;G.elements.wrapper.prepend(x);D='<div class="qtip-borderBottom" dir="ltr" style="height:'+C+"px; margin-left:"+C+'px; line-height:0.1px; font-size:1px; padding:0;">'+v.bottomLeft+v.bottomRight+z;G.elements.wrapper.append(D);if(f("<canvas>").get(0).getContext){G.elements.wrapper.find("canvas").each(function(){B=F[f(this).parent("[rel]:first").attr("rel")];s.call(G,f(this),B,C,y)})}else{if(f.browser.msie){G.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}t=Math.max(C,(C+(u-C)));w=Math.max(u-C,0);G.elements.contentWrapper.css({border:"0px solid "+y,borderWidth:w+"px "+t+"px"})}function s(v,x,t,u){var w=v.get(0).getContext("2d");w.fillStyle=u;w.beginPath();w.arc(x[0],x[1],t,0,Math.PI*2,false);w.fill()}function e(w){var u,t,y,v,x;u=this;if(u.elements.tip!==null){u.elements.tip.remove()}t=u.options.style.tip.color||u.options.style.border.color;if(u.options.style.tip.corner===false){return}else{if(!w){w=u.options.style.tip.corner}}y=b(w,u.options.style.tip.size.width,u.options.style.tip.size.height);u.elements.tip='<div class="'+u.options.style.classes.tip+'" dir="ltr" rel="'+w+'" style="position:absolute; height:'+u.options.style.tip.size.height+"px; width:"+u.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){u.elements.tip+='<canvas height="'+u.options.style.tip.size.height+'" width="'+u.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){v=u.options.style.tip.size.width+","+u.options.style.tip.size.height;x="m"+y[0][0]+","+y[0][1];x+=" l"+y[1][0]+","+y[1][1];x+=" "+y[2][0]+","+y[2][1];x+=" xe";u.elements.tip+='<v:shape fillcolor="'+t+'" stroked="false" filled="true" path="'+x+'" coordsize="'+v+'" style="width:'+u.options.style.tip.size.width+"px; height:"+u.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((w.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';u.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';u.elements.contentWrapper.css("position","relative")}}u.elements.tooltip.prepend(u.elements.tip+"</div>");u.elements.tip=u.elements.tooltip.find("."+u.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(u,u.elements.tip.find("canvas:first"),y,t)}if(w.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){u.elements.tip.css({marginTop:-4})}n.call(u,w)}function h(u,w,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.moveTo(w[0][0],w[0][1]);v.lineTo(w[1][0],w[1][1]);v.lineTo(w[2][0],w[2][1]);v.fill()}function n(v){var u,x,t,y,w;u=this;if(u.options.style.tip.corner===false||!u.elements.tip){return}if(!v){v=u.elements.tip.attr("rel")}x=positionAdjust=(f.browser.msie)?1:0;u.elements.tip.css(v.match(/left|right|top|bottom/)[0],0);if(v.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(v.search(/top/)!==-1)?-3:1}else{positionAdjust=(v.search(/top/)!==-1)?1:2}}if(v.search(/Middle/)!==-1){u.elements.tip.css({left:"50%",marginLeft:-(u.options.style.tip.size.width/2)})}else{if(v.search(/Left/)!==-1){u.elements.tip.css({left:u.options.style.border.radius-x})}else{if(v.search(/Right/)!==-1){u.elements.tip.css({right:u.options.style.border.radius+x})}}}if(v.search(/top/)!==-1){u.elements.tip.css({top:-positionAdjust})}else{u.elements.tip.css({bottom:positionAdjust})}}else{if(v.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((v.search(/left/)!==-1)?1:2)}if(v.search(/Middle/)!==-1){u.elements.tip.css({top:"50%",marginTop:-(u.options.style.tip.size.height/2)})}else{if(v.search(/Top/)!==-1){u.elements.tip.css({top:u.options.style.border.radius-x})}else{if(v.search(/Bottom/)!==-1){u.elements.tip.css({bottom:u.options.style.border.radius+x})}}}if(v.search(/left/)!==-1){u.elements.tip.css({left:-positionAdjust})}else{u.elements.tip.css({right:positionAdjust})}}}t="padding-"+v.match(/left|right|top|bottom/)[0];y=u.options.style.tip.size[(t.search(/left|right/)!==-1)?"width":"height"];u.elements.tooltip.css("padding",0);u.elements.tooltip.css(t,y);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){w=parseInt(u.elements.tip.css("margin-top"))||0;w+=parseInt(u.elements.content.css("margin-top"))||0;u.elements.tip.css({marginTop:w})}}function j(){var t=this;if(t.elements.title!==null){t.elements.title.remove()}t.elements.title=f('<div class="'+t.options.style.classes.title+'">').css(r(t.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(t.elements.contentWrapper);if(t.options.content.title.text){t.updateTitle.call(t,t.options.content.title.text)}if(t.options.content.title.button!==false&&typeof t.options.content.title.button=="string"){t.elements.button=f('<a class="'+t.options.style.classes.button+'" style="float:right; position: relative"></a>').css(r(t.options.style.button,true)).html(t.options.content.title.button).prependTo(t.elements.title).click(function(u){if(!t.status.disabled){t.hide(u)}})}}function l(){var u,w,v,t;u=this;w=u.options.show.when.target;v=u.options.hide.when.target;if(u.options.hide.fixed){v=v.add(u.elements.tooltip)}if(u.options.hide.when.event=="inactive"){t=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function z(A){if(u.status.disabled===true){return}clearTimeout(u.timers.inactive);u.timers.inactive=setTimeout(function(){f(t).each(function(){v.unbind(this+".qtip-inactive");u.elements.content.unbind(this+".qtip-inactive")});u.hide(A)},u.options.hide.delay)}}else{if(u.options.hide.fixed===true){u.elements.tooltip.bind("mouseover.qtip",function(){if(u.status.disabled===true){return}clearTimeout(u.timers.hide)})}}function y(A){if(u.status.disabled===true){return}if(u.options.hide.when.event=="inactive"){f(t).each(function(){v.bind(this+".qtip-inactive",z);u.elements.content.bind(this+".qtip-inactive",z)});z()}clearTimeout(u.timers.show);clearTimeout(u.timers.hide);u.timers.show=setTimeout(function(){u.show(A)},u.options.show.delay)}function x(A){if(u.status.disabled===true){return}if(u.options.hide.fixed===true&&u.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(A.relatedTarget).parents("div.qtip[qtip]").length>0){A.stopPropagation();A.preventDefault();clearTimeout(u.timers.hide);return false}clearTimeout(u.timers.show);clearTimeout(u.timers.hide);u.elements.tooltip.stop(true,true);u.timers.hide=setTimeout(function(){u.hide(A)},u.options.hide.delay)}if((u.options.show.when.target.add(u.options.hide.when.target).length===1&&u.options.show.when.event==u.options.hide.when.event&&u.options.hide.when.event!=="inactive")||u.options.hide.when.event=="unfocus"){u.cache.toggle=0;w.bind(u.options.show.when.event+".qtip",function(A){if(u.cache.toggle==0){y(A)}else{x(A)}})}else{w.bind(u.options.show.when.event+".qtip",y);if(u.options.hide.when.event!=="inactive"){v.bind(u.options.hide.when.event+".qtip",x)}}if(u.options.position.type.search(/(fixed|absolute)/)!==-1){u.elements.tooltip.bind("mouseover.qtip",u.focus)}if(u.options.position.target==="mouse"&&u.options.position.type!=="static"){w.bind("mousemove.qtip",function(A){u.cache.mouse={x:A.pageX,y:A.pageY};if(u.status.disabled===false&&u.options.position.adjust.mouse===true&&u.options.position.type!=="static"&&u.elements.tooltip.css("display")!=="none"){u.updatePosition(A)}})}}function o(v,w,B){var A,t,y,z,u,x;A=this;if(B.corner=="center"){return w.position}t=f.extend({},v);z={x:false,y:false};u={left:(t.left<f.fn.qtip.cache.screen.scroll.left),right:(t.left+B.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(t.top<f.fn.qtip.cache.screen.scroll.top),bottom:(t.top+B.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};y={left:(u.left&&(B.corner.search(/right/i)!=-1||(B.corner.search(/right/i)==-1&&!u.right))),right:(u.right&&(B.corner.search(/left/i)!=-1||(B.corner.search(/left/i)==-1&&!u.left))),top:(u.top&&B.corner.search(/top/i)==-1),bottom:(u.bottom&&B.corner.search(/bottom/i)==-1)};if(y.left){if(A.options.position.target!=="mouse"){t.left=w.position.left+w.dimensions.width}else{t.left=A.cache.mouse.x}z.x="Left"}else{if(y.right){if(A.options.position.target!=="mouse"){t.left=w.position.left-B.dimensions.width}else{t.left=A.cache.mouse.x-B.dimensions.width}z.x="Right"}}if(y.top){if(A.options.position.target!=="mouse"){t.top=w.position.top+w.dimensions.height}else{t.top=A.cache.mouse.y}z.y="top"}else{if(y.bottom){if(A.options.position.target!=="mouse"){t.top=w.position.top-B.dimensions.height}else{t.top=A.cache.mouse.y-B.dimensions.height}z.y="bottom"}}if(t.left<0){t.left=v.left;z.x=false}if(t.top<0){t.top=v.top;z.y=false}if(A.options.style.tip.corner!==false){t.corner=new String(B.corner);if(z.x!==false){t.corner=t.corner.replace(/Left|Right|Middle/,z.x)}if(z.y!==false){t.corner=t.corner.replace(/top|bottom/,z.y)}if(t.corner!==A.elements.tip.attr("rel")){e.call(A,t.corner)}}return t}function r(v,u){var w,t;w=f.extend(true,{},v);for(t in w){if(u===true&&t.search(/(tip|classes)/i)!==-1){delete w[t]}else{if(!u&&t.search(/(width|border|tip|title|classes|user)/i)!==-1){delete w[t]}}}return w}function c(t){if(typeof t.tip!=="object"){t.tip={corner:t.tip}}if(typeof t.tip.size!=="object"){t.tip.size={width:t.tip.size,height:t.tip.size}}if(typeof t.border!=="object"){t.border={width:t.border}}if(typeof t.width!=="object"){t.width={value:t.width}}if(typeof t.width.max=="string"){t.width.max=parseInt(t.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof t.width.min=="string"){t.width.min=parseInt(t.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof t.tip.size.x=="number"){t.tip.size.width=t.tip.size.x;delete t.tip.size.x}if(typeof t.tip.size.y=="number"){t.tip.size.height=t.tip.size.y;delete t.tip.size.y}return t}function a(){var t,u,v,y,w,x;t=this;v=[true,{}];for(u=0;u<arguments.length;u++){v.push(arguments[u])}y=[f.extend.apply(f,v)];while(typeof y[0].name=="string"){y.unshift(c(f.fn.qtip.styles[y[0].name]))}y.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);w=f.extend.apply(f,y);x=(f.browser.msie)?1:0;w.tip.size.width+=x;w.tip.size.height+=x;if(w.tip.size.width%2>0){w.tip.size.width+=1}if(w.tip.size.height%2>0){w.tip.size.height+=1}if(w.tip.corner===true){w.tip.corner=(t.options.position.corner.tooltip==="center")?false:t.options.position.corner.tooltip}return w}function b(w,v,u){var t={bottomRight:[[0,0],[v,u],[v,0]],bottomLeft:[[0,0],[v,0],[0,u]],topRight:[[0,u],[v,0],[v,u]],topLeft:[[0,0],[0,u],[v,u]],topMiddle:[[0,u],[v/2,0],[v,u]],bottomMiddle:[[0,0],[v,0],[v/2,u]],rightMiddle:[[0,0],[v,u/2],[0,u]],leftMiddle:[[v,0],[v,u],[0,u/2]]};t.leftTop=t.bottomRight;t.rightTop=t.bottomLeft;t.leftBottom=t.topRight;t.rightBottom=t.topLeft;return t[w]}function g(t){var u;if(f("<canvas>").get(0).getContext){u={topLeft:[t,t],topRight:[0,t],bottomLeft:[t,0],bottomRight:[0,0]}}else{if(f.browser.msie){u={topLeft:[-90,90,0],topRight:[-90,90,-t],bottomLeft:[90,270,0],bottomRight:[90,270,-t]}}}return u}function k(){var t,u,v;t=this;v=t.getDimensions();u='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+v.height+"px; width:"+v.width+'px" />';t.elements.bgiframe=t.elements.wrapper.prepend(u).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var t;f(window).bind("resize scroll",function(u){clearTimeout(t);t=setTimeout(function(){if(u.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var v=f.fn.qtip.interfaces[i];if(v.status.rendered===true&&(v.options.position.type!=="static"||v.options.position.adjust.scroll&&u.type==="scroll"||v.options.position.adjust.resize&&u.type==="resize")){v.updatePosition(u,true)}}},100)});f(document).bind("mousedown.qtip",function(u){if(f(u.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var v=f(this).qtip("api");if(f(this).is(":visible")&&!v.status.disabled&&f(u.target).add(v.elements.target).length>1){v.hide(u)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};$.fn.delay=function(b,a){return this.queue((a||"fx"),function(){var c=this;setTimeout(function(){$.dequeue(c)},b)})};(function(){var b=jQuery;b.suggest={};b.suggest.defaults={beforeUrl:"",click:false,id:false};function a(){if(this.box.is(":visible")){if((this.keyCode!=38)&&(this.keyCode!=40)){this.current=-1}else{if((this.keyCode==38)&&(this.current>-1)){--this.current;b("a",this.box).removeClass("hovered").eq(this.current).addClass("hovered");if(this.current==-1){this.input.val(this.text)}else{this.input.val((this.suggestions[this.current].b||"")+this.suggestions[this.current].s)}}else{if((this.keyCode==40)&&(this.current<(this.suggestions.length-1))){++this.current;b("a",this.box).removeClass("hovered").eq(this.current).addClass("hovered");this.input.val((this.suggestions[this.current].b||"")+this.suggestions[this.current].s)}}}}}function c(){var f=this;var h=this.box;if((this.keyCode!=38)&&(this.keyCode!=40)){this.text=this.input.val()}if((this.text!="")&&(this.keyCode!=13)&&(this.keyCode!=27)&&(this.keyCode!=38)&&(this.keyCode!=40)){this.suggestions=[];this.opt.suggest.call(f);var e=this.suggestions.length;if(e==0){this.hide()}else{h.empty();for(i=0;i<e;++i){var d=b("<a>").data("index",i).mouseover(function(){f.current=b(this).data("index");b("a",h).removeClass("hovered").eq(f.current).addClass("hovered")}).text(this.suggestions[i].b||"");var g=b("<span>").text(this.suggestions[i].s);if(this.suggestions[i].d){b("<span>").text(" "+this.suggestions[i].d).appendTo(g)}g.appendTo(d);if(this.opt.click!=false){d.attr("href","javascript:void(0);").click(function(){f.current=b(this).data("index");f.opt.click.call(f)})}else{d.attr("href",this.opt.beforeUrl+(this.suggestions[i].b||"")+this.suggestions[i].s)}d.appendTo(h)}if(h.is(":hidden")){var j=this.input.position();h.css({top:j.top+this.input.attr("offsetHeight")-1,left:j.left,width:this.input.attr("offsetWidth")-3});h.slideDown(200)}}}if((this.text=="")||(this.keyCode==27)){this.hide()}}b.fn.suggest=function(d){var e=b.extend({},b.suggest.defaults,d);return this.each(function(){var f={};f.opt=e;f.input=b(this);f.box=b("<div>").addClass("suggestions").hide().insertAfter(f.input.parent());f.current=-1;f.text="";f.suggestions=[];f.input.attr("autocomplete","off");if(e.id!=false){f.box.attr("id",e.id)}f.input.blur(function(){setTimeout(function(){f.hide.call(f)},200)});f.input.focus(function(){if(f.input.val()!=""){f.keyCode=0;c.call(f)}});f.input.keydown(function(g){f.keyCode=g.keyCode;a.call(f)});f.input.keyup(function(g){f.keyCode=g.keyCode;c.call(f)});f.hide=function(){this.box.slideUp(200)}})}})();var Extended={start:function(){Extended.fixWidth();$(window).resize(Extended.fixWidth);Extended.search=$("#wrap-search");Extended.searchInit();$(window).scroll(Extended.scroll).resize(Extended.searchInit);$("#searchrandom").qtip({content:"<span>Randomize results</span><br />Order the results in a random order.",position:{corner:{target:"topMiddle",tooltip:"bottomMiddle"}},style:{tip:true}});$("#searchrandom").change(function(){if($(this).is(":checked")){$("#searchdate").attr("checked",false)}});$("#searchdate").qtip({content:"<span>Order by date</span><br />Show the latest results first.",position:{corner:{target:"topMiddle",tooltip:"bottomMiddle"}},style:{tip:true}});$("#searchdate").change(function(){if($(this).is(":checked")){$("#searchrandom").attr("checked",false)}});$("#create").qtip({content:{title:{text:"Create a new collection",button:"Close"},text:'<form method="post" action="/?collection-create"><input type="text" name="collection" size="32" class="inputtext" /> <input type="checkbox" name="private" id="private" class="inputcheckbox" /> <input type="submit" value="Create" class="inputbutton" /></form>'},position:{target:$(document.body),corner:"center"},show:{when:"click"},hide:false,style:{padding:"14px",width:"100%"},api:{onRender:function(){var a=this;$("input:checkbox").qtip({content:"<span>Private collection</span><br />Make this a private collection.<br />A link to a private collection will never be shown. Only people who search for the exact collection can find it.",position:{corner:{target:"topMiddle",tooltip:"bottomMiddle"}},style:{tip:true}});$("form",this.elements.content).submit(function(){var c=$("input:text",this).val();var b=$("input:checkbox",this).attr("checked");$("div:first",a.elements.content).slideUp(200);$.post(this.action,{name:c,priv:b},function(e,d){if(d=="success"){if(e.substr(0,1)==1){alert(e.substr(2))}else{$("input",a.elements.content).attr("disabled","disabled");if(b){c="private:"+c}$('<br /><div><span>Collection created</span><br /><br /><img style="float: right" src="/?images/add.png&amp;v=1" alt="Add button example" />Use the button at the top right corner of a video to add it to a collection.<br /><br />You can see your collection by searching for <a href="/?'+c+'">'+c+"</a></div>").css({clear:"both",marginTop:10}).hide().appendTo(a.elements.content).slideDown(200)}}});return false})},beforeShow:function(){$("#embed").css("visibility","hidden");Extended.blanket.fadeIn(this.options.show.effect.length);var a=this;$(window).bind("keypress.pronvid",function(b){if(b.keyCode==27){a.hide()}})},onShow:function(){$("input:text",this.elements.content).focus()},onHide:function(){$(window).unbind("keypress.pronvid");Extended.blanket.fadeOut(this.options.hide.effect.length);$("#embed").css("visibility","visible")}}});Extended.blanket=$("<div>").css({position:"absolute",top:0,left:0,height:$(document).height(),width:"100%",opacity:0.7,backgroundColor:"black",zIndex:5000}).appendTo(document.body).hide()},fixWidth:function(){$("#search input:text").width($("#search").width()-195)},searchInit:function(){var a=Extended.search.width();Extended.search.css("position","absolute").width(a);$("#content").css("margin-top",Extended.search.height()+"px");Extended.searchMin=$("#wrap-header").offset().top+$("#wrap-header").height()},scroll:function(){var a=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);if(a<Extended.searchMin){a=Extended.searchMin}Extended.search.css("top",a+"px")}};$(document).ready(Extended.start);var Search={start:function(){var a=new Date();Search.dates=["today","yesterday","thisweek","lastweek",a.getDate()+"-"+(a.getMonth()+1)+"-"+(a.getFullYear()+"").substr(2)];$("#search input:text").suggest({beforeUrl:"/?q=",id:"searchsuggestions",suggest:function(){var r=this.text.toLowerCase();var h=r.length;var x=0;var m=0;var n=false;for(;m<h;++m){if(r.charAt(m)=='"'){n=!n}else{if((r.charAt(m)==" ")&&!n){x=m}}}while(r.charAt(x)==" "){++x}m=x;while((r.charAt(x)=='"')||(r.charAt(x)=="+")||(r.charAt(x)=="-")){++x}var c=r.substr(0,m);var z=r.substr(m,x-m);var y=r.substr(x);if(y.indexOf('"')!=-1){n=true}var g=(z.indexOf("-")!=-1);var v=(z.indexOf("+")!=-1);var u=(!g&&!v&&!n&&(y.indexOf("added:")==0));var w=(!g&&!v&&!n&&((y.indexOf("age<")==0)||(y.indexOf("age>")==0)||(y.indexOf("age=")==0)));var b=(!g&&!v&&!n&&((y.indexOf("breasts<")==0)||(y.indexOf("breasts>")==0)||(y.indexOf("breasts=")==0)));var q=(!n&&(y.indexOf("private:")==0));if(!n&&($.cookie("private")!=null)){if(q||($.cookie("private").indexOf(y)>=0)){if(v){this.suggestions.push({b:c,s:z+"private:"+$.cookie("private"),d:"makes collection "+$.cookie("private")+" required"})}else{this.suggestions.push({b:c,s:z+"private:"+$.cookie("private"),d:(g?"not ":"")+"matching "+$.cookie("private")})}}}if(!u&&!w&&!b){h=pv_collections.length;var t;var e=3;while(--e){for(var k=0;(k<h)&&(this.suggestions.length<10);++k){if(r.indexOf(pv_collections[k])==-1){if(((e==2)&&(pv_collections[k].indexOf(y)==0))||((e==1)&&(pv_collections[k].indexOf(y)>0))){if(n){x=z+pv_collections[k]+'"';t='exactly "'+x}else{if(g||v){x=z+'"'+pv_collections[k]+'"';t="exactly "+x}else{x=t=pv_collections[k]}}if(v){this.suggestions.push({b:c,s:x,d:"makes "+t+" required"})}else{this.suggestions.push({b:c,s:x,d:(g?"not ":"")+"matching "+t})}}}}}}if(z.length==0){m=c.length-1;p=2;while(c.charAt(m)==" "){--m}for(;m>0;--m){if((c.charAt(m)=='"')||(c.charAt(m)=="+")||(c.charAt(m)=="-")){break}else{if(c.charAt(m)==" "){this.suggestions.push({b:c.substr(0,m),s:' "'+c.substr(m+1)+y+'"'});if(--p==0){break}}}}if(m==0){this.suggestions.push({s:'"'+c+y+'"'})}}if(!g&&!v&&!n){if(u||("added:".indexOf(y)==0)){x=y.substr(6)}else{x=y}h=u?Search.dates.length:3;m=Math.max(this.suggestions.length+1,10);for(var k=0;(k<h)&&(this.suggestions.length<m);++k){if(Search.dates[k].indexOf(x)>-1){this.suggestions.push({b:c,s:"added:"+Search.dates[k],d:"match results added "+Search.dates[k]})}}}if(!g&&!v&&!n){if(w){x=y.substr(4);var e=y.substr(3,1);if(x==""){x="24"}var t="that are ";if(e=="<"){t="younger then "}else{if(e==">"){t="older then "}}this.suggestions.push({b:c,s:"age"+e+x,d:"match stars "+t+x})}else{if("age:".indexOf(y)==0){this.suggestions.push({b:c,s:"age<24",d:"match stars younger then 24"})}}}if(!g&&!v&&!n){if(b){x=y.substr(8).toUpperCase();var e=y.substr(7,1);if(x==""){x="D"}var t="";if(e=="<"){t=" or smaller"}else{if(e==">"){t=" or bigger"}}this.suggestions.push({b:c,s:"breasts"+e+x,d:"match stars with cup size "+x.toUpperCase()+t})}else{if("breasts:".indexOf(y)==0){this.suggestions.push({b:c,s:"breasts>D",d:"match stars with cup size D or bigger"})}}}if((y.length>0)&&!u&&!w&&!b&&!q){if(this.suggestions.length<10){x=y.charAt(y.length-1);if(!n&&(x!="*")&&(x!='"')){if(v){this.suggestions.push({b:c,s:y+"*",d:"makes any word starting with "+y+" required"})}else{this.suggestions.push({b:c,s:z+y+"*",d:(g?"not ":"")+"matching any word starting with "+y})}}}}}})}};$(document).ready(Search.start);