/**
 * altgallery, jQuery Plugin
 *
 * @version 0.3.7
 * @copyright 2011 Flash-Gallery.com
 */

jQuery.effects||function(f,q){function u(d){var a;return d&&d.constructor==Array&&d.length==3?d:(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(d))?[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)]:(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(d))?[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55]:(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))?[parseInt(a[1],16),parseInt(a[2],
16),parseInt(a[3],16)]:(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(d))?[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(d)?v.transparent:v[f.trim(d).toLowerCase()]}function s(){var d=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,a={},b,c;if(d&&d.length&&d[0]&&d[d[0]])for(var g=d.length;g--;)b=d[g],typeof d[b]=="string"&&(c=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),a[c]=d[b]);else for(b in d)typeof d[b]===
"string"&&(a[b]=d[b]);return a}function w(d){var a,b;for(a in d)b=d[a],(b==null||f.isFunction(b)||a in o||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))&&delete d[a];return d}function x(d,a){var b={_:0},c;for(c in a)d[c]!=a[c]&&(b[c]=a[c]);return b}function r(d,a,b,c){if(typeof d=="object")c=a,b=null,a=d,d=a.effect;f.isFunction(a)&&(c=a,b=null,a={});if(typeof a=="number"||f.fx.speeds[a])c=b,b=a,a={};f.isFunction(b)&&(c=b,b=null);a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?
b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;c=c||a.complete;return[d,a,b,c]}function n(d){return!d||typeof d==="number"||f.fx.speeds[d]?!0:typeof d==="string"&&!f.effects[d]?!0:!1}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(d,a){f.fx.step[a]=function(b){if(!b.colorInit){var c;c=b.elem;var d=a,h;do{h=f.curCSS(c,d);if(h!=""&&h!="transparent"||f.nodeName(c,"body"))break;d="backgroundColor"}while(c=
c.parentNode);c=u(h);b.start=c;b.end=u(b.end);b.colorInit=!0}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var v={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],
darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],
maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},t=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(d,a,b,c){f.isFunction(b)&&(c=b,b=null);return this.queue(function(){var g=f(this),h=g.attr("style")||
" ",i=w(s.call(this)),j,l=g.attr("class");f.each(t,function(a,b){if(d[b])g[b+"Class"](d[b])});j=w(s.call(this));g.attr("class",l);g.animate(x(i,j),{queue:!1,duration:a,easing:b,complete:function(){f.each(t,function(a,b){if(d[b])g[b+"Class"](d[b])});typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=h):g.attr("style",h);c&&c.apply(this,arguments);f.dequeue(this)}})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(d,a,b,c){return a?f.effects.animateClass.apply(this,
[{add:d},a,b,c]):this._addClass(d)},_removeClass:f.fn.removeClass,removeClass:function(d,a,b,c){return a?f.effects.animateClass.apply(this,[{remove:d},a,b,c]):this._removeClass(d)},_toggleClass:f.fn.toggleClass,toggleClass:function(d,a,b,c,g){return typeof a=="boolean"||a===q?b?f.effects.animateClass.apply(this,[a?{add:d}:{remove:d},b,c,g]):this._toggleClass(d,a):f.effects.animateClass.apply(this,[{toggle:d},a,b,c])},switchClass:function(d,a,b,c,g){return f.effects.animateClass.apply(this,[{add:a,
remove:d},b,c,g])}});f.extend(f.effects,{version:"1.8.16",save:function(d,a){for(var b=0;b<a.length;b++)a[b]!==null&&d.data("ec.storage."+a[b],d[0].style[a[b]])},restore:function(d,a){for(var b=0;b<a.length;b++)a[b]!==null&&d.css(a[b],d.data("ec.storage."+a[b]))},setMode:function(d,a){a=="toggle"&&(a=d.is(":hidden")?"show":"hide");return a},getBaseline:function(d,a){var b,c;switch(d[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=d[0]/a.height}switch(d[1]){case "left":c=
0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=d[1]/a.width}return{x:c,y:b}},createWrapper:function(d){if(d.parent().is(".ui-effects-wrapper"))return d.parent();var a={width:d.outerWidth(!0),height:d.outerHeight(!0),"float":d.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),c=document.activeElement;d.wrap(b);(d[0]===c||f.contains(d[0],c))&&f(c).focus();b=d.parent();d.css("position")==
"static"?(b.css({position:"relative"}),d.css({position:"relative"})):(f.extend(a,{position:d.css("position"),zIndex:d.css("z-index")}),f.each(["top","left","bottom","right"],function(b,c){a[c]=d.css(c);isNaN(parseInt(a[c],10))&&(a[c]="auto")}),d.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return b.css(a).show()},removeWrapper:function(d){var a,b=document.activeElement;return d.parent().is(".ui-effects-wrapper")?(a=d.parent().replaceWith(d),(d[0]===b||f.contains(d[0],b))&&f(b).focus(),
a):d},setTransition:function(d,a,b,c){c=c||{};f.each(a,function(a,f){unit=d.cssUnit(f);unit[0]>0&&(c[f]=unit[0]*b+unit[1])});return c}});f.fn.extend({effect:function(d,a,b,c){var g=r.apply(this,arguments),h={options:g[1],duration:g[2],callback:g[3]},g=h.options.mode,i=f.effects[d];return f.fx.off||!i?g?this[g](h.duration,h.callback):this.each(function(){h.callback&&h.callback.call(this)}):i.call(this,h)},_show:f.fn.show,show:function(d){if(n(d))return this._show.apply(this,arguments);else{var a=r.apply(this,
arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(d){if(n(d))return this._hide.apply(this,arguments);else{var a=r.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(d){if(n(d)||typeof d==="boolean"||f.isFunction(d))return this.__toggle.apply(this,arguments);else{var a=r.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(d){var a=this.css(d),b=[];f.each(["em",
"px","%","pt"],function(c,d){a.indexOf(d)>0&&(b=[parseFloat(a),d])});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(d,a,b,c,g){return f.easing[f.easing.def](d,a,b,c,g)},easeInQuad:function(d,a,b,c,g){return c*(a/=g)*a+b},easeOutQuad:function(d,a,b,c,g){return-c*(a/=g)*(a-2)+b},easeInOutQuad:function(d,a,b,c,g){return(a/=g/2)<1?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},easeInCubic:function(d,a,b,c,g){return c*(a/=g)*a*a+b},easeOutCubic:function(d,a,b,c,g){return c*
((a=a/g-1)*a*a+1)+b},easeInOutCubic:function(d,a,b,c,g){return(a/=g/2)<1?c/2*a*a*a+b:c/2*((a-=2)*a*a+2)+b},easeInQuart:function(d,a,b,c,g){return c*(a/=g)*a*a*a+b},easeOutQuart:function(d,a,b,c,g){return-c*((a=a/g-1)*a*a*a-1)+b},easeInOutQuart:function(d,a,b,c,g){return(a/=g/2)<1?c/2*a*a*a*a+b:-c/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(d,a,b,c,g){return c*(a/=g)*a*a*a*a+b},easeOutQuint:function(d,a,b,c,g){return c*((a=a/g-1)*a*a*a*a+1)+b},easeInOutQuint:function(d,a,b,c,g){return(a/=g/2)<1?c/2*
a*a*a*a*a+b:c/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(d,a,b,c,g){return-c*Math.cos(a/g*(Math.PI/2))+c+b},easeOutSine:function(d,a,b,c,g){return c*Math.sin(a/g*(Math.PI/2))+b},easeInOutSine:function(d,a,b,c,g){return-c/2*(Math.cos(Math.PI*a/g)-1)+b},easeInExpo:function(d,a,b,c,g){return a==0?b:c*Math.pow(2,10*(a/g-1))+b},easeOutExpo:function(d,a,b,c,g){return a==g?b+c:c*(-Math.pow(2,-10*a/g)+1)+b},easeInOutExpo:function(d,a,b,c,g){return a==0?b:a==g?b+c:(a/=g/2)<1?c/2*Math.pow(2,10*(a-1))+b:c/
2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(d,a,b,c,g){return-c*(Math.sqrt(1-(a/=g)*a)-1)+b},easeOutCirc:function(d,a,b,c,g){return c*Math.sqrt(1-(a=a/g-1)*a)+b},easeInOutCirc:function(d,a,b,c,g){return(a/=g/2)<1?-c/2*(Math.sqrt(1-a*a)-1)+b:c/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(d,a,b,c,g){var d=1.70158,f=0,i=c;if(a==0)return b;if((a/=g)==1)return b+c;f||(f=g*0.3);i<Math.abs(c)?(i=c,d=f/4):d=f/(2*Math.PI)*Math.asin(c/i);return-(i*Math.pow(2,10*(a-=1))*Math.sin((a*g-d)*2*Math.PI/
f))+b},easeOutElastic:function(d,a,b,c,g){var d=1.70158,f=0,i=c;if(a==0)return b;if((a/=g)==1)return b+c;f||(f=g*0.3);i<Math.abs(c)?(i=c,d=f/4):d=f/(2*Math.PI)*Math.asin(c/i);return i*Math.pow(2,-10*a)*Math.sin((a*g-d)*2*Math.PI/f)+c+b},easeInOutElastic:function(d,a,b,c,g){var d=1.70158,f=0,i=c;if(a==0)return b;if((a/=g/2)==2)return b+c;f||(f=g*0.3*1.5);i<Math.abs(c)?(i=c,d=f/4):d=f/(2*Math.PI)*Math.asin(c/i);return a<1?-0.5*i*Math.pow(2,10*(a-=1))*Math.sin((a*g-d)*2*Math.PI/f)+b:i*Math.pow(2,-10*
(a-=1))*Math.sin((a*g-d)*2*Math.PI/f)*0.5+c+b},easeInBack:function(d,a,b,c,g,f){f==q&&(f=1.70158);return c*(a/=g)*a*((f+1)*a-f)+b},easeOutBack:function(d,a,b,c,f,h){h==q&&(h=1.70158);return c*((a=a/f-1)*a*((h+1)*a+h)+1)+b},easeInOutBack:function(d,a,b,c,f,h){h==q&&(h=1.70158);return(a/=f/2)<1?c/2*a*a*(((h*=1.525)+1)*a-h)+b:c/2*((a-=2)*a*(((h*=1.525)+1)*a+h)+2)+b},easeInBounce:function(d,a,b,c,g){return c-f.easing.easeOutBounce(d,g-a,0,c,g)+b},easeOutBounce:function(d,a,b,c,f){return(a/=f)<1/2.75?
c*7.5625*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(d,a,b,c,g){return a<g/2?f.easing.easeInBounce(d,a*2,0,c,g)*0.5+b:f.easing.easeOutBounce(d,a*2-g,0,c,g)*0.5+c*0.5+b}})}(jQuery);
(function(f,q){function u(){var a=document.getElementsByTagName("script");return a[a.length-1].src||location.href}function s(a){return'url("'+a+'")'}function w(a){var b=[],c,d;for(c=0;c<a.length;c++)for(d=0;d<a[c].items.length;d++)b.push(a[c].items[d]);return b}function x(a){if(typeof a=="number")return"#"+a.toString(16);else if(typeof a=="string")return"#"+a.match(/[0-9a-f]+/)[0]}function r(a){this.element=f(a);this.width=function(a){return this.element.width(a)};this.height=function(a){return this.element.height(a)};
this.drawImage=function(a,c,d){var c=f.extend({left:0,top:0,width:120,height:90,scaleMode:"fill",background:"none"},c),d=d===q?this.element:f(d,this.element),h=new Image;h.src=a.thumb;h.onload=function(){var i=document.createElement("a");f(i).attr({href:a.source});f(i).css({display:"block",position:"absolute",left:c.x,top:c.y,zIndex:c.z,width:c.width,height:c.height,overflow:"hidden",background:c.background});f(i).click(c.onclick);f(i).hover(c.onmouseover,c.onmouseout);var j=document.createElement("img");
j.src=h.src;var l;c.scaleMode=="fit"?l=o.fit(this.width,this.height,c.width,c.height):c.scaleMode=="fill"&&(l=o.fill(this.width,this.height,c.width,c.height));f(j).css({marginTop:l.top,marginRight:0,marginBottom:0,marginLeft:l.left,width:l.width,height:l.height,padding:0,border:"none",maxWidth:"none",maxHeight:"none",opacity:c.opacity});f(i).append(j);d.append(i)}}}function n(a,b,c){this.canvas=a;this.albums=b;this.items=w(b);this.currentItem=-1;this.getCurrentItem=function(){return this.items[this.currentItem]};
this.settings=f.extend(!0,{thumbnail:{width:120,height:90,alpha:85},colorScheme:{imageBGColor:1118481}},c);this.page=0;this.render()}function v(a,b){a=f(a);d=b;var c,g,h;c=b.config||{};(function(){function b(a,c,d){g.push({id:c||0,description:d||"Album "+(c+1),items:a})}g=[];if(typeof c.albums=="array")for(var d in c.albums)b(c.albums[d].items,d,c.albums[d].description);else typeof c.items=="array"?b(c.items):b(function(a){var b=[];f(a).find("img").each(function(){b.push({source:f(this).parent("a").attr("href")||
f(this).attr("src"),thumb:f(this).attr("src"),description:this.title})});return b}(a),0)})();e=document.createElement("div");h=new r(e);h.element.addClass("altgallery-canvas");h.element.css({display:"block",position:"relative",width:b.width,height:b.height,overflow:"hidden",margin:0,padding:0,background:b.background,MozUserSelect:"none",webkitUserSelect:"none",userSelect:"none"});a.empty().append(e);f(document).ready(function(){setTimeout(function(){b.type.toLowerCase()=="box"&&new n(h,g,c.settings||
{})},100)})}u();var t=u().replace(/[^\/]*$/,""),o={fit:function(a,b,c,d,h){var i,j,l=a/b,h=f.extend({noEnlarge:!1,minWidth:16,minHeight:16},h);i=c;j=c/l;j>d&&(j=d,i=j*l);if(i<h.minWidth)i=h.minWidth,j=i/l;if(j<h.minHeight)j=h.minHeight,i=j*l;if(h.noEnlarge&&(i>a||j>b))i=a,j=b;a=(d-j)/2;return{left:parseInt((c-i)/2),top:parseInt(a),width:parseInt(i),height:parseInt(j)}},fill:function(a,b,c,d){var f=a/b,a=c,b=c/f;b<d&&(b=d,a=b*f);d=(d-b)/2;return{left:parseInt((c-a)/2),top:parseInt(d),width:parseInt(a),
height:parseInt(b)}}};n.prototype.render=function(a){var b=this,c=this.canvas,g=this.items;if(a===q)a=b.page;c.element.empty();var h=this.canvas.width(),i=this.canvas.height(),j=parseInt((h-50)/parseInt(this.settings.thumbnail.width)),l=parseInt((i-50)/parseInt(this.settings.thumbnail.height)),k=Math.ceil(g.length/j);l>k&&(l=k);k=j*l;a*=k;b.pagesCount=Math.ceil(g.length/k);var m=parseInt(this.settings.thumbnail.width)+2,p=parseInt(this.settings.thumbnail.height)+2,y=(h-m*j)/2-8,n=(i-p*l)/2-8,o=f('<div class="altgallery-frame" />'),
h={position:"absolute",left:parseInt(y),top:parseInt(n),width:parseInt(h-(y+8)*2)+14,height:parseInt(i-(n+8)*2)+14,overflow:"hidden",background:"#fff",borderRadius:"4px",MozBorderRadius:"4px",webkitBorderRadius:"4px",boxShadow:"0 0 10px rgba(0, 0, 0, 0.5)",MozBoxShadow:"0 0 10px rgba(0, 0, 0, 0.5)",webkitBoxShadow:"0 0 10px rgba(0, 0, 0, 0.5)"};o.css(h);b.page>0&&(i=f('<a class="altgallery-page" style="left:4px; background:no-repeat center; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px;"></a>'),
i.css({backgroundImage:s(d.images.left)}),i.click(function(){b.prevPage()}),o.append(i));b.page<b.pagesCount-1&&(i=f('<a class="altgallery-page" style="right:4px; background:no-repeat center; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px;"></a>'),i.css({backgroundImage:s(d.images.right)}),i.click(function(){b.nextPage()}),o.append(i));o.find(".altgallery-page").css({position:"absolute",width:"30px",height:"30px",top:parseInt(h.height/2)-15,zIndex:20,cursor:"pointer"});o.hover(function(){o.find(".altgallery-page").show()},
function(){o.find(".altgallery-page").hide()});c.element.append(o);i=f('<div class="altgallery-frameMask" />');h.background="#000";h.opacity=0.6;h.zIndex=20;h.boxShadow="none";h.MozBoxShadow="none";h.webkitBoxShadow="none";i.css(h).hide();c.element.append(i);for(var r=parseInt(this.settings.thumbnail.alpha)/100,u=x(b.settings.colorScheme.imageBGColor),t=1,v=1,h=a,i=-1,l=g.length;h<l;h++){if(h>=k+a)break;h%j||i++;t=h%j*m+8;v=i*p+8;(function(a,d,h){c.drawImage(g[a],{x:parseInt(d),y:parseInt(h),z:10,
width:b.settings.thumbnail.width,height:b.settings.thumbnail.height,scaleMode:"fill",opacity:r,background:u,onclick:function(){b.currentItem=a;b.open(b.getCurrentItem(),{left:parseInt(d+y),top:parseInt(h+n)});return!1},onmouseover:function(){f(this).children("img").css({opacity:1})},onmouseout:function(){f(this).children("img").css({opacity:r})}},".altgallery-frame")})(h,t,v)}};n.prototype.open=function(a,b){var c=this,g=document.createElement("img");g.src=a.thumb;var h=new Image;h.onload=function(){f(".altgallery-imageFrame",
c.canvas.element).remove();f(".altgallery-frameMask",c.canvas.element).fadeIn(d.animation.duration);var a=document.createElement("div");f(a).addClass("altgallery-imageFrame").css({position:"absolute",padding:8,background:"#000",zIndex:30});f(a).hide();var i=o.fit(h.width,h.height,c.canvas.width()-48,c.canvas.height()-48),k={left:i.left+16+i.width/3,top:i.top+16+i.height/3,width:i.width/3,height:i.height/3};if(b!==q){if(b.left!==q)k.left=b.left;if(b.top!==q)k.top=b.top}f(a).css(k);var m=o.fit(h.width,
h.height,c.canvas.width()-48,c.canvas.height()-48),p={left:m.left+16+m.width/3,top:m.top+16+m.height/3,width:m.width/3,height:m.height/3,margin:0,padding:0,border:"none",maxWidth:"none",maxHeight:"none",cursor:"pointer"};f(g).css(p);f(a).append(g);c.canvas.element.append(a);f(g).animate(m,d.animation.duration);f(a).animate({opacity:"show",left:i.left+16,top:i.top+16,width:i.width,height:i.height},d.animation.duration,function(){var b=f('<a class="altgallery-close" style="position:absolute; right:-15px; top:-13px; width:30px; height:30px; z-index:40; background:no-repeat center; cursor:pointer;"></a>');
b.css({backgroundImage:s(d.images.close)});b.click(function(){f(this).remove();k.opacity="hide";f(a).animate(k,d.animation.duration,function(){f(this).remove()});f(g).animate(p,d.animation.duration);f(".altgallery-frameMask",c.canvas.element).fadeOut(d.animation.duration)});f(a).append(b)});f(g).click(function(){f(".altgallery-close",a).remove();k.opacity="hide";f(a).animate(k,d.animation.duration,function(){f(this).remove();c.next()});f(g).animate(p,d.animation.duration)})};h.src=a.thumb;var i=new Image;
i.onload=function(){f(g).attr("src",a.source)};i.src=a.source};n.prototype.prev=function(){this.currentItem--;if(this.currentItem<0)this.currentItem=this.items.length-1;this.open(this.getCurrentItem())};n.prototype.next=function(){this.currentItem++;if(this.currentItem>=this.items.length)this.currentItem=0;this.open(this.getCurrentItem())};n.prototype.prevPage=function(){this.page--;this.render(this.page)};n.prototype.nextPage=function(){this.page++;this.render(this.page)};var d={};f.fn.altgallery=
function(a){a=f.extend(!0,{type:"Box",width:"550px",height:"400px",background:"none",images:{folder:t.replace(/[^\/]+\/$/,"")+"images/",left:"left.png",right:"right.png",close:"close.png"},animation:{duration:500},config:{settings:{}}},a);if(a.images.folder){a.images.folder=a.images.folder.replace(/\/+$/,"")+"/";for(var b in a.images)b!="folder"&&(a.images[b]=a.images.folder+a.images[b].replace(/^\/+/,""))}this.each(function(){v(this,a)});return this};f.altbox=function(a,b){b=f.extend(!0,{frame:{color:"#000",
borderRadius:0},mask:{color:"#000",opacity:0.7},images:{folder:t.replace(/[^\/]+\/$/,"")+"images/",close:"close.png",loader:"loader.gif"},animation:{duration:700}},b);if(b.images.folder)for(var c in b.images)c!="folder"&&!b.images[c].match("/")&&(b.images[c]=b.images.folder+b.images[c]);var d=f('<div style="position:fixed; z-index:999; left:0; top:0; width:100%; height:100%; background:no-repeat center;"></div>');d.css({opacity:0,backgroundColor:b.mask.color,backgroundImage:s(b.images.loader)});f(document.body).append(d);
d.animate({opacity:b.mask.opacity},b.animation.duration);var h=new Image;h.onload=function(){function c(){d.remove();p.remove()}var j=f(window).width()-100,l=f(window).height()-100,k=o.fit(h.width/4,h.height/4,j,l,{noEnlarge:!0,minWidth:100,minHeight:100});k.left+=50;k.top+=50;var m=o.fit(h.width+20,h.height+20,j,l,{noEnlarge:!0,minWidth:120,minHeight:120});m.left+=50;m.top+=50;var p=f('<div style="position:fixed; z-index:1000;"></div>');p.css(k);p.css({backgroundColor:b.frame.color,borderRadius:b.frame.borderRadius,
MozUserSelect:"none",webkitUserSelect:"none",userSelect:"none"});p.hide();var n=f('<img src="'+a+'" alt="" style="display:block;" />');n.css({margin:"10px",width:k.width-20,height:k.height-20,borderRadius:b.frame.borderRadius>8?b.frame.borderRadius-8:0});var q=f('<a href="#" style="display:block; position:absolute; right:-12px; top:-10px; width:30px; height:30px; background:no-repeat center;"></a>');q.css({backgroundImage:s(b.images.close)});p.append(n);f(document.body).append(p);(function(){d.css({backgroundImage:"none"});
n.animate({width:m.width-20,height:m.height-20,margin:"10px"},b.animation.duration,"easeOutBack");m.opacity="show";p.animate(m,b.animation.duration,"easeOutBack",function(){p.append(q)})})();f(window).resize(function(){j=f(window).width()-100;l=f(window).height()-100;k=o.fit(h.width/4,h.height/4,j,l,{noEnlarge:!0,minWidth:100,minHeight:100});k.left+=50;k.top+=50;m=o.fit(h.width+20,h.height+20,j,l,{noEnlarge:!0,minWidth:120,minHeight:120});m.left+=50;m.top+=50;p.css(m);n.css({width:m.width-20,height:m.height-
20})});d.click(c);q.click(function(){q.remove();k.opacity="hide";p.animate(k,b.animation.duration*0.67);n.animate({width:k.width-20,height:k.height-20},b.animation.duration*0.67);d.fadeOut(b.animation.duration,function(){c()});return!1})};h.src=a}})(jQuery);

