//>>built
define("dojox/image/LightboxNano","dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/_base/fx dojo/dom dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/dom-class dojo/on dojo/query dojo/fx".split(" "),function(g,r,p,t,n,d,k,h,u,l,v,q){getViewport=function(){var a="BackCompat"==document.compatMode?document.body:document.documentElement,b=k.docScroll();return{w:a.clientWidth,h:a.clientHeight,l:b.x,t:b.y}};return r("dojox.image.LightboxNano",null,{href:"",duration:500,preloadDelay:5E3,
constructor:function(a,b){var c=this;g.mixin(c,a);if(b=c._node=n.byId(b)){if(!/a/i.test(b.tagName)){var e=d.create("a",{href:c.href,"class":b.className},b,"after");b.className="";e.appendChild(b);b=e}h.set(b,"position","relative");d.create("div",{"class":"nano-enlarge",style:{position:"absolute",display:"none"}},b);n.setSelectable(b,!1);c._onClickEvt=l(b,"click",g.hitch(c,"_load"))}c.href&&setTimeout(function(){(new Image).src=c.href;c._hideLoading()},c.preloadDelay)},destroy:function(){var a=this._connects||
[];a.push(this._onClickEvt);p.forEach(a,function(b){b.remove()});d.destroy(this._node)},_load:function(a){a&&a.preventDefault();if(!this._loading){this._loading=!0;this._reset();a=this._img=d.create("img",{"class":"nano-image nano-image-hidden"},document.body);var b=this._loadingNode;var c=v("img",this._node)[0]||this._node;var e=k.position(c,!0),f=k.getContentBox(c),m=k.getBorderExtents(c);null==b&&(this._loadingNode=b=d.create("div",{"class":"nano-loading",style:{position:"absolute",display:""}},
this._node,"after"),c=k.getMarginBox(b),h.set(b,{left:parseInt((f.w-c.w)/2)+"px",top:parseInt((f.h-c.h)/2)+"px"}));f.x=e.x-10+m.l;f.y=e.y-10+m.t;this._start=f;this._connects=[l(a,"load",g.hitch(this,"_show"))];a.src=this.href}},_hideLoading:function(){this._loadingNode&&h.set(this._loadingNode,"display","none");this._loadingNode=!1},_show:function(){var a=getViewport(),b=this._img.width,c=this._img.height,e=parseInt(.9*(a.w-20)),f=parseInt(.9*(a.h-20)),m=this._bg=d.create("div",{"class":"nano-background",
style:{opacity:0}},document.body);this._loadingNode&&this._hideLoading();u.remove(this._img,"nano-image-hidden");h.set(this._node,"visibility","hidden");this._loading=!1;this._connects=this._connects.concat([l(document,"mousedown",g.hitch(this,"_hide")),l(document,"keypress",g.hitch(this,"_key")),l(window,"resize",g.hitch(this,"_sizeBg"))]);b>e&&(c=c*e/b,b=e);c>f&&(b=b*f/c,c=f);this._end={x:(a.w-20-b)/2+a.l,y:(a.h-20-c)/2+a.t,w:b,h:c};this._sizeBg();q.combine([this._anim(this._img,this._coords(this._start,
this._end)),this._anim(m,{opacity:.5})]).play()},_sizeBg:function(){var a=document.documentElement;h.set(this._bg,{top:0,left:0,width:a.scrollWidth+"px",height:a.scrollHeight+"px"})},_key:function(a){a.preventDefault();this._hide()},_coords:function(a,b){return{left:{start:a.x,end:b.x},top:{start:a.y,end:b.y},width:{start:a.w,end:b.w},height:{start:a.h,end:b.h}}},_hide:function(){p.forEach(this._connects,function(a){a.remove()});this._connects=[];q.combine([this._anim(this._img,this._coords(this._end,
this._start),"_reset"),this._anim(this._bg,{opacity:0})]).play()},_reset:function(){h.set(this._node,"visibility","visible");d.destroy(this._img);d.destroy(this._bg);this._img=this._bg=null;this._node.focus()},_anim:function(a,b,c){return t.animateProperty({node:a,duration:this.duration,properties:b,onEnd:c?g.hitch(this,c):null})},show:function(a){a=a||{};this.href=a.href||this.href;a=n.byId(a.origin);var b=getViewport();this._node=a||d.create("div",{style:{position:"absolute",width:0,hieght:0,left:b.l+
b.w/2+"px",top:b.t+b.h/2+"px"}},document.body);this._load();a||d.destroy(this._node)}})});