").html(e).find(r.selector):p(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",n('
').insertAfter(e).hide()),e=e.show().detach(),r.wrap.bind("onReset",function(){n(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":e=r.tpl.image.replace(/\{href\}/g,o);break;case"swf":e='
"}p(e)&&e.parent().is(r.inner)||r.inner.append(e),l.trigger("beforeShow"),r.inner.css("overflow","yes"===i?"scroll":"no"===i?"hidden":i),l._setDimension(),l.reposition(),l.isOpen=!1,l.coming=null,l.bindEvents(),l.isOpened?s.prevMethod&&l.transitions[s.prevMethod]():n(".fancybox-wrap").not(r.wrap).stop(!0).trigger("onReset").remove(),l.transitions[l.isOpened?r.nextMethod:r.openMethod](),l._preloadImages()}},_setDimension:function(){var e,t,i,o,a,r,s,c,d,p=l.getViewport(),h=0,m=!1,y=!1,m=l.wrap,x=l.skin,v=l.inner,w=l.current,y=w.width,b=w.height,k=w.minWidth,C=w.minHeight,O=w.maxWidth,W=w.maxHeight,_=w.scrolling,S=w.scrollOutside?w.scrollbarWidth:0,T=w.margin,E=u(T[1]+T[3]),L=u(T[0]+T[2]);if(m.add(x).add(v).width("auto").height("auto").removeClass("fancybox-tmp"),T=u(x.outerWidth(!0)-x.width()),e=u(x.outerHeight(!0)-x.height()),t=E+T,i=L+e,o=f(y)?(p.w-t)*u(y)/100:y,a=f(b)?(p.h-i)*u(b)/100:b,"iframe"===w.type){if(d=w.content,w.autoHeight&&1===d.data("ready"))try{d[0].contentWindow.document.location&&(v.width(o).height(9999),r=d.contents().find("body"),S&&r.css("overflow-x","hidden"),a=r.outerHeight(!0))}catch(H){}}else(w.autoWidth||w.autoHeight)&&(v.addClass("fancybox-tmp"),w.autoWidth||v.width(o),w.autoHeight||v.height(a),w.autoWidth&&(o=v.width()),w.autoHeight&&(a=v.height()),v.removeClass("fancybox-tmp"));if(y=u(o),b=u(a),c=o/a,k=u(f(k)?u(k,"w")-t:k),O=u(f(O)?u(O,"w")-t:O),C=u(f(C)?u(C,"h")-i:C),W=u(f(W)?u(W,"h")-i:W),r=O,s=W,w.fitToView&&(O=Math.min(p.w-t,O),W=Math.min(p.h-i,W)),t=p.w-E,L=p.h-L,w.aspectRatio?(y>O&&(y=O,b=u(y/c)),b>W&&(b=W,y=u(b*c)),k>y&&(y=k,b=u(y/c)),C>b&&(b=C,y=u(b*c))):(y=Math.max(k,Math.min(y,O)),w.autoHeight&&"iframe"!==w.type&&(v.width(y),b=v.height()),b=Math.max(C,Math.min(b,W))),w.fitToView)if(v.width(y).height(b),m.width(y+T),p=m.width(),E=m.height(),w.aspectRatio)for(;(p>t||E>L)&&y>k&&b>C&&!(19
y&&(y=k,b=u(y/c)),y>O&&(y=O,b=u(y/c)),v.width(y).height(b),m.width(y+T),p=m.width(),E=m.height();else y=Math.max(k,Math.min(y,y-(p-t))),b=Math.max(C,Math.min(b,b-(E-L)));S&&"auto"===_&&a>b&&t>y+T+S&&(y+=S),v.width(y).height(b),m.width(y+T),p=m.width(),E=m.height(),m=(p>t||E>L)&&y>k&&b>C,y=w.aspectRatio?r>y&&s>b&&o>y&&a>b:(r>y||s>b)&&(o>y||a>b),n.extend(w,{dim:{width:g(p),height:g(E)},origWidth:o,origHeight:a,canShrink:m,canExpand:y,wPadding:T,hPadding:e,wrapSpace:E-x.outerHeight(!0),skinSpace:x.height()-b}),!d&&w.autoHeight&&b>C&&W>b&&!y&&v.height("auto")},_getPosition:function(e){var t=l.current,n=l.getViewport(),i=t.margin,o=l.wrap.width()+i[1]+i[3],a=l.wrap.height()+i[0]+i[2],i={position:"absolute",top:i[0],left:i[3]};return t.autoCenter&&t.fixed&&!e&&a<=n.h&&o<=n.w?i.position="fixed":t.locked||(i.top+=n.y,i.left+=n.x),i.top=g(Math.max(i.top,i.top+(n.h-a)*t.topRatio)),i.left=g(Math.max(i.left,i.left+(n.w-o)*t.leftRatio)),i},_afterZoomIn:function(){var e=l.current;e&&(l.isOpen=l.isOpened=!0,l.wrap.css("overflow","visible").addClass("fancybox-opened"),l.update(),(e.closeClick||e.nextClick&&1 ').appendTo(t&&t.lenth?t:"body"),this.fixed=!1,e.fixed&&l.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=n.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(a.bind("resize.overlay",n.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",function(e){return n(e.target).hasClass("fancybox-overlay")?(l.isActive?l.close():t.close(),!1):void 0}),this.overlay.css(e.css).show()},close:function(){a.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(n(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),n(".fancybox-overlay").remove().hide(),n.extend(this,{overlay:null,fixed:!1})},update:function(){var e,n="100%";this.overlay.width(n).height("100%"),s?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),r.width()>e&&(n=r.width())):r.width()>a.width()&&(n=r.width()),this.overlay.width(n).height(r.height())},onReady:function(e,t){var i=this.overlay;n(".fancybox-overlay").stop(!0,!0),i||this.create(e),e.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&n("*").filter(function(){return"fixed"===n(this).css("position")&&!n(this).hasClass("fancybox-overlay")&&!n(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=a.scrollTop(),this.scrollH=a.scrollLeft(),this.el.addClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!l.coming&&this.overlay.fadeOut(e.speedOut,n.proxy(this.close,this))}},l.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t=l.current,i=t.title,o=e.type;if(n.isFunction(i)&&(i=i.call(t.element,t)),h(i)&&""!==n.trim(i)){switch(t=n('