/* * FancyBox - jQuery Plugin * Simple and fancy lightbox alternative * * Examples and documentation at: http://fancybox.net * * Copyright (c) 2008 - 2010 Janis Skarnelis * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. * * Version: 1.3.4 (11/11/2010) * Requires: jQuery v1.3+ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function(a){var n,t,u,e,B,m,C,h,y,z,r=0,d={},p=[],q=0,c={},k=[],E=null,v=new Image,G=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,R=/[^\.]\.(swf)\s*$/i,H,I=1,x=0,w="",s,g,l=!1,A=a.extend(a("
")[0],{prop:0}),J=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,K=function(){t.hide();v.onerror=v.onload=null;E&&E.abort();n.empty()},L=function(){!1===d.onError(p,r,d)?(t.hide(),l=!1):(d.titleShow=!1,d.width="auto",d.height="auto",n.html('The requested content cannot be loaded.
Please try again later.
| '+ w+' |
b?0.5:b);e.css(a);m.css({width:a.width-2*c.padding,height:a.height-x*b- 2*c.padding})},P=function(){return[a(window).width()-2*c.margin,a(window).height()-2*c.margin,a(document).scrollLeft()+c.margin,a(document).scrollTop()+c.margin]},S=function(){var b=P(),a={},e=c.autoScale,g=2*c.padding;-1b[0]||a.height>b[1])&&("image"==d.type||"swf"==d.type?(e=c.width/ c.height,a.width>b[0]&&(a.width=b[0],a.height=parseInt((a.width-g)/e+g,10)),a.height>b[1]&&(a.height=b[1],a.width=parseInt((a.height-g)*e+g,10))):(a.width=Math.min(a.width,b[0]),a.height=Math.min(a.height,b[1])));a.top=parseInt(Math.max(b[3]-20,b[3]+0.5*(b[1]-a.height-40)),10);a.left=parseInt(Math.max(b[2]-20,b[2]+0.5*(b[0]-a.width-40)),10);return a},Q=function(){var b=d.orig?a(d.orig):!1,f={};b&&b.length?(f=b.offset(),f.top+=parseInt(b.css("paddingTop"),10)||0,f.left+=parseInt(b.css("paddingLeft"), 10)||0,f.top+=parseInt(b.css("border-top-width"),10)||0,f.left+=parseInt(b.css("border-left-width"),10)||0,f.width=b.width(),f.height=b.height(),f={width:f.width+2*c.padding,height:f.height+2*c.padding,top:f.top-c.padding-20,left:f.left-c.padding-20}):(b=P(),f={width:2*c.padding,height:2*c.padding,top:parseInt(b[3]+0.5*b[1],10),left:parseInt(b[2]+0.5*b[0],10)});return f},U=function(){t.is(":visible")?(a("div",t).css("top",-40*I+"px"),I=(I+1)%12):clearInterval(H)};a.fn.fancybox=function(b){if(!a(this).length)return this; a(this).data("fancybox",a.extend({},b,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(b){b.preventDefault();l||(l=!0,a(this).blur(),p=[],r=0,(b=a(this).attr("rel")||"")&&""!=b&&"nofollow"!==b?(p=a("a[rel="+b+"], area[rel="+b+"]"),r=p.index(this)):p.push(this),F())});return this};a.fancybox=function(b,c){var d;if(!l){l=!0;d="undefined"!==typeof c?c:{};p=[];r=parseInt(d.index,10)||0;if(a.isArray(b)){for(var e=0,g=b.length;e p.length||0>r)r=0;F()}};a.fancybox.showActivity=function(){clearInterval(H);t.show();H=setInterval(U,66)};a.fancybox.hideActivity=function(){t.hide()};a.fancybox.next=function(){return a.fancybox.pos(q+1)};a.fancybox.prev=function(){return a.fancybox.pos(q-1)};a.fancybox.pos=function(a){l|| (a=parseInt(a),p=k,-1=k.length?0:k.length-1,F()))};a.fancybox.cancel=function(){l||(l=!0,a.event.trigger("fancybox-cancel"),K(),d.onCancel(p,r,d),l=!1)};a.fancybox.close=function(){function b(){u.fadeOut("fast");h.empty().hide();e.hide();a.event.trigger("fancybox-cleanup");m.empty();c.onClosed(k,q,c);k=d=[];q=r=0;c=d={};l=!1}if(!l&&!e.is(":hidden"))if(l=!0,c&&!1===c.onCleanup(k,q,c))l=!1;else if(K(),a(C.add(y).add(z)).hide(),a(m.add(u)).unbind(), a(window).unbind("resize.fb scroll.fb"),a(document).unbind("keydown.fb"),m.find("iframe").attr("src",J&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank"),"inside"!==c.titlePosition&&h.empty(),e.stop(),"elastic"==c.transitionOut){s=Q();var f=e.position();g={top:f.top,left:f.left,width:e.width(),height:e.height()};c.opacity&&(g.opacity=1);h.empty().hide();A.prop=1;a(A).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:O,complete:b})}else e.fadeOut("none"== c.transitionOut?0:c.speedOut,b)};a.fancybox.resize=function(){u.is(":visible")&&u.css("height",a(document).height());a.fancybox.center(!0)};a.fancybox.center=function(a){var d,g;l||(g=!0===a?1:0,d=P(),!g&&(e.width()>d[0]||e.height()>d[1])||e.stop().animate({top:parseInt(Math.max(d[3]-20,d[3]+0.5*(d[1]-m.height()-40)-c.padding)),left:parseInt(Math.max(d[2]-20,d[2]+0.5*(d[0]-m.width()-40)-c.padding))},"number"==typeof a?a:200))};a.fancybox.init=function(){a("#fancybox-wrap-pg_jq").length||(a("body").append(n= a(''),t=a(' '),u=a(''),e=a('')),B=a('').append('').appendTo(e), B.append(m=a(''),C=a(''),h=a(''),y=a(''),z=a('')),C.click(a.fancybox.close),t.click(a.fancybox.cancel),y.click(function(b){b.preventDefault();a.fancybox.prev()}),z.click(function(b){b.preventDefault();a.fancybox.next()}), a.fn.mousewheel&&e.bind("mousewheel.fb",function(b,c){if(l)b.preventDefault();else if(0==a(b.target).get(0).clientHeight||a(b.target).get(0).scrollHeight===a(b.target).get(0).clientHeight)b.preventDefault(),a.fancybox[0').prependTo(B)))}; a.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:0.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(){}};a(document).ready(function(){a.fancybox.init()})})($pg_jq);