").html(content).find(current.selector)}else{if(isquery(content)){if(!content.data(placeholder)){content.data(placeholder,$('
').insertafter(content).hide())}content=content.show().detach();current.wrap.bind("onreset",function(){if($(this).find(content).length){content.hide().replaceall(content.data(placeholder)).data(placeholder,false)}})}}break;case"image":content=current.tpl.image.replace("{href}",href);break;case"swf":content='
";break}if(!(isquery(content)&&content.parent().is(current.inner))){current.inner.append(content)}f.trigger("beforeshow");current.inner.css("overflow",scrolling==="yes"?"scroll":(scrolling==="no"?"hidden":scrolling));f._setdimension();f.reposition();f.isopen=false;f.coming=null;f.bindevents();if(!f.isopened){$(".fancybox-wrap").not(current.wrap).stop(true).trigger("onreset").remove()}else{if(previous.prevmethod){f.transitions[previous.prevmethod]()}}f.transitions[f.isopened?current.nextmethod:current.openmethod]();f._preloadimages()},_setdimension:function(){var viewport=f.getviewport(),steps=0,canshrink=false,canexpand=false,wrap=f.wrap,skin=f.skin,inner=f.inner,current=f.current,width=current.width,height=current.height,minwidth=current.minwidth,minheight=current.minheight,maxwidth=current.maxwidth,maxheight=current.maxheight,scrolling=current.scrolling,scrollout=current.scrolloutside?current.scrollbarwidth:0,margin=current.margin,wmargin=getscalar(margin[1]+margin[3]),hmargin=getscalar(margin[0]+margin[2]),wpadding,hpadding,wspace,hspace,origwidth,origheight,origmaxwidth,origmaxheight,ratio,width_,height_,maxwidth_,maxheight_,iframe,body;wrap.add(skin).add(inner).width("auto").height("auto").removeclass("fancybox-tmp");wpadding=getscalar(skin.outerwidth(true)-skin.width());hpadding=getscalar(skin.outerheight(true)-skin.height());wspace=wmargin+wpadding;hspace=hmargin+hpadding;origwidth=ispercentage(width)?(viewport.w-wspace)*getscalar(width)/100:width;origheight=ispercentage(height)?(viewport.h-hspace)*getscalar(height)/100:height;if(current.type==="iframe"){iframe=current.content;if(current.autoheight&&iframe.data("ready")===1){try{if(iframe[0].contentwindow.document.location){inner.width(origwidth).height(9999);body=iframe.contents().find("body");if(scrollout){body.css("overflow-x","hidden")}origheight=body.height()}}catch(e){}}}else{if(current.autowidth||current.autoheight){inner.addclass("fancybox-tmp");if(!current.autowidth){inner.width(origwidth)}if(!current.autoheight){inner.height(origheight)}if(current.autowidth){origwidth=inner.width()}if(current.autoheight){origheight=inner.height()}inner.removeclass("fancybox-tmp")}}width=getscalar(origwidth);height=getscalar(origheight);ratio=origwidth/origheight;minwidth=getscalar(ispercentage(minwidth)?getscalar(minwidth,"w")-wspace:minwidth);maxwidth=getscalar(ispercentage(maxwidth)?getscalar(maxwidth,"w")-wspace:maxwidth);minheight=getscalar(ispercentage(minheight)?getscalar(minheight,"h")-hspace:minheight);maxheight=getscalar(ispercentage(maxheight)?getscalar(maxheight,"h")-hspace:maxheight);origmaxwidth=maxwidth;origmaxheight=maxheight;if(current.fittoview){maxwidth=math.min(viewport.w-wspace,maxwidth);maxheight=math.min(viewport.h-hspace,maxheight)}maxwidth_=viewport.w-wmargin;maxheight_=viewport.h-hmargin;if(current.aspectratio){if(width>maxwidth){width=maxwidth;height=getscalar(width/ratio)}if(height>maxheight){height=maxheight;width=getscalar(height*ratio)}if(width
maxwidth_||height_>maxheight_)&&width>minwidth&&height>minheight){if(steps++>19){break}height=math.max(minheight,math.min(maxheight,height-10));width=getscalar(height*ratio);if(widthmaxwidth){width=maxwidth;height=getscalar(width/ratio)}inner.width(width).height(height);
wrap.width(width+wpadding);width_=wrap.width();height_=wrap.height()}}else{width=math.max(minwidth,math.min(width,width-(width_-maxwidth_)));height=math.max(minheight,math.min(height,height-(height_-maxheight_)))}}if(scrollout&&scrolling==="auto"&&heightmaxwidth_||height_>maxheight_)&&width>minwidth&&height>minheight;canexpand=current.aspectratio?(widthminheight&&height1)){f.inner.css("cursor","pointer").bind("click.fb",function(e){if(!$(e.target).is("a")&&!$(e.target).parent().is("a")){e.preventdefault();f[current.closeclick?"close":"next"]()}})}if(current.closebtn){$(current.tpl.closebtn).appendto(f.skin).bind(istouch?"touchstart.fb":"click.fb",function(e){e.preventdefault();f.close()})}if(current.arrows&&f.group.length>1){if(current.loop||current.index>0){$(current.tpl.prev).appendto(f.outer).bind("click.fb",f.prev)}if(current.loop||current.index ').appendto("body");this.fixed=false;if(opts.fixed&&f.defaults.fixed){this.overlay.addclass("fancybox-overlay-fixed");this.fixed=true}},open:function(opts){var that=this;opts=$.extend({},this.defaults,opts);if(this.overlay){this.overlay.unbind(".overlay").width("auto").height("auto")}else{this.create(opts)}if(!this.fixed){w.bind("resize.overlay",$.proxy(this.update,this));this.update()}if(opts.closeclick){this.overlay.bind("click.overlay",function(e){if($(e.target).hasclass("fancybox-overlay")){if(f.isactive){f.close()}else{that.close()}}})}this.overlay.css(opts.css).show()},close:function(){$(".fancybox-overlay").remove();w.unbind("resize.overlay");this.overlay=null;if(this.margin!==false){$("body").css("margin-right",this.margin);this.margin=false}if(this.el){this.el.removeclass("fancybox-lock")}},update:function(){var width="100%",offsetwidth;this.overlay.width(width).height("100%");if($.browser.msie){offsetwidth=math.max(document.documentelement.offsetwidth,document.body.offsetwidth);if(d.width()>offsetwidth){width=d.width()}}else{if(d.width()>w.width()){width=d.width()}}this.overlay.width(width).height(d.height())},onready:function(opts,obj){$(".fancybox-overlay").stop(true,true);if(!this.overlay){this.margin=d.height()>w.height()||$("body").css("overflow-y")==="scroll"?$("body").css("margin-right"):false;this.el=document.all&&!document.queryselector?$("html"):$("body");this.create(opts)}if(opts.locked&&this.fixed){obj.locked=this.overlay.append(obj.wrap);obj.fixed=false}if(opts.showearly===true){this.beforeshow.apply(this,arguments)}},beforeshow:function(opts,obj){if(obj.locked){this.el.addclass("fancybox-lock");if(this.margin!==false){$("body").css("margin-right","0")}}this.open(opts)},onupdate:function(){if(!this.fixed){this.update()}},afterclose:function(opts){if(this.overlay&&!f.isactive){this.overlay.fadeout(opts.speedout,$.proxy(this.close,this))}}};f.helpers.title={defaults:{type:"float",position:"bottom"},beforeshow:function(opts){var current=f.current,text=current.title,type=opts.type,title,target;if($.isfunction(text)){text=text.call(current.element,current)}if(!isstring(text)||$.trim(text)===""){return}title=$('