(function(a){a.fn.fullsize=function(b){var d={shadow:true,zoomInSpeed:200,zoomOutSpeed:200,fadeInSpeed:250,fadeOutSpeed:250,leftOffset:0,topOffset:0,iconOffset:8,forceTitleBar:false,extraTrigger:false,parentSteps:0,destroy:false,start:function(){},end:function(){}};var c=a.extend(d,b);if(c.destroy==true){a("div.fullsize-icon").remove()}a(document).keydown(function(e){if(e.keyCode==27){a("div.fullsize-wrapper, div.fullsize-sh-wrap").fadeOut(c.fadeOutSpeed,function(){a(this).remove()});c.end.call(this)}});return this.each(function(){if(c.destroy==true){a(this).unbind()}else{if(a(this).attr("longdesc")){var m=a(this);var k=m.attr("title");var f=m.attr("longdesc");var j=a("<div></div>").addClass("fullsize-icon").css({display:"none"});var l;if(c.extraTrigger){var h=m;for(var g=0;g<=c.parentSteps;g++){h=h.parent()}l=h.find(c.extraTrigger)}m.add(l).hover(function(){var t=m.css("marginTop").slice(0,-2);var u=m.css("marginLeft").slice(0,-2);var v=m.css("marginLeft").slice(0,-2);var q=m.css("marginLeft").slice(0,-2);if(t<0||u<0||v<0||q<0){var i=a(m);var p=a(m).parents();a(p).each(function(){if(this.tagName=="BODY"){return false}else{if(a(this).css("overflow")=="hidden"){i=a(this);return false}}});var r=i.offset();var s=parseInt(i.css("border-top-width"));var o=parseInt(i.css("border-left-width"))}else{var r=m.offset();var s=parseInt(m.css("border-top-width"));var o=parseInt(m.css("border-left-width"))}if(!s){s=0}if(!o){o=0}var n=false;a("div.fullsize-icon").each(function(){if(parseInt(a(this).css("top"))==(r.top+c.iconOffset+s)&&parseInt(a(this).css("left"))==(r.left+c.iconOffset+o)){n=true;curIcon=a(this)}});if(n==false){a(j).css({top:r.top+c.iconOffset+s,left:r.left+c.iconOffset+o});a("body").prepend(j)}a(j).show()},function(){a(j).hide()});a(j).hover(function(){a(this).show()},function(){a(this).hide()});a(j).click(function(){c.start.call(this);a("div.fullsize-wrapper, div.fullsize-sh-wrap").remove();var s=a(window).width();var q=a(window).height();var n=a(window).scrollTop();var u=a(window).scrollLeft();if(!a.support.opacity&&parseInt(a.browser.version.substr(0,1))<"8"){var i=(((s-c.leftOffset)/2)+u)-25;var t=(((q-c.topOffset)/2)+n)-25}else{var i=(((s+c.leftOffset)/2)+u)-25;var t=(((q+c.topOffset)/2)+n)-25}var r=a("<div></div>").addClass("fullsize-loading").css({"margin-left":i,"margin-top":t});var o=a("<div></div>").addClass("fullsize-loading-inner");a(r).prepend(o);a("body").prepend(r);var p=new Image();a(p).load(function(){a(this).hide();var I=m.offset();img_w=this.width;img_h=this.height;aspect=img_w/img_h;if(((img_w+c.leftOffset)+32)>s){img_w=(s-c.leftOffset)-32;img_h=img_w/aspect}if(((img_h+c.topOffset)+36)>q){img_h=(q-c.topOffset)-36;img_w=img_h*aspect}if(!a.support.opacity&&parseInt(a.browser.version.substr(0,1))<"8"){var z=Math.round((((s-c.leftOffset)-img_w)/2)+u);var A=Math.round((((q-c.topOffset)-img_h)/2)+n)}else{var z=Math.round((((s+c.leftOffset)-img_w)/2)+u);var A=Math.round((((q+c.topOffset)-img_h)/2)+n)}if(z<0){z=0}if(A<0){A=0}a(this).css({height:m.height()+"px",width:m.width()+"px"});a("div.fullsize-loading").remove();var w=a("<div></div>").addClass("fullsize-wrapper").css({display:"none","margin-top":I.top,"margin-left":I.left});a(w).prepend(this);if(k!=""||c.forceTitleBar==true){var H=a("<a></a>").addClass("fullsize-close");var v=a("<div></div>").addClass("fullsize-title").css({"max-width":img_w});var K=a("<div></div>").addClass("fullsize-title-text").text(k);a(v).prepend(H);a(v).prepend(K);a(w).prepend(v);a("body").prepend(w);if(A!=0){A=A-12}}else{a(this).addClass("fullsize-close");a("body").prepend(w)}if(c.shadow==true){if(a.browser.safari||(a.browser.mozilla&&a.browser.version.substr(0,5)>="1.9.1")){a(w).css({"-webkit-box-shadow":"0 2px 16px #000","-moz-box-shadow":"0 2px 16px #000","box-shadow":"0 2px 16px #000"})}else{var y=a("<div></div>").addClass("fullsize-sh-wrap").css({display:"none",width:m.width(),"margin-top":I.top,"margin-left":I.left});var x=a("<div></div>").addClass("fullsize-sh-top");var L=a("<div></div>").addClass("fullsize-sh-top-l");var J=a("<div></div>").addClass("fullsize-sh-top-m");var E=a("<div></div>").addClass("fullsize-sh-top-r");a(x).append(L).append(E).append(J);a(y).prepend(x);var B=a("<div></div>").addClass("fullsize-sh-body");var C=a("<div></div>").addClass("fullsize-sh-body-r");a(B).append(C);a(y).append(B);var G=a("<div></div>").addClass("fullsize-sh-bottom");var F=a("<div></div>").addClass("fullsize-sh-bottom-l");var M=a("<div></div>").addClass("fullsize-sh-bottom-m");var D=a("<div></div>").addClass("fullsize-sh-bottom-r");a(G).append(F).append(D).append(M);a(y).append(G);a("body").prepend(y);a(B).animate({height:parseInt(w.height())+img_h-22},{queue:false,duration:c.zoomInSpeed});a(y).fadeIn(c.fadeInSpeed).animate({height:parseInt(w.height())+img_h+22,width:img_w+22,marginTop:A-9,marginLeft:z-11},{queue:false,duration:c.zoomInSpeed})}}a(this).fadeIn(c.fadeInSpeed).animate({height:img_h,width:img_w},{queue:false,duration:c.zoomInSpeed});a(w).fadeIn(c.fadeInSpeed).animate({width:img_w,marginTop:A,marginLeft:z},{queue:false,duration:c.zoomInSpeed});a(".fullsize-close").click(function(){e(p,w,m,a(this))})}).attr("src",f).addClass("fullsize-image")});function e(n,i,q,p){var o=q.offset();a(n).fadeOut(c.fadeOutSpeed).animate({height:q.height(),width:q.width()},{queue:false,duration:c.zoomOutSpeed});if(c.shadow==true){a("div.fullsize-sh-wrap").remove()}a(i).fadeOut(c.fadeOutSpeed).animate({width:q.width(),marginTop:o.top,marginLeft:o.left},{queue:false,duration:c.zoomOutSpeed,complete:function(){p.remove()}});c.end.call(this)}}}})}})(jQuery);