/* jquery.poptrox.js v2.4 | (c) n33 | n33.co | MIT licensed */ (function(e){var t="height",n="width",r="trigger",i="css",s="stopPropagation",o="position",u=!1,a="poptrox_close",f="fadeSpeed",l="length",c="text-align",h="popupNavPreviousSelector",p="poptrox_switch",d="stopSpinning",v="click",m="popupNavNextSelector",g="popupHeight",y="popupCaptionSelector",b=!0,w="popupCloserSelector",E="popupLoaderSelector",S=null,x="none",T="font-size",N="poptrox_previous",C="popupCaptionHeight",k="preventDefault",L="cursor",A="center",O="line-height",M="poptrox_reset",_="overflow",D="poptrox_next",P="popupTextColor",H="text-indent",B="fadeIn",j="pointer",F="object",I="poptrox_disableSelection",q="auto",R="color",U="absolute",z="load",W="#000000",X="px",V="usePopupNav",$="100%",J="relative",K="",Q="0",G="popupWidth",Y='
1){for(_t=0;_t
'),jt=e(window),qt=[],Rt=0,Ut=u,zt=new Array,Dt.usePopupLoader||(Dt[E]=S),Dt.usePopupCloser||(Dt[w]=S),Dt.usePopupCaption||(Dt[y]=S),Dt[V]||(Dt[h]=S,Dt[m]=S),Dt[ht]?Wt=e(Dt[ht]):Wt=e(Y+Dt.popupClass+'">'+(Dt[E]?'
'+Dt[ot]+K:"")+'
'+(Dt[y]?'
':"")+(Dt[w]?''+Dt[at]+"":"")+(Dt[h]?'':"")+(Dt[m]?'':"")+K),Xt=Wt.find(".pic"),Vt=e(),$t=Wt.find(Dt[E]),Jt=Wt.find(Dt[y]),Kt=Wt.find(Dt[w]),Qt=Wt.find(Dt[m]),Gt=Wt.find(Dt[h]),Yt=Qt.add(Gt),Dt.usePopupDefaultStyling&&(Wt[i](tt,Dt.popupBackgroundColor)[i](R,Dt[P])[i]("padding",Dt.popupPadding+X),Jt[l]>0&&(Wt[i]("padding-bottom",Dt[C]+X),Jt[i](o,U)[i](rt,Q)[i]("bottom",Q)[i](n,$)[i](c,A)[i](t,Dt[C]+X)[i](O,Dt[C]+X),Dt.popupCaptionTextSize&&Jt[i](T,popupCaptionTextSize)),Kt[l]>0&&Kt.html(Dt[at])[i](T,Dt.popupCloserTextSize)[i](tt,Dt.popupCloserBackgroundColor)[i](R,Dt.popupCloserTextColor)[i](vt,"block")[i](n,st)[i](t,st)[i](O,st)[i](c,A)[i](o,U)[i]("text-decoration",x)[i](et,Q)[i]("top",Q)[i]("right","-40px"),$t[l]>0&&$t.html("")[i](o,J)[i](T,Dt.popupLoaderTextSize).on(nt,function(){var n=e("
"+Dt[ot]+K);n[i](t,Math.floor(Dt[g]/2)+X)[i](_,"hidden")[i](O,Math.floor(Dt[g]/2)+X)[i](c,A)[i]("margin-top",Math.floor((Wt[t]()-n[t]()+(Jt[l]>0?Jt[t]():0))/2))[i](R,Dt[P]?Dt[P]:"").on(wt,function(){n.fadeTo(300,.5,function(){n[r]("xfout")})}).on("xfout",function(){n.fadeTo(300,.05,function(){n[r](wt)})})[r](wt),$t.append(n)}).on(d,function(){var e=$t.find("div");e.remove()}),Yt[l]==2&&(Yt[i](T,"75px")[i](c,A)[i](R,"#fff")[i]("text-shadow",x)[i](t,$)[i](o,U)[i]("top",Q)[i]("opacity","0.35")[i](L,j)[i]("box-shadow","inset 0px 0px 10px 0px rgba(0,0,0,0)")[I](),Dt[ct]?(Zt="100px",en="100px"):(Zt="75%",en="25%"),Qt[i]("right",Q)[i](n,Zt).html('
>
'),Gt[i](rt,Q)[i](n,en).html('
<
'))),jt.on("resize orientationchange",function(){tn()}),Jt.on(ft,function(e,t){if(!t||t[l]==0)t=Dt.popupBlankCaptionText;Jt.html(t)}),Kt[i](L,j).on(v,function(e){return e[k](),e[s](),Wt[r](a),b}),Qt.on(v,function(){Wt[r](D)}),Gt.on(v,function(){Wt[r](N)}),Bt[i](o,"fixed")[i](rt,0)[i]("top",0)[i](Z,Dt.baseZIndex)[i](n,$)[i](t,$)[i](c,A)[i](L,j).appendTo(Dt.parent).prepend('
').append('
')[gt]().on("touchmove",function(){return u}).on(v,function(e){e[k](),e[s](),Wt[r](a)}),Dt[ct]&&Xt[i](L,j).on(v,function(e){e[k](),e[s](),Wt[r](a)}),Wt[i](vt,"inline-block")[i]("vertical-align","middle")[i](o,J)[i](Z,1).appendTo(Bt)[gt]().on(D,function(){var e=Rt+1;e>=qt[l]&&(e=0),Wt[r](p,[e])}).on(N,function(){var e=Rt-1;e<0&&(e=qt[l]-1),Wt[r](p,[e])}).on(M,function(){tn(),Wt.data(n,Dt[G]).data(t,Dt[g]),$t[gt]()[r](d),Jt[gt](),Kt[gt](),Yt[gt](),Xt[gt](),Vt.detach()}).on(it,function(e,t){if(Ut)return b;Ut=b,Dt[yt]&&Ht[i](_,"hidden"),Dt.onPopupOpen&&Dt.onPopupOpen(),Bt.fadeTo(Dt[f],1,function(){Wt[r](p,[t,b])})}).on(p,function(s,a,l){var c;if(!l&&Ut)return b;Ut=b,Wt[i](n,Wt.data(n))[i](t,Wt.data(t)),Jt[gt](),Vt.attr("src")&&Vt.attr("src",""),Vt.detach(),c=qt[a],Vt=c[F],Vt.off(z),Xt[i](H,"-9999px").show().append(Vt),c[Et]=="ajax"?e.get(c.src,function(e){Vt.html(e),Vt[r](z)}):Vt.attr("src",c.src),c[Et]!=mt&&Vt[i](o,J)[i](et,Q)[i](Z,Dt.baseZIndex+100)[n](c[n])[t](c[t]),$t[r](nt)[B](300),Wt.show(),Dt.popupIsFixed?(Wt[n](Dt[G])[t](Dt[g]),Vt[z](function(){Vt.off(z),$t[gt]()[r](d),Jt[r](ft,[c.captionText])[B](Dt[f]),Kt[B](Dt[f]),Xt[i](H,0)[gt]()[B](Dt[f],function(){Ut=u}),Rt=a,Yt[B](Dt[f])})):Vt[z](function(){var e,s,o;tn(),Vt.off(z),$t[gt]()[r](d),e=Vt[n](),s=Vt[t](),o=function(){Jt[r](ft,[c.captionText])[B](Dt[f]),Kt[B](Dt[f]),Xt[i](H,0)[gt]()[B](Dt[f],function(){Ut=u}),Rt=a,Yt[B](Dt[f]),Wt.data(n,e).data(t,s)[i](n,q)[i](t,q)},e==Wt.data(n)&&s==Wt.data(t)?o():Wt.animate({width:e,height:s},Dt.popupSpeed,"swing",o)}),c[Et]!=mt&&Vt[r](z)}).on(a,function(){if(Ut)return b;Ut=b,Wt[gt]()[r](M),Dt.onPopupClose&&Dt.onPopupClose(),Bt.fadeOut(Dt[f],function(){Dt[yt]&&Ht[i](_,q),Ut=u})})[r](M),jt.keydown(function(e){if(Wt.is(":visible"))switch(e.keyCode){case 37:case 32:if(Dt[V])return Wt[r](N),u;break;case 39:if(Dt[V])return Wt[r](D),u;break;case 27:return Wt[r](a),u}}),Pt.find(Dt.selector).each(function(o){var a,f,c,h=e(this),p=h.find("img"),d=h.data(ut),m={src:h.attr("href"),captionText:p.attr("title"),width:h.attr(n),height:h.attr(t),type:S,object:S};if(d){c=d.split(",");for(f in c)a=c[f].match(/([0-9]+)x([0-9]+)/),a&&a[l]==3?(m[n]=a[1],m[t]=a[2]):m[Et]=c[f]}if(!m[Et]){a=m.src.match(/http[s]?:\/\/([a-z0-9\.]+)\/.*/);if(!a||a[l]<3)a=[u];switch(a[1]){case"api.soundcloud.com":m[Et]=pt;break;case"youtu.be":m[Et]=St;break;case"vimeo.com":m[Et]="vimeo";break;default:m[Et]=mt}}a=m.src.match(/http([s]?):\/\/[a-z0-9\.]+\/(.*)/),a&&(m.prefix="http"+(a[1]=="s"?"s":""));switch(m[Et]){case lt:break;case"iframe":m[F]=e(''),m[F].on(v,function(e){e[s]()})[i](L,q);break;case"ajax":m[F]=e('
'),m[F].on(v,function(e){e[s]()})[i](L,q)[i](_,q);break;case pt:m[F]=e(''),m.src=m.prefix+"://w.soundcloud.com/player/?url="+escape(m.src),m[n]="600",m[t]="166";break;case St:m[F]=e(''),m.src=m.prefix+"://www.youtube.com/embed/"+a[2];break;case"vimeo":m[F]=e(''),m.src=m.prefix+"://player.vimeo.com/video/"+a[2];break;default:m[F]=e(''),Dt.preload&&(a=document.createElement("img"),a.src=m.src,zt.push(a))}m[Et]!=lt&&qt.push(m),p.attr("title",""),m[Et]!=lt&&h.attr("href","")[i](et,0).on(v,function(e){e[k](),e[s](),Wt[r](it,[o])})}),e(this)}})(jQuery);