!function(t){var e,i,n,a,o,d,r,c,s,h,l,f,p,g=0,u={},y=[],b=0,w={},m=[],v=null,x=new Image,I=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,C=/[^\.]\.(swf)\s*$/i,k=1,O=0,j="",T=!1,A=t.extend(t("<div/>")[0],{prop:0}),S=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,D=function(){i.hide(),x.onerror=x.onload=null,v&&v.abort(),e.empty()},F=function(){return!1===u.onError(y,g,u)?(i.hide(),void(T=!1)):(u.titleShow=!1,u.width="auto",u.height="auto",e.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'),void N())},E=function(){var n,a,o,d,r,c,s=y[g];if(D(),u=t.extend({},t.fn.fancybox.defaults,"undefined"==typeof t(s).data("fancybox")?u:t(s).data("fancybox")),c=u.onStart(y,g,u),c===!1)return void(T=!1);if("object"==typeof c&&(u=t.extend(u,c)),o=u.title||(s.nodeName?t(s).attr("title"):s.title)||"",s.nodeName&&!u.orig&&(u.orig=t(s).children("img:first").length?t(s).children("img:first"):t(s)),""===o&&u.orig&&u.titleFromAlt&&(o=u.orig.attr("alt")),n=u.href||(s.nodeName?t(s).attr("href"):s.href)||null,(/^(?:javascript)/i.test(n)||"#"==n)&&(n=null),u.type?(a=u.type,n||(n=u.content)):u.content?a="html":n&&(a=n.match(I)?"image":n.match(C)?"swf":t(s).hasClass("iframe")?"iframe":0===n.indexOf("#")?"inline":"ajax"),!a)return void F();switch("inline"==a&&(s=n.substr(n.indexOf("#"))),u.type=a,u.href=n,u.title=o,u.autoDimensions&&("html"==u.type||"inline"==u.type||"ajax"==u.type?(u.width="auto",u.height="auto"):u.autoDimensions=!1),u.modal&&(u.overlayShow=!0,u.hideOnOverlayClick=!1,u.hideOnContentClick=!1,u.enableEscapeButton=!1,u.showCloseButton=!1),u.padding=parseInt(u.padding,10),u.margin=parseInt(u.margin,10),e.css("padding",u.padding+u.margin),a){case"html":e.html(u.content),N();break;case"inline":if(t(s).parent().is("#fancybox-content")===!0)return void(T=!1);t(s).clone().appendTo(e),N();break;case"image":T=!1,t.fancybox.showActivity(),x=new Image,x.onerror=function(){F()},x.onload=function(){T=!0,x.onerror=x.onload=null,P()},x.src=n;break;case"swf":u.scrolling="no",d='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+u.width+'" height="'+u.height+'"><param name="movie" value="'+n+'"></param>',r="",t.each(u.swf,function(t,e){d+='<param name="'+t+'" value="'+e+'"></param>',r+=" "+t+'="'+e+'"'}),d+='<embed src="'+n+'" type="application/x-shockwave-flash" width="'+u.width+'" height="'+u.height+'"'+r+"></embed></object>",e.html(d),N();break;case"ajax":T=!1,t.fancybox.showActivity(),u.ajax.win=u.ajax.success,v=t.ajax(t.extend({},u.ajax,{url:n,data:u.ajax.data||{},error:function(t){t.status>0&&F()},success:function(t,a,o){var d="object"==typeof o?o:v;if(200==d.status){if("function"==typeof u.ajax.win){if(c=u.ajax.win(n,t,a,o),c===!1)return void i.hide();("string"==typeof c||"object"==typeof c)&&(t=c)}e.html(t),N()}}}));break;case"iframe":B()}},N=function(){var i=u.width,n=u.height;i=i.toString().indexOf("%")>-1?parseInt((t(window).width()-2*u.margin)*parseFloat(i)/100,10)+"px":"auto"==i?"auto":i+"px",n=n.toString().indexOf("%")>-1?parseInt((t(window).height()-2*u.margin)*parseFloat(n)/100,10)+"px":"auto"==n?"auto":n+"px",e.wrapInner('<div style="width:'+i+";height:"+n+";overflow: "+("auto"==u.scrolling?"auto":"yes"==u.scrolling?"scroll":"hidden")+';position:relative;"></div>'),u.width=e.width(),u.height=e.height(),B()},P=function(){u.width=x.width,u.height=x.height,t("<img />").attr({id:"fancybox-img",src:x.src,alt:u.title}).appendTo(e),B()},B=function(){var o,l;return i.hide(),a.is(":visible")&&!1===w.onCleanup(m,b,w)?(t.event.trigger("fancybox-cancel"),void(T=!1)):(T=!0,t(d.add(n)).unbind(),t(window).unbind("resize.fb scroll.fb"),t(document).unbind("keydown.fb"),a.is(":visible")&&"outside"!==w.titlePosition&&a.css("height",a.height()),m=y,b=g,w=u,w.overlayShow?(n.css({"background-color":w.overlayColor,opacity:w.overlayOpacity,cursor:w.hideOnOverlayClick?"pointer":"auto",height:t(document).height()}),n.is(":visible")||(S&&t("select:not(#fancybox-tmp select)").filter(function(){return"hidden"!==this.style.visibility}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"}),n.show())):n.hide(),p=Q(),M(),a.is(":visible")?(t(r.add(s).add(h)).hide(),o=a.position(),f={top:o.top,left:o.left,width:a.width(),height:a.height()},l=f.width==p.width&&f.height==p.height,void d.fadeTo(w.changeFade,.3,function(){var i=function(){d.html(e.contents()).fadeTo(w.changeFade,1,H)};t.event.trigger("fancybox-change"),d.empty().removeAttr("filter").css({"border-width":w.padding,width:p.width-2*w.padding,height:u.autoDimensions?"auto":p.height-O-2*w.padding}),l?i():(A.prop=0,t(A).animate({prop:1},{duration:w.changeSpeed,easing:w.easingChange,step:K,complete:i}))})):(a.removeAttr("style"),d.css("border-width",w.padding),"elastic"==w.transitionIn?(f=$(),d.html(e.contents()),a.show(),w.opacity&&(p.opacity=0),A.prop=0,void t(A).animate({prop:1},{duration:w.speedIn,easing:w.easingIn,step:K,complete:H})):("inside"==w.titlePosition&&O>0&&c.show(),d.css({width:p.width-2*w.padding,height:u.autoDimensions?"auto":p.height-O-2*w.padding}).html(e.contents()),void a.css(p).fadeIn("none"==w.transitionIn?0:w.speedIn,H))))},L=function(t){return t&&t.length?"float"==w.titlePosition?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+t+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+w.titlePosition+'">'+t+"</div>":!1},M=function(){if(j=w.title||"",O=0,c.empty().removeAttr("style").removeClass(),w.titleShow===!1)return void c.hide();if(j=t.isFunction(w.titleFormat)?w.titleFormat(j,m,b,w):L(j),!j||""===j)return void c.hide();switch(c.addClass("fancybox-title-"+w.titlePosition).html(j).appendTo("body").show(),w.titlePosition){case"inside":c.css({width:p.width-2*w.padding,marginLeft:w.padding,marginRight:w.padding}),O=c.outerHeight(!0),c.appendTo(o),p.height+=O;break;case"over":c.css({marginLeft:w.padding,width:p.width-2*w.padding,bottom:w.padding}).appendTo(o);break;case"float":c.css("left",-1*parseInt((c.width()-p.width-40)/2,10)).appendTo(a);break;default:c.css({width:p.width-2*w.padding,paddingLeft:w.padding,paddingRight:w.padding}).appendTo(a)}c.hide()},z=function(){return(w.enableEscapeButton||w.enableKeyboardNav)&&t(document).bind("keydown.fb",function(e){27==e.keyCode&&w.enableEscapeButton?(e.preventDefault(),t.fancybox.close()):37!=e.keyCode&&39!=e.keyCode||!w.enableKeyboardNav||"INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||"SELECT"===e.target.tagName||(e.preventDefault(),t.fancybox[37==e.keyCode?"prev":"next"]())}),w.showNavArrows?((w.cyclic&&m.length>1||0!==b)&&s.show(),void((w.cyclic&&m.length>1||b!=m.length-1)&&h.show())):(s.hide(),void h.hide())},H=function(){t.support.opacity||(d.get(0).removeAttribute("filter"),a.get(0).removeAttribute("filter")),u.autoDimensions&&d.css("height","auto"),a.css("height","auto"),j&&j.length&&c.show(),w.showCloseButton&&r.show(),z(),w.hideOnContentClick&&d.bind("click",t.fancybox.close),w.hideOnOverlayClick&&n.bind("click",t.fancybox.close),t(window).bind("resize.fb",t.fancybox.resize),w.centerOnScroll&&t(window).bind("scroll.fb",t.fancybox.center),"iframe"==w.type&&t('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(navigator.userAgent.match(/msie [6]/i)?'allowtransparency="true""':"")+' scrolling="'+u.scrolling+'" src="'+w.href+'"></iframe>').appendTo(d),a.show(),T=!1,t.fancybox.center(),w.onComplete(m,b,w),R()},R=function(){var t,e;m.length-1>b&&(t=m[b+1].href,"undefined"!=typeof t&&t.match(I)&&(e=new Image,e.src=t)),b>0&&(t=m[b-1].href,"undefined"!=typeof t&&t.match(I)&&(e=new Image,e.src=t))},K=function(t){var e={width:parseInt(f.width+(p.width-f.width)*t,10),height:parseInt(f.height+(p.height-f.height)*t,10),top:parseInt(f.top+(p.top-f.top)*t,10),left:parseInt(f.left+(p.left-f.left)*t,10)};"undefined"!=typeof p.opacity&&(e.opacity=.5>t?.5:t),a.css(e),d.css({width:e.width-2*w.padding,height:e.height-O*t-2*w.padding})},q=function(){return[t(window).width()-2*w.margin,t(window).height()-2*w.margin,t(document).scrollLeft()+w.margin,t(document).scrollTop()+w.margin]},Q=function(){var t,e=q(),i={},n=w.autoScale,a=2*w.padding;return i.width=w.width.toString().indexOf("%")>-1?parseInt(e[0]*parseFloat(w.width)/100,10):w.width+a,i.height=w.height.toString().indexOf("%")>-1?parseInt(e[1]*parseFloat(w.height)/100,10):w.height+a,n&&(i.width>e[0]||i.height>e[1])&&("image"==u.type||"swf"==u.type?(t=w.width/w.height,i.width>e[0]&&(i.width=e[0],i.height=parseInt((i.width-a)/t+a,10)),i.height>e[1]&&(i.height=e[1],i.width=parseInt((i.height-a)*t+a,10))):(i.width=Math.min(i.width,e[0]),i.height=Math.min(i.height,e[1]))),i.top=parseInt(Math.max(e[3]-20,e[3]+.5*(e[1]-i.height-40)),10),i.left=parseInt(Math.max(e[2]-20,e[2]+.5*(e[0]-i.width-40)),10),i},X=function(t){var e=t.offset();return e.top+=parseInt(t.css("paddingTop"),10)||0,e.left+=parseInt(t.css("paddingLeft"),10)||0,e.top+=parseInt(t.css("border-top-width"),10)||0,e.left+=parseInt(t.css("border-left-width"),10)||0,e.width=t.width(),e.height=t.height(),e},$=function(){var e,i,n=u.orig?t(u.orig):!1,a={};return n&&n.length?(e=X(n),a={width:e.width+2*w.padding,height:e.height+2*w.padding,top:e.top-w.padding-20,left:e.left-w.padding-20}):(i=q(),a={width:2*w.padding,height:2*w.padding,top:parseInt(i[3]+.5*i[1],10),left:parseInt(i[2]+.5*i[0],10)}),a},U=function(){return i.is(":visible")?(t("div",i).css("top",-40*k+"px"),void(k=(k+1)%12)):void clearInterval(l)};t.fn.fancybox=function(e){return t(this).length?(t(this).data("fancybox",t.extend({},e,t.metadata?t(this).metadata():{})).unbind("click.fb").bind("click.fb",function(e){if(e.preventDefault(),!T){T=!0,t(this).blur(),y=[],g=0;var i=t(this).attr("rel")||"";i&&""!=i&&"nofollow"!==i?(y=t("a[rel="+i+"], area[rel="+i+"], img[rel="+i+"]"),g=y.index(this)):y.push(this),E()}}),this):this},t.fancybox=function(e){var i;if(!T){if(T=!0,i="undefined"!=typeof arguments[1]?arguments[1]:{},y=[],g=parseInt(i.index,10)||0,t.isArray(e)){for(var n=0,a=e.length;a>n;n++)"object"==typeof e[n]?t(e[n]).data("fancybox",t.extend({},i,e[n])):e[n]=t({}).data("fancybox",t.extend({content:e[n]},i));y=jQuery.merge(y,e)}else"object"==typeof e?t(e).data("fancybox",t.extend({},i,e)):e=t({}).data("fancybox",t.extend({content:e},i)),y.push(e);(g>y.length||0>g)&&(g=0),E()}},t.fancybox.showActivity=function(){clearInterval(l),i.show(),l=setInterval(U,66)},t.fancybox.hideActivity=function(){i.hide()},t.fancybox.next=function(){return t.fancybox.pos(b+1)},t.fancybox.prev=function(){return t.fancybox.pos(b-1)},t.fancybox.pos=function(t){T||(t=parseInt(t),y=m,t>-1&&t<m.length?(g=t,E()):w.cyclic&&m.length>1&&(g=t>=m.length?0:m.length-1,E()))},t.fancybox.cancel=function(){T||(T=!0,t.event.trigger("fancybox-cancel"),D(),u.onCancel(y,g,u),T=!1)},t.fancybox.close=function(){function e(){n.fadeOut("fast"),c.empty().hide(),a.hide(),t.event.trigger("fancybox-cleanup"),d.empty(),w.onClosed(m,b,w),m=u=[],b=g=0,w=u={},T=!1}if(!T&&!a.is(":hidden")){if(T=!0,w&&!1===w.onCleanup(m,b,w))return void(T=!1);if(D(),t(r.add(s).add(h)).hide(),t(d.add(n)).unbind(),t(window).unbind("resize.fb scroll.fb"),t(document).unbind("keydown.fb"),d.find("iframe").attr("src",S&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank"),"inside"!==w.titlePosition&&c.empty(),a.stop(),"elastic"==w.transitionOut){f=$();var i=a.position();p={top:i.top,left:i.left,width:a.width(),height:a.height()},w.opacity&&(p.opacity=1),c.empty().hide(),A.prop=1,t(A).animate({prop:0},{duration:w.speedOut,easing:w.easingOut,step:K,complete:e})}else a.fadeOut("none"==w.transitionOut?0:w.speedOut,e)}},t.fancybox.resize=function(){n.is(":visible")&&n.css("height",t(document).height()),t.fancybox.center(!0)},t.fancybox.center=function(){var t,e;T||(e=arguments[0]===!0?1:0,t=q(),(e||!(a.width()>t[0]||a.height()>t[1]))&&a.stop().animate({top:parseInt(Math.max(t[3]-20,t[3]+.5*(t[1]-d.height()-40)-w.padding)),left:parseInt(Math.max(t[2]-20,t[2]+.5*(t[0]-d.width()-40)-w.padding))},"number"==typeof arguments[0]?arguments[0]:200))},t.fancybox.init=function(){t("#fancybox-wrap").length||(t("body").append(e=t('<div id="fancybox-tmp"></div>'),i=t('<div id="fancybox-loading"><div></div></div>'),n=t('<div id="fancybox-overlay"></div>'),a=t('<div id="fancybox-wrap"></div>')),o=t('<div id="fancybox-outer"></div>').appendTo(a),o.append(d=t('<div id="fancybox-content"></div>'),r=t('<a id="fancybox-close"></a>'),c=t('<div id="fancybox-title"></div>'),s=t('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),h=t('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')),r.click(t.fancybox.close),i.click(t.fancybox.cancel),s.click(function(e){e.preventDefault(),t.fancybox.prev()}),h.click(function(e){e.preventDefault(),t.fancybox.next()}),t.fn.mousewheel&&a.bind("mousewheel.fb",function(e,i){T?e.preventDefault():(0==t(e.target).get(0).clientHeight||t(e.target).get(0).scrollHeight===t(e.target).get(0).clientHeight)&&(e.preventDefault(),t.fancybox[i>0?"prev":"next"]())}),t.support.opacity||a.addClass("fancybox-ie"),S&&(i.addClass("fancybox-ie6"),a.addClass("fancybox-ie6"),t('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(o)))},t.fn.fancybox.defaults={padding:10,margin:40,opacity:!1,modal:!1,cyclic:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,centerOnScroll:!1,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayOpacity:.7,overlayColor:"#777",titleShow:!0,titlePosition:"float",titleFormat:null,titleFromAlt:!1,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:!0,showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}},t(document).ready(function(){t.fancybox.init()})}(jQuery);