if(!window.Seadragon)
	window.Seadragon={};
(function(){
	var a=false;
	if(Seadragon.Config)
		return;
	Seadragon.Config={
   		debugMode:a,
		animationTime:1.5,
		blendTime:.5,
		alwaysBlend:a,
		autoHideControls:true,
		immediateRender:a,
		wrapHorizontal:a,
		wrapVertical:a,
		wrapOverlays:a,
		transformOverlays:a,
		minZoomDimension:null,
		minZoomImageRatio:.8,
		maxZoomPixelRatio:2,
		visibilityRatio:.5,
		springStiffness:5,
		imageLoaderLimit:2,
		clickTimeThreshold:200,
		clickDistThreshold:5,
		zoomPerClick:2,
		zoomPerScroll:1.2,
		zoomPerSecond:2,
		proxyUrl:null,
		imagePath:"img/"}
		})();
(function(){
	var a="Hmm, this doesn't appear to be a valid Deep Zoom Image.";
	if(Seadragon.Strings)
		return;
	Seadragon.Strings={
		Errors:{
			Failure:"Sorry, but Seadragon Ajax can't run on your browser!\nPlease try using IE 8 or Firefox 3.\n",
			Dzc:"Sorry, we don't support Deep Zoom Collections!",
			Dzi:a,
			Xml:a,
			Empty:"You asked us to open nothing, so we did just that.",
			ImageFormat:"Sorry, we don't support {0}-based Deep Zoom Images.",
			Security:"It looks like a security restriction stopped us from loading this Deep Zoom Image.",
			Status:"This space unintentionally left blank ({0} {1}).",
			Unknown:"Whoops, something inexplicably went wrong. Sorry!"},
		Messages:{Loading:"Loading..."},
		Tooltips:{
			FullPage:"Toggle full page",
			Home:"Go home",
			ZoomIn:"Zoom in (you can also use your mouse's scroll wheel)",
			ZoomOut:"Zoom out (you can also use your mouse's scroll wheel)"}
		};
	Seadragon.Strings.getString=function(e){
   		for(var c=e.split("."),a=Seadragon.Strings,b=0; b<c.length; b++)
			a=a[c[b]]||{};
		if(typeof a!="string")
			a="";
		var d=arguments;
		return a.replace(/\{\d+\}/g,
		function(b){
   				var a=parseInt(b.match(/\d+/))+1;
				return a<d.length?d[a]:""})
		};
	Seadragon.Strings.setString=function(e,d){
   		for(var c=e.split("."),b=Seadragon.Strings,a=0;a<c.length-1;a++){
   		if(!b[c[a]])b[c[a]]={};
		b=b[c[a]]}b[c[a]]=d}})();
	Seadragon.Debug=function(){
   this.log=function(c,d){
   var a=window.console||{
   },b=Seadragon.Config.debugMode;
if(b&&a.log)a.log(c);
else b&&d&&alert(c)};
this.error=function(b,d){
   var c=window.console||{
   },a=Seadragon.Config.debugMode;
if(a&&c.error)c.error(b);
else a&&alert(b);
if(a)throw d||new Error(b)};
this.fail=function(a){
   alert(Seadragon.Strings.getString("Errors.Failure"));
throw new Error(a)}};
Seadragon.Debug=new Seadragon.Debug;
Seadragon.Profiler=function(){
   var c=null,a=this,m=a,d=false,b=0,f=c,j=c,h=Infinity,e=0,g=0,l=Infinity,i=0,k=0;
a.getAvgUpdateTime=function(){
   return e};
	a.getMinUpdateTime=function(){
   return h};
a.getMaxUpdateTime=function(){
   return g};
a.getAvgIdleTime=function(){
   return i};
a.getMinIdleTime=function(){
   return l};
a.getMaxIdleTime=function(){
   return k};
a.isMidUpdate=function(){
   return d};
a.getNumUpdates=function(){
   return b};
a.beginUpdate=function(){
   d&&m.endUpdate();
d=true;
f=(new Date).getTime();
if(b<1)return;
var a=f-j;
i=(i*(b-1)+a)/b;
if(a<l)l=a;
if(a>k)k=a};
a.endUpdate=function(){
   if(!d)return;
j=(new Date).getTime();
d=false;
var a=j-f;
b++;
e=(e*(b-1)+a)/b;
if(a<h)h=a;
if(a>g)g=a};
a.clearProfile=function(){
   d=false;
	b=0;
	f=c;
	j=c;
	h=Infinity;
	e=0;
	g=0;
	l=Infinity;
	i=0;
	k=0}
	};
(function(){
   Seadragon.Point=function(a,b){
   this.x=typeof a=="number"?a:0;
this.y=typeof b=="number"?b:0};
var a=Seadragon.Point.prototype;
a.plus=function(a){
   return new Seadragon.Point(this.x+a.x,this.y+a.y)};
a.minus=function(a){
   return new Seadragon.Point(this.x-a.x,this.y-a.y)};
a.times=function(a){
   return new Seadragon.Point(this.x*a,this.y*a)};
a.divide=function(a){
   return new Seadragon.Point(this.x/a,this.y/a)};
a.negate=function(){
   return new Seadragon.Point(-this.x,-this.y)};
a.distanceTo=function(a){
   return Math.sqrt(Math.pow(this.x-a.x,2)+Math.pow(this.y-a.y,2))};
a.apply=function(a){
   return new Seadragon.Point(a(this.x),a(this.y))};
a.equals=function(a){
   return a instanceof Seadragon.Point&&this.x===a.x&&this.y===a.y};
a.toString=function(){
   return "("+this.x+","+this.y+")"}})();
(function(){
   Seadragon.Rect=function(e,f,d,c){
   var a="number",b=this;
b.x=typeof e==a?e:0;
b.y=typeof f==a?f:0;
b.width=typeof d==a?d:0;
b.height=typeof c==a?c:0};
var a=Seadragon.Rect.prototype;
a.getAspectRatio=function(){
   return this.width/this.height};
a.getTopLeft=function(){
   return new Seadragon.Point(this.x,this.y)};
a.getBottomRight=function(){
   var a=this;
return new Seadragon.Point(a.x+a.width,a.y+a.height)};
a.getCenter=function(){
   var a=this;
return new Seadragon.Point(a.x+a.width/2,a.y+a.height/2)};
a.getSize=function(){
   return new Seadragon.Point(this.width,this.height)};
a.equals=function(a){
   var b=this;
return a instanceof Seadragon.Rect&&b.x===a.x&&b.y===a.y&&b.width===a.width&&b.height===a.height};
a.toString=function(){
   var a=this;
return "["+a.x+","+a.y+","+a.width+"x"+a.height+"]"}})();
Seadragon.Spring=function(h){
   var c=this,d=typeof h=="number"?h:0,e=d,b=d,a=(new Date).getTime(),g=a,f=a;
function i(b){
   var a=Seadragon.Config.springStiffness;
return (1-Math.exp(-b*a))/(1-Math.exp(-a))}c.getCurrent=function(){
   return d};
c.getTarget=function(){
   return b};
c.resetTo=function(c){
   b=c;
f=a;
e=b;
g=f};
c.springTo=function(c){
   e=d;
g=a;
b=c;
f=g+1e3*Seadragon.Config.animationTime};
c.shiftBy=function(a){
   e+=a;
b+=a};
c.update=function(){
   a=(new Date).getTime();
d=a>=f?b:e+(b-e)*i((a-g)/(f-g))}};
Seadragon.Utils=function(){
   var k="mousewheel",a=null,d="number",j="DOMMouseScroll",i=true,h=false,b=this,e={
   UNKNOWN:0,IE:1,FIREFOX:2,SAFARI:3,CHROME:4,OPERA:5};
Seadragon.Browser=e;
var c=b,n=["Msxml2.XMLHTTP","Msxml3.XMLHTTP","Microsoft.XMLHTTP"],p={
   bmp:h,jpeg:i,jpg:i,png:i,tif:h,wdp:h},g=e.UNKNOWN,f=0,l=h,o={
   };
(function(){
   var d=navigator.appName,s=navigator.appVersion,a=navigator.userAgent;
if(d=="Microsoft Internet Explorer"&&!!window.attachEvent&&!!window.ActiveXObject){
   var k=a.indexOf("MSIE");
g=e.IE;
f=parseFloat(a.substring(k+5,a.indexOf(";",k)));
var m=document.documentMode;
if(typeof m!=="undefined")f=m}else if(d=="Netscape"&&!!window.addEventListener){
   var j=a.indexOf("Firefox"),b=a.indexOf("Safari"),p=a.indexOf("Chrome");
if(j>=0){
   g=e.FIREFOX;
f=parseFloat(a.substring(j+8))}else if(b>=0){
   var r=a.substring(0,b).lastIndexOf("/");
g=p>=0?e.CHROME:e.SAFARI;
f=parseFloat(a.substring(r+1,b))}}else if(d=="Opera"&&!!window.opera&&!!window.attachEvent){
   g=e.OPERA;
f=parseFloat(s)}for(var q=window.location.search.substring(1),n=q.split("&"),i=0;
i<n.length;
i++){
   var c=n[i],h=c.indexOf("=");
if(h>0)o[c.substring(0,h)]=decodeURIComponent(c.substring(h+1))}l=g==e.IE&&f<9||g==e.CHROME&&f<2})();
function m(a,b){
   if(b&&a!=document.body)return document.body;
else return a.offsetParent}b.getBrowser=function(){
   return g};
b.getBrowserVersion=function(){
   return f};
b.getElement=function(a){
   if(typeof a=="string")a=document.getElementById(a);
return a};
b.getElementPosition=function(a){
   var a=c.getElement(a),b=new Seadragon.Point,d=c.getElementStyle(a).position=="fixed",e=m(a,d);
while(e){
   b.x+=a.offsetLeft;
b.y+=a.offsetTop;
if(d)b=b.plus(c.getPageScroll());
a=e;
d=c.getElementStyle(a).position=="fixed";
e=m(a,d)}return b};
b.getElementSize=function(a){
   var a=c.getElement(a);
return new Seadragon.Point(a.clientWidth,a.clientHeight)};
b.getElementStyle=function(a){
   var a=c.getElement(a);
if(a.currentStyle)return a.currentStyle;
else if(window.getComputedStyle)return window.getComputedStyle(a,"");
else Seadragon.Debug.fail("Unknown element style, no known technique.")};
b.getEvent=function(a){
   return a?a:window.event};
b.getMousePosition=function(a){
   var a=c.getEvent(a),b=new Seadragon.Point;
if(a.type==j&&g==e.FIREFOX&&f<3){
   b.x=a.screenX;
b.y=a.screenY}else if(typeof a.pageX==d){
   b.x=a.pageX;
b.y=a.pageY}else if(typeof a.clientX==d){
   b.x=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;
b.y=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}else Seadragon.Debug.fail("Unknown event mouse position, no known technique.");
return b};
b.getMouseScroll=function(b){
   var b=c.getEvent(b),a=0;
if(typeof b.wheelDelta==d)a=b.wheelDelta;
else if(typeof b.detail==d)a=b.detail*-1;
else Seadragon.Debug.fail("Unknown event mouse scroll, no known technique.");
return a?a/Math.abs(a):0};
b.getPageScroll=function(){
   var a=new Seadragon.Point,b=document.documentElement||{
   },c=document.body||{
   };
if(typeof window.pageXOffset==d){
   a.x=window.pageXOffset;
a.y=window.pageYOffset}else if(c.scrollLeft||c.scrollTop){
   a.x=c.scrollLeft;
a.y=c.scrollTop}else if(b.scrollLeft||b.scrollTop){
   a.x=b.scrollLeft;
a.y=b.scrollTop}return a};
b.getWindowSize=function(){
   var a=new Seadragon.Point,b=document.documentElement||{
   },c=document.body||{
   };
if(typeof window.innerWidth==d){
   a.x=window.innerWidth;
a.y=window.innerHeight}else if(b.clientWidth||b.clientHeight){
   a.x=b.clientWidth;
a.y=b.clientHeight}else if(c.clientWidth||c.clientHeight){
   a.x=c.clientWidth;
a.y=c.clientHeight}else Seadragon.Debug.fail("Unknown window size, no known technique.");
return a};
b.imageFormatSupported=function(a){
   var a=a?a:"";
return !!p[a.toLowerCase()]};
b.makeCenteredNode=function(g){
   var b="border:none; margin:0px; padding:0px;",g=Seadragon.Utils.getElement(g),d=c.makeNeutralElement("div"),a=[];
a.push('<div style="display:table; height:100%; width:100%;');
a.push(b);
a.push('#position:relative; overflow:hidden; text-align:left;">');
a.push('<div style="#position:absolute; #top:50%; width:100%; ');
a.push(b);
a.push('display:table-cell; vertical-align:middle;">');
a.push('<div style="#position:relative; #top:-50%; width:100%; ');
a.push(b);
a.push('text-align:center;"></div></div></div>');
d.innerHTML=a.join("");
d=d.firstChild;
var f=d,e=d.getElementsByTagName("div");
while(e.length>0){
   f=e[0];
e=f.getElementsByTagName("div")}f.appendChild(g);
return d};
b.makeNeutralElement=function(c){
   var b=document.createElement(c),a=b.style;
a.background="transparent none";
a.border="none";
a.margin="0px";
a.padding="0px";
a.position="static";
return b};
b.makeTransparentImage=function(h){
   var d=c.makeNeutralElement("img"),b=a;
if(g==e.IE&&f<7){
   b=c.makeNeutralElement("span");
b.style.display="inline-block";
d.onload=function(){
   b.style.width=b.style.width||d.width+"px";
b.style.height=b.style.height||d.height+"px";
d.onload=a;
d=a};
d.src=h;
b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+h+"', sizingMethod='scale')"}else{
   b=d;
b.src=h}return b};
b.setElementOpacity=function(b,a,f){
   var b=c.getElement(b);
if(f&&l)a=Math.round(a);
if(a<1)b.style.opacity=a;
else b.style.opacity="";
var d=b.style.filter||"";
b.style.filter=d.replace(/[\s]*alpha\(.*?\)[\s]*/g,"");
if(a>=1)return;
var e=Math.round(100*a),g=" alpha(opacity="+e+") ";
b.style.filter+=g};
b.addEvent=function(a,d,e,b){
   var a=c.getElement(a);
if(a.addEventListener){
   d==k&&a.addEventListener(j,e,b);
a.addEventListener(d,e,b)}else if(a.attachEvent){
   a.attachEvent("on"+d,e);
b&&a.setCapture&&a.setCapture()}else Seadragon.Debug.fail("Unable to attach event handler, no known technique.")};
b.removeEvent=function(a,d,e,b){
   var a=c.getElement(a);
if(a.removeEventListener){
   d==k&&a.removeEventListener(j,e,b);
a.removeEventListener(d,e,b)}else if(a.detachEvent){
   a.detachEvent("on"+d,e);
b&&a.releaseCapture&&a.releaseCapture()}else Seadragon.Debug.fail("Unable to detach event handler, no known technique.")};
b.cancelEvent=function(a){
	var a=c.getEvent(a);
	a.preventDefault&&a.preventDefault();
	a.cancel=i;
	a.returnValue=h};
b.stopEvent=function(a){
	var a=c.getEvent(a);
	a.stopPropagation&&a.stopPropagation();
	a.cancelBubble=i};
b.createCallback=function(d,c){
	for(var b=[],a=2;a<arguments.length;a++)
		b.push(arguments[a]);
return function(){
   for(var e=b.concat([]),a=0;
a<arguments.length;
a++)e.push(arguments[a]);
return c.apply(d,e)}};
b.getUrlParameter=function(c){
   var b=o[c];
return b?b:a};
b.makeAjaxRequest=function(f,d){
   var c=typeof d=="function",b=a;
if(c)var h=d,d=function(){
   window.setTimeout(Seadragon.Utils.createCallback(a,h,b),1)};
if(window.ActiveXObject)for(var g=0;
g<n.length;
g++)try{
   b=new ActiveXObject(n[g]);
break}catch(e){
   continue}else if(window.XMLHttpRequest)b=new XMLHttpRequest;
!b&&Seadragon.Debug.fail("Browser doesn't support XMLHttpRequest.");
if(Seadragon.Config.proxyUrl)f=Seadragon.Config.proxyUrl+f;
if(c)b.onreadystatechange=function(){
   if(b.readyState==4){
   b.onreadystatechange=new Function;
d()}};
try{
   b.open("GET",f,c);
b.send(a)}catch(e){
   Seadragon.Debug.log(e.name+" while making AJAX request: "+e.message);
b.onreadystatechange=a;
b=a;
c&&d()}return c?a:b};
b.parseXml=function(d){
   var c=a;
if(window.ActiveXObject)try{
   c=new ActiveXObject("Microsoft.XMLDOM");
c.async=h;
c.loadXML(d)}catch(b){
   Seadragon.Debug.log(b.name+" while parsing XML (ActiveX): "+b.message)}else if(window.DOMParser)try{
   var e=new DOMParser;
c=e.parseFromString(d,"text/xml")}catch(b){
   Seadragon.Debug.log(b.name+" while parsing XML (DOMParser): "+b.message)}else Seadragon.Debug.fail("Browser doesn't support XML DOM.");
return c}};
Seadragon.Utils=new Seadragon.Utils;
(function(){
   var c="mouseup",d="mousedown",b=true,a=false;
if(Seadragon.MouseTracker)return;
var f=Seadragon.Utils.getBrowser()==Seadragon.Browser.IE&&Seadragon.Utils.getBrowserVersion()<9,i=a,l=a,k={
   },g=[];
function j(a){
   return Seadragon.Utils.getMousePosition(a)}function e(b,d){
   var c=Seadragon.Utils.getMousePosition(b),a=Seadragon.Utils.getElementPosition(d);
return c.minus(a)}function h(c,b){
   var d=document.body;
while(b&&c!=b&&d!=b)try{
   b=b.parentNode}catch(e){
   return a}return c==b}function m(){
   i=b}function n(){
   i=a}(function(){
   if(f){
   Seadragon.Utils.addEvent(document,d,m,a);
Seadragon.Utils.addEvent(document,c,n,a)}else{
   Seadragon.Utils.addEvent(window,d,m,b);
Seadragon.Utils.addEvent(window,c,n,b)}})();
Seadragon.MouseTracker=function(m){
   var p="function",q="mousemove",u="mousewheel",t="mouseout",s="mouseover",o=null,r=this,n=r,B=o,G=Math.random(),m=Seadragon.Utils.getElement(m),z=a,v=a,x=a,y=a,A=o,I=o,H=o;
r.target=m;
r.enterHandler=o;
r.exitHandler=o;
r.pressHandler=o;
r.releaseHandler=o;
r.clickHandler=o;
r.dragHandler=o;
r.scrollHandler=o;
function R(){
   if(!z){
   Seadragon.Utils.addEvent(m,s,E,a);
Seadragon.Utils.addEvent(m,t,F,a);
Seadragon.Utils.addEvent(m,d,O,a);
Seadragon.Utils.addEvent(m,c,w,a);
Seadragon.Utils.addEvent(m,u,L,a);
Seadragon.Utils.addEvent(m,"click",N,a);
z=b;
k[G]=B}}function T(){
   if(z){
   Seadragon.Utils.removeEvent(m,s,E,a);
Seadragon.Utils.removeEvent(m,t,F,a);
Seadragon.Utils.removeEvent(m,d,O,a);
Seadragon.Utils.removeEvent(m,c,w,a);
Seadragon.Utils.removeEvent(m,u,L,a);
Seadragon.Utils.removeEvent(m,"click",N,a);
C();
z=a;
delete k[G]}}function S(){
   if(!v){
   if(f){
   Seadragon.Utils.removeEvent(m,c,w,a);
Seadragon.Utils.addEvent(m,c,P,b);
Seadragon.Utils.addEvent(m,q,K,b)}else{
   Seadragon.Utils.addEvent(window,c,J,b);
Seadragon.Utils.addEvent(window,q,D,b)}v=b}}function C(){
   if(v){
   if(f){
   Seadragon.Utils.removeEvent(m,q,K,b);
Seadragon.Utils.removeEvent(m,c,P,b);
Seadragon.Utils.addEvent(m,c,w,a)}else{
   Seadragon.Utils.removeEvent(window,q,D,b);
Seadragon.Utils.removeEvent(window,c,J,b)}v=a}}function M(c,d){
   var b=k;
for(var a in b)b.hasOwnProperty(a)&&G!=a&&b[a][c](d)}function U(){
   return y}function E(a){
   var a=Seadragon.Utils.getEvent(a);
f&&v&&!h(a.srcElement,m)&&M("onMouseOver",a);
var g=a.target?a.target:a.srcElement,d=a.relatedTarget?a.relatedTarget:a.fromElement;
if(!h(m,g)||h(m,d))return;
y=b;
if(typeof n.enterHandler==p)try{
   n.enterHandler(n,e(a,m),x,i)}catch(c){
   Seadragon.Debug.error(c.name+" while executing enter handler: "+c.message,c)}}function F(b){
   var b=Seadragon.Utils.getEvent(b);
f&&v&&!h(b.srcElement,m)&&M("onMouseOut",b);
var d=b.target?b.target:b.srcElement,g=b.relatedTarget?b.relatedTarget:b.toElement;
if(!h(m,d)||h(m,g))return;
y=a;
if(typeof n.exitHandler==p)try{
   n.exitHandler(n,e(b,m),x,i)}catch(c){
   Seadragon.Debug.error(c.name+" while executing exit handler: "+c.message,c)}}function O(a){
   var a=Seadragon.Utils.getEvent(a);
if(a.button==2)return;
x=b;
A=j(a);
H=A;
I=(new Date).getTime();
if(typeof n.pressHandler==p)try{
   n.pressHandler(n,e(a,m))}catch(c){
   Seadragon.Debug.error(c.name+" while executing press handler: "+c.message,c)}(n.pressHandler||n.dragHandler)&&Seadragon.Utils.cancelEvent(a);
if(!f||!l){
   S();
l=b;
g=[B]}else f&&g.push(B)}function w(b){
   var b=Seadragon.Utils.getEvent(b),f=x,d=y;
if(b.button==2)return;
x=a;
if(typeof n.releaseHandler==p)try{
   n.releaseHandler(n,e(b,m),f,d)}catch(c){
   Seadragon.Debug.error(c.name+" while executing release handler: "+c.message,c)}f&&d&&Q(b)}function P(b){
   var b=Seadragon.Utils.getEvent(b);
if(b.button==2)return;
for(var c=0;
c<g.length;
c++){
   var d=g[c];
!d.hasMouse()&&d.onMouseUp(b)}C();
l=a;
b.srcElement.fireEvent("on"+b.type,document.createEventObject(b));
Seadragon.Utils.stopEvent(b)}function J(a){
   !y&&w(a);
C()}function N(a){
   n.clickHandler&&Seadragon.Utils.cancelEvent(a)}function Q(a){
   var a=Seadragon.Utils.getEvent(a);
if(a.button==2)return;
var g=(new Date).getTime()-I,d=j(a),c=H.distanceTo(d),f=g<=Seadragon.Config.clickTimeThreshold&&c<=Seadragon.Config.clickDistThreshold;
if(typeof n.clickHandler==p)try{
   n.clickHandler(n,e(a,m),f,a.shiftKey)}catch(b){
   Seadragon.Debug.error(b.name+" while executing click handler: "+b.message,b)}}function D(a){
   var a=Seadragon.Utils.getEvent(a),c=j(a),d=c.minus(A);
A=c;
if(typeof n.dragHandler==p){
   try{
   n.dragHandler(n,e(a,m),d,a.shiftKey)}catch(b){
   Seadragon.Debug.error(b.name+" while executing drag handler: "+b.message,b)}Seadragon.Utils.cancelEvent(a)}}function K(b){
   for(var a=0;
a<g.length;
a++)g[a].onMouseMove(b);
Seadragon.Utils.stopEvent(b)}function L(a){
   var a=Seadragon.Utils.getEvent(a),c=Seadragon.Utils.getMouseScroll(a);
if(typeof n.scrollHandler==p){
   if(c)try{
   n.scrollHandler(n,e(a,m),c,a.shiftKey)}catch(b){
   Seadragon.Debug.error(b.name+" while executing scroll handler: "+b.message,b)}Seadragon.Utils.cancelEvent(a)}}(function(){
   B={
   hasMouse:U,onMouseOver:E,onMouseOut:F,onMouseUp:w,onMouseMove:D}})();
r.isTracking=function(){
   return z};
r.setTracking=function(a){
   if(a)R();
else T()}}})();
Seadragon.EventManager=function(){
   var b="function",c=this,a={
   };
c.addListener=function(c,d){
   if(typeof d!=b)return;
if(!a[c])a[c]=[];
a[c].push(d)};
c.removeListener=function(f,e){
   var c=a[f];
if(typeof e!=b)return;
else if(!c)return;
for(var d=0;
d<c.length;
d++)if(e==c[d]){
   c.splice(d,1);
return}};
c.clearListeners=function(b){
   if(a[b])delete a[b]};
c.trigger=function(e){
   var d=a[e],f=[];
if(!d)return;
for(var b=1;
b<arguments.length;
b++)f.push(arguments[b]);
for(var b=0;
b<d.length;
b++)try{
   d[b].apply(window,f)}catch(c){
   Seadragon.Debug.error(c.name+" while executing "+e+" handler: "+c.message,c)}}};
(function(){
   var a=null,b=15000;
function c(f,g){
   var c=a,d=a;
function e(b){
   c.onload=a;
c.onabort=a;
c.onerror=a;
d&&window.clearTimeout(d);
window.setTimeout(function(){
   g(f,b?c:a)},1)}this.start=function(){
   c=new Image;
var g=function(){
   e(true)},a=function(){
   e(false)},h=function(){
   Seadragon.Debug.log("Image timed out: "+f);
e(false)};
c.onload=g;
c.onabort=a;
c.onerror=a;
d=window.setTimeout(h,b);
c.src=f}}Seadragon.ImageLoader=function(){
   var b=0;
function d(c,e,d){
   b--;
if(typeof c=="function")try{
   c(d)}catch(a){
   Seadragon.Debug.error(a.name+" while executing "+e+" callback: "+a.message,a)}}this.loadImage=function(h,e){
   if(b>=Seadragon.Config.imageLoaderLimit)return false;
var f=Seadragon.Utils.createCallback(a,d,e),g=new c(h,f);
b++;
g.start();
return true}}})();
(function(){
   var c="inline-block",b=true,a={
   REST:0,GROUP:1,HOVER:2,DOWN:3};
Seadragon.Button=function(L,K,H,I,J,r,l,p,q,s){
   var g="hidden",e=null,f="function",h=Seadragon.Utils.makeNeutralElement("span"),d=a.GROUP,i=new Seadragon.MouseTracker(h),x=Seadragon.Utils.makeTransparentImage(K),m=Seadragon.Utils.makeTransparentImage(H),n=Seadragon.Utils.makeTransparentImage(I),o=Seadragon.Utils.makeTransparentImage(J),r=typeof r==f?r:e,l=typeof l==f?l:e,p=typeof p==f?p:e,q=typeof q==f?q:e,s=typeof s==f?s:e,w=0,E=2e3,u=e,t=false;
this.elmt=h;
function v(){
   window.setTimeout(G,20)}function G(){
   if(t){
   var c=(new Date).getTime(),d=c-u,a=1-d/E;
a=Math.min(1,a);
a=Math.max(0,a);
Seadragon.Utils.setElementOpacity(m,a,b);
a>0&&v()}}function C(){
   t=b;
u=(new Date).getTime()+w;
window.setTimeout(v,w)}function F(){
   t=false;
Seadragon.Utils.setElementOpacity(m,1,b)}function k(b){
   if(b>=a.GROUP&&d==a.REST){
   F();
d=a.GROUP}if(b>=a.HOVER&&d==a.GROUP){
   n.style.visibility="";
d=a.HOVER}if(b>=a.DOWN&&d==a.HOVER){
   o.style.visibility="";
d=a.DOWN}}function j(b){
   if(b<=a.HOVER&&d==a.DOWN){
   o.style.visibility=g;
d=a.HOVER}if(b<=a.GROUP&&d==a.HOVER){
   n.style.visibility=g;
d=a.GROUP}if(b<=a.REST&&d==a.GROUP){
   C();
d=a.REST}}function A(e,d,b,c){
   if(b){
   k(a.DOWN);
q&&q()}else!c&&k(a.HOVER)}function D(e,d,b){
   j(a.GROUP);
b&&s&&s()}function B(){
   k(a.DOWN);
r&&r()}function y(e,d,b,c){
   if(b&&c){
   j(a.HOVER);
l&&l()}else if(b)j(a.GROUP);
else k(a.HOVER)}function z(c,b,a){
   p&&a&&p()}this.notifyGroupEnter=function(){
   k(a.GROUP)};
this.notifyGroupExit=function(){
   j(a.REST)};
(function(){
   h.style.display=c;
h.style.position="relative";
h.title=L;
h.appendChild(x);
h.appendChild(m);
h.appendChild(n);
h.appendChild(o);
var k=x.style,f=m.style,d=n.style,e=o.style;
f.position=d.position=e.position="absolute";
f.top=d.top=e.top="0px";
f.left=d.left=e.left="0px";
d.visibility=e.visibility=g;
if(Seadragon.Utils.getBrowser()==Seadragon.Browser.FIREFOX&&Seadragon.Utils.getBrowserVersion()<3)f.top=d.top=e.top="";
i.enterHandler=A;
i.exitHandler=D;
i.pressHandler=B;
i.releaseHandler=y;
i.clickHandler=z;
i.setTracking(b);
j(a.REST)})()};
Seadragon.ButtonGroup=function(a){
   var e=Seadragon.Utils.makeNeutralElement("span"),a=a.concat([]),d=new Seadragon.MouseTracker(e);
this.elmt=e;
function f(){
   for(var b=0;
b<a.length;
b++)a[b].notifyGroupEnter()}function g(f,e,c){
   if(!c)for(var b=0;
b<a.length;
b++)a[b].notifyGroupExit()}function h(f,e,d,c){
   if(!c)for(var b=0;
b<a.length;
b++)a[b].notifyGroupExit()}this.emulateEnter=function(){
   f()};
this.emulateExit=function(){
   g()};
(function(){
   e.style.display=c;
for(var i=0;
i<a.length;
i++)e.appendChild(a[i].elmt);
d.enterHandler=f;
d.exitHandler=g;
d.releaseHandler=h;
d.setTracking(b)})()}})();
Seadragon.TileSource=function(d,c,h,e,g,f){
   var b=this,a=b,i=c/d;
b.width=d;
b.height=c;
b.aspectRatio=d/c;
b.dimensions=new Seadragon.Point(d,c);
b.minLevel=g?g:0;
b.maxLevel=f?f:Math.ceil(Math.log(Math.max(d,c))/Math.log(2));
b.tileSize=h?h:0;
b.tileOverlap=e?e:0;
b.getLevelScale=function(b){
   return 1/(1<<a.maxLevel-b)};
b.getNumTiles=function(e){
   var b=a.getLevelScale(e),f=Math.ceil(b*d/a.tileSize),g=Math.ceil(b*c/a.tileSize);
return new Seadragon.Point(f,g)};
b.getPixelRatio=function(c){
   var b=a.dimensions.times(a.getLevelScale(c)),d=1/b.x,e=1/b.y;
return new Seadragon.Point(d,e)};
b.getTileAtPoint=function(g,d){
   var b=a.dimensions.times(a.getLevelScale(g)),c=d.times(b.x),e,f;
if(d.x>=0&&d.x<=1)e=Math.floor(c.x/a.tileSize);
else e=Math.ceil(b.x/a.tileSize)*Math.floor(c.x/b.x)+Math.floor((b.x+c.x%b.x)%b.x/a.tileSize);
if(d.y>=0&&d.y<=i)f=Math.floor(c.y/a.tileSize);
else f=Math.ceil(b.y/a.tileSize)*Math.floor(c.y/b.y)+Math.floor((b.y+c.y%b.y)%b.y/a.tileSize);
return new Seadragon.Point(e,f)};
b.getTileBounds=function(j,f,g){
   var c=a.dimensions.times(a.getLevelScale(j)),h=f===0?0:a.tileSize*f-a.tileOverlap,i=g===0?0:a.tileSize*g-a.tileOverlap,d=a.tileSize+(f===0?1:2)*a.tileOverlap,e=a.tileSize+(g===0?1:2)*a.tileOverlap;
d=Math.min(d,c.x-h);
e=Math.min(e,c.y-i);
var b=1/c.x;
return new Seadragon.Rect(h*b,i*b,d*b,e*b)};
b.getTileUrl=function(){
   throw new Error("Method not implemented.")};
b.tileExists=function(b,d,e){
   var c=a.getNumTiles(b);
return b>=a.minLevel&&b<=a.maxLevel&&d>=0&&e>=0&&d<c.x&&e<c.y}};
Seadragon.DisplayRect=function(e,f,d,c,b,a){
   Seadragon.Rect.apply(this,arguments);
this.minLevel=b;
this.maxLevel=a};
Seadragon.DisplayRect.prototype=new Seadragon.Rect;
Seadragon.DziTileSource=function(i,h,b,f,g,e,c){
   var a=this;
Seadragon.TileSource.apply(a,[i,h,b,f]);
var j=a,d={
   };
a.fileFormat=e;
a.tileFormat=e;
a.displayRects=c;
(function(){
   if(!c)return;
for(var e=c.length-1;
e>=0;
e--)for(var b=c[e],a=b.minLevel;
a<=b.maxLevel;
a++){
   if(!d[a])d[a]=[];
d[a].push(b)}})();
a.getTileUrl=function(a,b,c){
   return [g,a,"/",b,"_",c,".",e].join("")};
a.tileExists=function(c,m,n){
   var e=d[c];
if(!e||!e.length)return true;
for(var f=j.getLevelScale(c),l=e.length-1;
l>=0;
l--){
   var a=e[l];
if(c<a.minLevel||c>a.maxLevel)continue;
var g=a.x*f,h=a.y*f,i=g+a.width*f,k=h+a.height*f;
g=Math.floor(g/b);
h=Math.floor(h/b);
i=Math.ceil(i/b);
k=Math.ceil(k/b);
if(g<=m&&m<i&&h<=n&&n<k)return true}return false}};
Seadragon.DziTileSource.prototype=new Seadragon.TileSource;
(function(){
   var d="Errors.Empty",c="function",a=null;
function b(a){
   Error.apply(this,arguments);
this.message=a}b.prototype=new Error;
function g(a){
   if(!(a instanceof b)){
   Seadragon.Debug.error(a.name+" while creating DZI from XML: "+a.message);
a=new b(Seadragon.Strings.getString("Errors.Unknown"))}return a}function e(d){
   var a=d.split("/"),b=a[a.length-1],c=b.lastIndexOf(".");
if(c>-1)a[a.length-1]=b.slice(0,c);
return a.join("/")+"_files/"}function h(c,h){
   if(!c)throw new b(Seadragon.Strings.getString("Errors.Security"));
else if(c.status!==200&&c.status!==0){
   var e=c.status,g=e==404?"Not Found":c.statusText;
throw new b(Seadragon.Strings.getString("Errors.Status",e,g))}var d=a;
if(c.responseXML&&c.responseXML.documentElement)d=c.responseXML;
else if(c.responseText)d=Seadragon.Utils.parseXml(c.responseText);
return f(d,h)}function f(d,g){
   var a="Errors.Dzi";
if(!d||!d.documentElement)throw new b(Seadragon.Strings.getString("Errors.Xml"));
var e=d.documentElement,c=e.tagName;
if(c=="Image")try{
   return j(e,g)}catch(f){
   var h=Seadragon.Strings.getString(a);
throw f instanceof b?f:new b(h)}else if(c=="Collection")throw new b(Seadragon.Strings.getString("Errors.Dzc"));
else if(c=="Error")return i(e);
throw new b(Seadragon.Strings.getString(a))}function j(a,l){
   var e=a.getAttribute("Format");
if(!Seadragon.Utils.imageFormatSupported(e))throw new b(Seadragon.Strings.getString("Errors.ImageFormat",e.toUpperCase()));
for(var i=a.getElementsByTagName("Size")[0],g=a.getElementsByTagName("DisplayRect"),n=parseInt(i.getAttribute("Width"),10),m=parseInt(i.getAttribute("Height"),10),k=parseInt(a.getAttribute("TileSize")),j=parseInt(a.getAttribute("Overlap")),h=[],f=0;
f<g.length;
f++){
   var d=g[f],c=d.getElementsByTagName("Rect")[0];
h.push(new Seadragon.DisplayRect(parseInt(c.getAttribute("X"),10),parseInt(c.getAttribute("Y"),10),parseInt(c.getAttribute("Width"),10),parseInt(c.getAttribute("Height"),10),parseInt(d.getAttribute("MinLevel"),10),parseInt(d.getAttribute("MaxLevel"),10)))}return new Seadragon.DziTileSource(n,m,k,j,l,e,h)}function i(c){
   var a=c.getElementsByTagName("Message")[0],d=a.firstChild.nodeValue;
throw new b(d)}Seadragon.DziTileSource.getTilesUrl=e;
Seadragon.DziTileSource.createFromJson=function(o,m){
   var p=typeof m==c,k,i,f=o;
if(!f||!f.url&&!f.tilesUrl)i=new b(Seadragon.Strings.getString(d));
else try{
   var j=f.displayRects;
if(j&&j.length)for(var l=0,q=j.length;
l<q;
l++){
   var h=j[l];
j[l]=new Seadragon.DisplayRect(h.x||h[0],h.y||h[1],h.width||h[2],h.height||h[3],h.minLevel||h[4],h.maxLevel||h[5])}k=new Seadragon.DziTileSource(f.width,f.height,f.tileSize,f.tileOverlap,f.tilesUrl||e(f.url),f.tileFormat,f.displayRects);
k.xmlUrl=f.url}catch(n){
   i=g(n)}if(p)window.setTimeout(Seadragon.Utils.createCallback(a,m,k,i&&i.message),1);
else if(i)throw i;
else return k};
Seadragon.DziTileSource.createFromXml=function(j,k,l){
   var n=typeof l==c,i=a;
if(!j){
   i=Seadragon.Strings.getString(d);
if(n){
   window.setTimeout(function(){
   l(a,i)},1);
return a}throw new b(i)}var o=e(j);
function m(d,e){
   try{
   var c=d(e,o);
c.xmlUrl=j;
return c}catch(b){
   if(n){
   i=g(b).message;
return a}else throw g(b)}}if(n){
   if(k)window.setTimeout(function(){
   var a=m(f,Seadragon.Utils.parseXml(k));
l(a,i)},1);
else Seadragon.Utils.makeAjaxRequest(j,function(b){
   var a=m(h,b);
l(a,i)});
return a}if(k)return m(f,Seadragon.Utils.parseXml(k));
else return m(h,Seadragon.Utils.makeAjaxRequest(j))}})();
Seadragon.Viewport=function(b,j){
   var c=true,i=null,d=this,a=d,b=new Seadragon.Point(b.x,b.y),m=j.x/j.y,k=j.y/j.x,e=new Seadragon.Spring(0),f=new Seadragon.Spring(0),h=new Seadragon.Spring(1),g=i,p=new Seadragon.Rect(0,0,1,k);
function q(){
   a.goHome(c);
a.update()}function l(){
   var b=m/a.getAspectRatio();
return b>=1?1:b}function o(){
   var a=l();
if(Seadragon.Config.minZoomDimension)var c=j.x<=j.y?Seadragon.Config.minZoomDimension/b.x:Seadragon.Config.minZoomDimension/(b.x*k);
else var c=Seadragon.Config.minZoomImageRatio*a;
return Math.min(c,a)}function n(){
   var a=j.x*Seadragon.Config.maxZoomPixelRatio/b.x;
return Math.max(a,l())}d.getAspectRatio=function(){
   return b.x/b.y};
d.getContainerSize=function(){
   return new Seadragon.Point(b.x,b.y)};
d.getBounds=function(c){
   var d=a.getCenter(c),b=1/a.getZoom(c),e=b/a.getAspectRatio();
return new Seadragon.Rect(d.x-b/2,d.y-e/2,b,e)};
d.getCenter=function(q){
   var d=new Seadragon.Point(e.getCurrent(),f.getCurrent()),i=new Seadragon.Point(e.getTarget(),f.getTarget());
if(q)return d;
else if(!g)return i;
var p=a.pixelFromPoint(g,c),l=a.getZoom(),h=1/l,k=h/a.getAspectRatio(),j=new Seadragon.Rect(d.x-h/2,d.y-k/2,h,k),o=g.minus(j.getTopLeft()).times(b.x/j.width),m=o.minus(p),n=m.divide(b.x*l);
return i.plus(n)};
d.getZoom=function(a){
   if(a)return h.getCurrent();
else return h.getTarget()};
d.applyConstraints=function(j){
   var l=a.getZoom(),h=Math.max(Math.min(l,n()),o());
l!=h&&a.zoomTo(h,g,j);
var b=a.getBounds(),i=Seadragon.Config.visibilityRatio,c=i*b.width,d=i*b.height,q=b.x+b.width,p=1-b.x,r=b.y+b.height,m=k-b.y,e=0;
if(!Seadragon.Config.wrapHorizontal)if(q<c)e=c-q;
else if(p<c)e=p-c;
var f=0;
if(!Seadragon.Config.wrapVertical)if(r<d)f=d-r;
else if(m<d)f=m-d;
if(e||f){
   b.x+=e;
b.y+=f;
a.fitBounds(b,j)}};
d.ensureVisible=function(b){
   a.applyConstraints(b)};
d.fitBounds=function(e,j){
   var g=a.getAspectRatio(),h=e.getCenter(),d=new Seadragon.Rect(e.x,e.y,e.width,e.height);
if(d.getAspectRatio()>=g){
   d.height=e.width/g;
d.y=h.y-d.height/2}else{
   d.width=e.height*g;
d.x=h.x-d.width/2}a.panTo(a.getCenter(c),c);
a.zoomTo(a.getZoom(c),i,c);
var f=a.getBounds(),m=a.getZoom(),k=1/d.width;
if(k==m||d.width==f.width){
   a.panTo(h,j);
return}var l=f.getTopLeft().times(b.x/f.width).minus(d.getTopLeft().times(b.x/d.width)).divide(b.x/f.width-b.x/d.width);
a.zoomTo(k,l,j)};
d.goHome=function(c){
   var b=a.getCenter();
if(Seadragon.Config.wrapHorizontal){
   b.x=(1+b.x%1)%1;
e.resetTo(b.x);
e.update()}if(Seadragon.Config.wrapVertical){
   b.y=(k+b.y%k)%k;
f.resetTo(b.y);
f.update()}a.fitBounds(p,c)};
d.panBy=function(d,b){
   var c=new Seadragon.Point(e.getTarget(),f.getTarget());
a.panTo(c.plus(d),b)};
d.panTo=function(a,b){
   if(b){
   e.resetTo(a.x);
f.resetTo(a.y)}else{
   e.springTo(a.x);
f.springTo(a.y)}};
d.zoomBy=function(d,c,b){
   a.zoomTo(h.getTarget()*d,c,b)};
d.zoomTo=function(b,a,c){
   if(c)h.resetTo(b);
else h.springTo(b);
g=a instanceof Seadragon.Point?a:i};
d.resize=function(e,h){
   var f=a.getBounds(),d=f,g=e.x/b.x;
b=new Seadragon.Point(e.x,e.y);
if(h){
   d.width=f.width*g;
d.height=d.width/a.getAspectRatio()}a.fitBounds(d,c)};
d.update=function(){
   var m=e.getCurrent(),n=f.getCurrent(),d=h.getCurrent();
if(g)var l=a.pixelFromPoint(g,c);
h.update();
if(g&&h.getCurrent()!=d){
   var k=a.pixelFromPoint(g,c),j=k.minus(l),b=a.deltaPointsFromPixels(j,c);
e.shiftBy(b.x);
f.shiftBy(b.y)}else g=i;
e.update();
f.update();
return e.getCurrent()!=m||f.getCurrent()!=n||h.getCurrent()!=d};
d.deltaPixelsFromPoints=function(c,d){
   return c.times(b.x*a.getZoom(d))};
d.deltaPointsFromPixels=function(c,d){
   return c.divide(b.x*a.getZoom(d))};
d.pixelFromPoint=function(e,d){
   var c=a.getBounds(d);
return e.minus(c.getTopLeft()).times(b.x/c.width)};
d.pointFromPixel=function(e,d){
   var c=a.getBounds(d);
return e.divide(b.x/c.width).plus(c.getTopLeft())};
q()};
(function(){
   var g="100%",m="progid:DXImageTransform.Microsoft.Matrix(",d="px",e="",i="absolute",l=" when it's not yet loaded.",k="Attempting to draw tile ",c=null,a=true,s="undefined",b=false,G=100,v=.5,o=Seadragon.Utils.getBrowser(),C=Seadragon.Utils.getBrowserVersion(),L=navigator.userAgent,E=!!document.createElement("canvas").getContext,F=document.documentElement||{
   },w=F.style||{
   },r=b,y=["transform","WebkitTransform","MozTransform"],h,q;
while(h=y.shift())if(typeof w[h]!==s){
   r=a;
q=/webkit/i.test(h);
break}var H="-webkit-transform",z="WebkitTransition",J=typeof w[z]!==s,B="progid:DXImageTransform.Microsoft.Matrix",I=new RegExp(B+"\\(.*?\\)","g"),K=function(){
   try{
   return o==Seadragon.Browser.IE&&!!document.documentElement.filters}catch(a){
   return b}}(),D=o==Seadragon.Browser.SAFARI&&C<4||o==Seadragon.Browser.CHROME,n=E&&!D,u=!n&&r,x=b,A=typeof document.documentMode!==s?"bicubic":"nearest-neighbor";
function j(f,h,i,d,e,g){
   var a=this;
a.level=f;
a.x=h;
a.y=i;
a.bounds=d;
a.exists=e;
a.url=g;
a.elmt=c;
a.image=c;
a.loaded=b;
a.loading=b;
a.style=c;
a.position=c;
a.size=c;
a.blendStart=c;
a.opacity=c;
a.distance=c;
a.visibility=c;
a.beingDrawn=b;
a.lastDrawnTime=0;
a.lastTouchTime=0}j.prototype.toString=function(){
   return this.level+"/"+this.x+"_"+this.y};
j.prototype.drawHTML=function(j){
   var a=this;
if(!a.loaded){
   Seadragon.Debug.error(k+a.toString()+l);
return}if(!a.elmt){
   a.elmt=Seadragon.Utils.makeNeutralElement("img");
a.elmt.src=a.url;
a.style=a.elmt.style;
a.style.position=i;
a.style.msInterpolationMode=A;
if(u)a.style[h+"Origin"]="0px 0px"}var g=a.elmt,c=a.style,b=a.position,f=a.size;
g.parentNode!=j&&j.appendChild(g);
if(u)c[h]=["matrix(",(f.x/g.width).toFixed(8),",0,0,",(f.y/g.height).toFixed(8),",",b.x.toFixed(8),q?",":"px,",b.y.toFixed(8),q?")":"px)"].join(e);
else if(x){
   var o=j.clientWidth,n=j.clientHeight;
c.width=o+d;
c.height=n+d;
c.filter=[m,"M11=",(f.x/o).toFixed(8),",M22=",(f.y/n).toFixed(8),",Dx=",b.x.toFixed(8),",Dy=",b.y.toFixed(8),")"].join(e)}else{
   b=b.apply(Math.floor);
f=f.apply(Math.ceil);
c.left=b.x+d;
c.top=b.y+d;
c.width=f.x+d;
c.height=f.y+d}Seadragon.Utils.setElementOpacity(g,a.opacity)};
j.prototype.drawCanvas=function(c){
   var a=this;
if(!a.loaded){
   Seadragon.Debug.error(k+a.toString()+l);
return}var b=a.position,d=a.size;
c.globalAlpha=a.opacity;
c.drawImage(a.image,b.x,b.y,d.x,d.y)};
j.prototype.unload=function(){
   var a=this;
a.elmt&&a.elmt.parentNode&&a.elmt.parentNode.removeChild(a.elmt);
a.elmt=c;
a.image=c;
a.loaded=b;
a.loading=b};
var f={
   CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8};
Seadragon.OverlayPlacement=f;
function t(a){
   switch(a){
   case f.TOP_LEFT:return function(){
   };
case f.TOP:return function(a,b){
   a.x-=b.x/2};
case f.TOP_RIGHT:return function(a,b){
   a.x-=b.x};
case f.RIGHT:return function(a,b){
   a.x-=b.x;
a.y-=b.y/2};
case f.BOTTOM_RIGHT:return function(a,b){
   a.x-=b.x;
a.y-=b.y};
case f.BOTTOM:return function(a,b){
   a.x-=b.x/2;
a.y-=b.y};
case f.BOTTOM_LEFT:return function(a,b){
   a.y-=b.y};
case f.LEFT:return function(a,b){
   a.y-=b.y/2};
case f.CENTER:default:return function(a,b){
   a.x-=b.x/2;
a.y-=b.y/2}}}function p(c,a,d){
   var b=this;
b.elmt=c;
b.scales=a instanceof Seadragon.Rect;
b.bounds=new Seadragon.Rect(a.x,a.y,a.width,a.height);
b.adjust=t(a instanceof Seadragon.Point?d:f.TOP_LEFT);
b.position=new Seadragon.Point(a.x,a.y);
b.size=new Seadragon.Point(a.width,a.height);
b.style=c.style;
b.naturalSize=new Seadragon.Point(c.clientWidth,c.clientHeight)}p.prototype.destroy=function(){
   var b=this.elmt,a=this.style;
b.parentNode&&b.parentNode.removeChild(b);
a.top=e;
a.left=e;
a.position=e;
if(this.scales){
   a.width=e;
a.height=e}};
p.prototype.drawHTML=function(l){
   var j=this,c=j.elmt,a=j.style,n=j.scales,k=j.naturalSize;
if(c.parentNode!=l){
   l.appendChild(c);
a.position=i;
k.x=c.clientWidth;
k.y=c.clientHeight}var f=j.position,b=j.size;
if(!n){
   b.x=k.x=k.x||c.clientWidth;
b.y=k.y=k.y||c.clientHeight}j.adjust(f,b);
if(Seadragon.Config.transformOverlays&&r){
   a[h+"Origin"]="0px 0px";
a[h]=["translate(",f.x.toFixed(8),"px,",f.y.toFixed(8),"px)"].join(e);
if(n){
   if(!c.clientWidth)a.width=g;
if(!c.clientHeight)a.height=g;
a[h]+=[" scale(",(b.x/c.clientWidth).toFixed(8),",",(b.y/c.clientHeight).toFixed(8),")"].join(e)}}else if(Seadragon.Config.transformOverlays&&x){
   var p=l.clientWidth,o=l.clientHeight;
a.width=p+d;
a.height=o+d;
a.filter=[m,"M11=",(b.x/p).toFixed(8),",M22=",(b.y/o).toFixed(8),",Dx=",f.x.toFixed(8),",Dy=",f.y.toFixed(8),")"].join(e)}else{
   f=f.apply(Math.floor);
b=b.apply(Math.ceil);
a.left=f.x+d;
a.top=f.y+d;
if(n){
   a.width=b.x+d;
a.height=b.y+d}}};
p.prototype.update=function(a,b){
   this.scales=a instanceof Seadragon.Rect;
this.bounds=new Seadragon.Rect(a.x,a.y,a.width,a.height);
this.adjust=t(a instanceof Seadragon.Point?b:f.TOP_LEFT)};
Seadragon.Drawer=function(d,u,X){
   var f=this,t=Seadragon.Utils.getElement(X),s=Seadragon.Utils.makeNeutralElement(n?"canvas":"div"),V=n?s.getContext("2d"):c,K=new Seadragon.ImageLoader,B=new Seadragon.Profiler,T=d.minLevel,S=d.maxLevel,U=d.tileSize,M=d.tileOverlap,z=d.height/d.width,y={
   },w={
   },m={
   },q=[],k={
   },l=[],Q=[],C=0,D=0,A=b,h=a;
f.elmt=t;
f.profiler=B;
(function(){
   s.style.width=g;
s.style.height=g;
s.style.position=i;
t.style.textAlign="left";
t.appendChild(s)})();
function J(a){
   if(!y[a])y[a]=d.getNumTiles(a);
return y[a]}function E(a){
   if(!w[a])w[a]=d.getPixelRatio(a);
return w[a]}function W(a,b,c,n,e,f){
   if(!m[a])m[a]={
   };
if(!m[a][b])m[a][b]={
   };
if(!m[a][b][c]){
   var g=(e+b%e)%e,h=(f+c%f)%f,i=d.getTileBounds(a,g,h),l=d.tileExists(a,g,h),o=d.getTileUrl(a,g,h);
i.x+=1*(b-g)/e;
i.y+=z*(c-h)/f;
m[a][b][c]=new j(a,b,c,i,l,o)}var k=m[a][b][c];
k.lastTouchTime=n;
return k}function R(a,b){
   a.loading=K.loadImage(a.url,Seadragon.Utils.createCallback(c,O,a,b))}function O(d,r,m){
   d.loading=b;
if(A){
   Seadragon.Debug.error("Tile load callback in middle of drawing routine.");
return}else if(!m){
   Seadragon.Debug.log("Tile "+d+" failed to load: "+d.url);
d.exists=b;
return}else if(r<D){
   Seadragon.Debug.log("Ignoring tile "+d+" loaded before reset: "+d.url);
return}d.loaded=a;
d.image=m;
var j=q.length;
if(q.length>=G){
   for(var p=Math.ceil(Math.log(U)/Math.log(2)),e=c,i=-1,g=q.length-1;
g>=0;
g--){
   var f=q[g];
if(f.level<=p||f.beingDrawn)continue;
else if(!e){
   e=f;
i=g;
continue}var l=f.lastTouchTime,k=e.lastTouchTime,o=f.level,n=e.level;
if(l<k||l==k&&o>n){
   e=f;
i=g}}if(e&&i>=0){
   e.unload();
j=i}}q[j]=d;
h=a}function N(){
   m={
   };
q=[]}function r(c,d,g){
   if(!k[c])return b;
if(d===undefined||g===undefined){
   var f=k[c];
for(var h in f)if(f.hasOwnProperty(h)){
   var e=f[h];
for(var i in e)if(e.hasOwnProperty(i)&&!e[i])return b}return a}return k[c][d]===undefined||k[c][d][g]===undefined||k[c][d][g]===a}function P(a,b,c){
   if(b===undefined||c===undefined)return r(a+1);
else return r(a+1,2*b,2*c)&&r(a+1,2*b,2*c+1)&&r(a+1,2*b+1,2*c)&&r(a+1,2*b+1,2*c+1)}function L(a,b,d,c){
   if(!k[a]){
   Seadragon.Debug.error("Setting coverage for a tile before its level's coverage has been reset: "+a);
return}if(!k[a][b])k[a][b]={
   };
k[a][b][d]=c}function F(a){
   k[a]={
   }}function H(b,a){
   if(!b)return a;
if(a.visibility>b.visibility)return a;
else if(a.visibility==b.visibility)if(a.distance<b.distance)return a;
return b}function x(b){
   for(var a=l.length-1;
a>=0;
a--)if(l[a].elmt==b)return a;
return -1}function I(){
   h=b;
var O=s,Ab=V,bc=t,sb=n,A=Q;
while(A.length>0){
   var f=A.pop();
f.beingDrawn=b}var pb=u.getContainerSize(),nb=pb.x,mb=pb.y;
if(sb){
   O.width=nb;
O.height=mb;
Ab.clearRect(0,0,nb,mb)}else O.innerHTML=e;
var lb=u.getBounds(a),q=lb.getTopLeft(),p=lb.getBottomRight();
if(!Seadragon.Config.wrapHorizontal&&(p.x<0||q.x>1))return;
else if(!Seadragon.Config.wrapVertical&&(p.y<0||q.y>z))return;
var Mb=J,D=E,Xb=W,Tb=P,G=L,Jb=F,Fb=r,Nb=M,Ib=C,Wb=o===Seadragon.Browser.CHROME,Zb=Math.abs,cc=Math.ceil,eb=Math.floor,X=Math.log,gb=Math.max,i=Math.min,m=u.deltaPixelsFromPoints,B=u.pixelFromPoint,kb=d.getTileAtPoint,Ob=Seadragon.Config.alwaysBlend,Y=1e3*Seadragon.Config.blendTime,Gb=Seadragon.Config.immediateRender,ab=Seadragon.Config.minZoomDimension,ac=Seadragon.Config.minImageRatio,Z=Seadragon.Config.wrapHorizontal,bb=Seadragon.Config.wrapVertical,qb=Seadragon.Config.wrapOverlays;
if(!Z){
   q.x=gb(q.x,0);
p.x=i(p.x,1)}if(!bb){
   q.y=gb(q.y,0);
p.y=i(p.y,z)}var U=c,K=b,w=(new Date).getTime(),hb=u.getCenter(),Db=B(hb),Sb=m(D(0),b).x,ib=Gb?1:Sb;
ab=ab||64;
var I=gb(T,eb(X(ab)/X(2))),Rb=m(D(0),a).x,ob=i(S,eb(X(Rb/v)/X(2)));
I=i(I,ob);
for(var g=ob;
g>=I;
g--){
   var ub=b,jb=m(D(g),a).x;
if(!K&&jb>=v||g==I){
   ub=a;
K=a}else if(!K)continue;
Jb(g);
var Kb=i(1,(jb-.5)/.5),Eb=m(D(g),b).x,Hb=ib/Zb(ib-Eb),Cb=kb(g,q),x=kb(g,p),zb=Mb(g),vb=zb.x,wb=zb.y;
if(!Z)x.x=i(x.x,vb-1);
if(!bb)x.y=i(x.y,wb-1);
for(var j=Cb.x;
j<=x.x;
j++)for(var k=Cb.y;
k<=x.y;
k++){
   var f=Xb(g,j,k,w,vb,wb),cb=ub;
G(g,j,k,b);
if(!f.exists)continue;
if(K&&!cb)if(Tb(g,j,k))G(g,j,k,a);
else cb=a;
if(!cb)continue;
var yb=f.bounds.getTopLeft(),rb=f.bounds.getSize(),Ub=B(yb,a),fb=m(rb,a);
if(!Nb)fb=fb.plus(new Seadragon.Point(1,1));
var Vb=B(yb,b),Yb=m(rb,b),Qb=Vb.plus(Yb.divide(2)),Lb=Db.distanceTo(Qb);
f.position=Ub;
f.size=fb;
f.distance=Lb;
f.visibility=Hb;
if(f.loaded){
   if(!f.blendStart)f.blendStart=w;
var tb=w-f.blendStart,db=Y===0?1:i(1,tb/Y);
if(Ob)db*=Kb;
f.opacity=db;
A.push(f);
if(db>=1){
   G(g,j,k,a);
Wb&&f.lastDrawnTime!==Ib&&G(g,j,k,b)}else if(tb<Y)h=a;
f.lastDrawnTime=w}else if(!f.loading)U=H(U,f)}if(Fb(g))break}for(var y=A.length-1;
y>=0;
y--){
   var f=A[y];
if(sb)f.drawCanvas(Ab);
else f.drawHTML(O);
f.beingDrawn=a}for(var Pb=l.length,y=0;
y<Pb;
y++){
   var N=l[y],Bb=N.bounds,xb=Bb.getTopLeft();
if(qb&&Z)xb.x+=eb(hb.x);
if(qb&&bb);
N.position=B(xb,a);
N.size=m(Bb.getSize(),a);
N.drawHTML(t)}if(U){
   R(U,w);
h=a}C=w}f.addOverlay=function(b,d,c){
   var b=Seadragon.Utils.getElement(b);
if(x(b)>=0)return;
l.push(new p(b,d,c));
h=a};
f.updateOverlay=function(b,e,d){
   var b=Seadragon.Utils.getElement(b),c=x(b);
if(c>=0){
   l[c].update(e,d);
h=a}};
f.removeOverlay=function(c){
   var c=Seadragon.Utils.getElement(c),b=x(c);
if(b>=0){
   l[b].destroy();
l.splice(b,1);
h=a}};
f.clearOverlays=function(){
   while(l.length>0){
   l.pop().destroy();
h=a}};
f.needsUpdate=function(){
   return h};
f.numTilesLoaded=function(){
   return q.length};
f.reset=function(){
   N();
D=(new Date).getTime();
h=a};
f.update=function(){
   B.beginUpdate();
A=a;
I();
A=b;
B.endUpdate()};
f.idle=function(){
   }}})();
(function(){
   var c=false,a=null,b=true,e="none",d="100%",h="inline-block",q="----seadragon----",t=Seadragon.Utils.getBrowser(),f={
   NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4};
Seadragon.ControlAnchor=f;
function s(c,b,a){
   if(b==f.TOP_RIGHT||b==f.BOTTOM_RIGHT)a.insertBefore(c,a.firstChild);
else a.appendChild(c)}function g(g,c,e){
   var b=this,a=Seadragon.Utils.makeNeutralElement("span");
b.elmt=g;
b.anchor=c;
b.container=e;
b.wrapper=a;
a.style.display=h;
a.appendChild(g);
if(c==f.NONE)a.style.width=a.style.height=d;
s(a,c,e)}g.prototype.destroy=function(){
   var a=this;
a.wrapper.removeChild(a.elmt);
a.container.removeChild(a.wrapper)};
g.prototype.isVisible=function(){
   return this.wrapper.style.display!=e};
g.prototype.setVisible=function(a){
   this.wrapper.style.display=a?h:e};
g.prototype.setOpacity=function(a){
   if(this.elmt[q]&&t==Seadragon.Browser.IE)Seadragon.Utils.setElementOpacity(this.elmt,a,b);
else Seadragon.Utils.setElementOpacity(this.wrapper,a,b)};
var i="fullpage",o="home",k="zoomin",j="zoomout",p="_rest.png",l="_grouphover.png",m="_hover.png",n="_pressed.png";
function r(d){
   var g=a,f=c,t=a,h=a;
function E(){
   d.viewport&&d.viewport.goHome()}function y(){
   d.setFullPage(!d.isFullPage());
g.emulateExit();
d.viewport&&d.viewport.applyConstraints()}function v(){
   h=(new Date).getTime();
t=Seadragon.Config.zoomPerSecond;
f=b;
s()}function u(){
   h=(new Date).getTime();
t=1/Seadragon.Config.zoomPerSecond;
f=b;
s()}function r(){
   f=c}function s(){
   window.setTimeout(C,10)}function C(){
   if(f&&d.viewport){
   var a=(new Date).getTime(),c=a-h,b=Math.pow(t,c/1e3);
d.viewport.zoomBy(b);
d.viewport.applyConstraints();
h=a;
s()}}function x(){
   if(d.viewport){
   f=c;
d.viewport.zoomBy(Seadragon.Config.zoomPerClick/1);
d.viewport.applyConstraints()}}function w(){
   if(d.viewport){
   f=c;
d.viewport.zoomBy(1/Seadragon.Config.zoomPerClick);
d.viewport.applyConstraints()}}function A(){
   g.emulateEnter();
g.emulateExit()}function e(b,a){
   return Seadragon.Config.imagePath+b+a}var F=new Seadragon.Button(Seadragon.Strings.getString("Tooltips.ZoomIn"),e(k,p),e(k,l),e(k,m),e(k,n),v,r,x,v,r),B=new Seadragon.Button(Seadragon.Strings.getString("Tooltips.ZoomOut"),e(j,p),e(j,l),e(j,m),e(j,n),u,r,w,u,r),D=new Seadragon.Button(Seadragon.Strings.getString("Tooltips.Home"),e(o,p),e(o,l),e(o,m),e(o,n),a,E,a,a,a),z=new Seadragon.Button(Seadragon.Strings.getString("Tooltips.FullPage"),e(i,p),e(i,l),e(i,m),e(i,n),a,y,a,a,a);
g=new Seadragon.ButtonGroup([F,B,D,z]);
g.elmt[q]=b;
d.addEventListener("open",A);
return g.elmt}Seadragon.Viewer=function(k){
   var t="absolute",m="hidden",l="relative",o="div",h=this,j=h,A=Seadragon.Utils.getElement(k),k=Seadragon.Utils.makeNeutralElement(o),u=Seadragon.Utils.makeNeutralElement(o),L=Seadragon.Utils.makeNeutralElement(o),M=Seadragon.Utils.makeNeutralElement(o),K=Seadragon.Utils.makeNeutralElement(o),J=Seadragon.Utils.makeNeutralElement(o),q=a,x=a,i=a,z=a,p=new Seadragon.EventManager,v=new Seadragon.MouseTracker(u),D=new Seadragon.MouseTracker(k),n=[],H=b,P=a,y=a,R=1e3,fb=2e3,P=a,H=c,db=document.body.style.width,bb=document.body.style.height,Y=document.body.style.overflow,Z=document.documentElement.style.overflow,I=new Seadragon.Point(1,1),s=a,C=0,U=0,w=c,E=c,F=c;
h.container=A;
h.elmt=k;
h.source=a;
h.drawer=a;
h.viewport=a;
h.profiler=a;
h.tracker=v;
function nb(){
   var a="0px",e=u.style,c=k.style,i=L.style,n=M.style,h=K.style,g=J.style;
c.width=d;
c.height=d;
c.position=l;
c.left=a;
c.top=a;
c.textAlign="left";
e.width=d;
e.height=d;
e.overflow=m;
e.position=t;
e.top=a;
e.left=a;
i.position=n.position=h.position=g.position=t;
i.top=n.top=a;
i.left=g.left=a;
n.right=h.right=a;
g.bottom=h.bottom=a;
v.clickHandler=kb;
v.dragHandler=lb;
v.releaseHandler=ib;
v.scrollHandler=jb;
v.setTracking(b);
y=r(j);
y.style.marginRight="4px";
y.style.marginBottom="4px";
j.addControl(y,f.BOTTOM_RIGHT);
D.enterHandler=S;
D.exitHandler=V;
D.releaseHandler=gb;
D.setTracking(b);
window.setTimeout(B,1);
k.appendChild(u);
k.appendChild(L);
k.appendChild(M);
k.appendChild(K);
k.appendChild(J);
A.innerHTML="";
A.appendChild(k)}function G(d){
   var a="normal",c=document.createTextNode(d);
u.innerHTML="";
u.appendChild(Seadragon.Utils.makeCenteredNode(c));
var b=c.parentNode.style;
b.fontFamily="verdana";
b.fontSize="13px";
b.fontSizeAdjust=e;
b.fontStyle=a;
b.fontStretch=a;
b.fontVariant=a;
b.fontWeight=a;
b.lineHeight="1em";
b.textAlign="center";
b.textDecoration=e}function ab(){
   q&&eb();
C=(new Date).getTime();
window.setTimeout(function(){
   C>U&&G(Seadragon.Strings.getString("Messages.Loading"))},2e3);
return C}function N(e,a,d){
   U=(new Date).getTime();
if(e<C){
   Seadragon.Debug.log("Ignoring out-of-date open.");
p.trigger("ignore",j);
return}else if(!a){
   G(d);
p.trigger("error",j);
return}u.innerHTML="";
s=Seadragon.Utils.getElementSize(k);
if(s.x===0||s.y===0){
   window.setTimeout(function(){
   N(e,a,d)},10);
return}q=a;
i=new Seadragon.Viewport(s,q.dimensions);
x=new Seadragon.Drawer(q,i,u);
z=new Seadragon.Profiler;
j.source=q;
j.viewport=i;
j.drawer=x;
j.profiler=z;
w=c;
E=b;
W(mb);
p.trigger("open",j)}function eb(){
   j.source=q=a;
j.viewport=i=a;
j.drawer=x=a;
j.profiler=z=a;
u.innerHTML=""}function W(c,a){
   if(w)return window.setTimeout(c,1);
var b=(new Date).getTime(),a=a?a:b,d=a+1e3/60,e=Math.max(1,d-b);
return window.setTimeout(c,e)}function cb(){
   if(!q)return;
z.beginUpdate();
var a=Seadragon.Utils.getElementSize(k);
if(!a.equals(s)&&a.x>0&&a.y>0){
   i.resize(a,b);
s=a;
p.trigger("resize",j)}var d=i.update();
if(!w&&d){
   p.trigger("animationstart",j);
O()}if(d){
   x.update();
p.trigger("animation",j)}else if(E||x.needsUpdate()){
   x.update();
E=c}else x.idle();
if(w&&!d){
   p.trigger("animationfinish",j);
!F&&B()}w=d;
z.endUpdate()}function mb(){
   if(!q)return;
var a=(new Date).getTime();
cb();
W(arguments.callee,a)}function T(b){
   for(var a=n.length-1;
a>=0;
a--)if(n[a].elmt==b)return a;
return -1}function Q(){
   window.setTimeout(hb,20)}function hb(){
   if(H){
   var c=(new Date).getTime(),d=c-P,a=1-d/fb;
a=Math.min(1,a);
a=Math.max(0,a);
for(var b=n.length-1;
b>=0;
b--)n[b].setOpacity(a);
a>0&&Q()}}function O(){
   H=c;
for(var a=n.length-1;
a>=0;
a--)n[a].setOpacity(1)}function B(){
   if(!Seadragon.Config.autoHideControls)return;
H=b;
P=(new Date).getTime()+R;
window.setTimeout(Q,R)}function S(){
   F=b;
O()}function V(e,d,a){
   if(!a){
   F=c;
!w&&B()}}function gb(e,d,b,a){
   if(!a){
   F=c;
!w&&B()}}function kb(g,c,e,f){
   if(i&&e){
   var a=Seadragon.Config.zoomPerClick,d=f?1/a:a;
i.zoomBy(d,i.pointFromPixel(c,b));
i.applyConstraints()}}function lb(c,b,a){
   i&&i.panBy(i.deltaPointsFromPixels(a.negate()))}function ib(d,c,a){
   a&&i&&i.applyConstraints()}function jb(e,a,d){
   if(i){
   var c=Math.pow(Seadragon.Config.zoomPerScroll,d);
i.zoomBy(c,i.pointFromPixel(a,b));
i.applyConstraints()}}function X(a){
   a=Seadragon.Utils.getEvent(a);
a.keyCode===27&&j.setFullPage(c)}h.isOpen=function(){
   return !!q};
h.openDzi=function(b,e){
   var d=ab(),c=Seadragon.Utils.createCallback(a,N,d);
switch(typeof b){
   case "string":Seadragon.DziTileSource.createFromXml(b,e,c);
break;
default:Seadragon.DziTileSource.createFromJson(b,c)}};
h.openTileSource=function(b){
   var a=ab();
window.setTimeout(function(){
   N(a,b)},1)};
h.close=function(){
   if(!q)return;
eb()};
h.addControl=function(b,d){
   var b=Seadragon.Utils.getElement(b);
if(T(b)>=0)return;
var c=a;
switch(d){
   case f.TOP_RIGHT:c=M;
b.style.position=l;
break;
case f.BOTTOM_RIGHT:c=K;
b.style.position=l;
break;
case f.BOTTOM_LEFT:c=J;
b.style.position=l;
break;
case f.TOP_LEFT:c=L;
b.style.position=l;
break;
case f.NONE:default:c=k;
b.style.position=t}n.push(new g(b,d,c))};
h.removeControl=function(b){
   var b=Seadragon.Utils.getElement(b),a=T(b);
if(a>=0){
   n[a].destroy();
n.splice(a,1)}};
h.clearControls=function(){
   while(n.length>0)n.pop().destroy()};
h.getNavControl=function(){
   return y};
h.isDashboardEnabled=function(){
   for(var a=n.length-1;
a>=0;
a--)if(n[a].isVisible())return b;
return c};
h.isFullPage=function(){
   return k.parentNode==document.body};
h.isMouseNavEnabled=function(){
   return v.isTracking()};
h.isVisible=function(){
   return k.style.visibility!=m};
h.setDashboardEnabled=function(b){
   for(var a=n.length-1;
a>=0;
a--)n[a].setVisible(b)};
h.setFullPage=function(h){
   if(h==j.isFullPage())return;
var q=document.body,c=q.style,g=document.documentElement.style,e=k.style,f=u.style;
if(h){
   Y=c.overflow;
Z=g.overflow;
c.overflow=m;
g.overflow=m;
db=c.width;
bb=c.height;
c.width=d;
c.height=d;
f.backgroundColor="black";
f.color="white";
e.position="fixed";
e.zIndex="99999999";
q.appendChild(k);
s=Seadragon.Utils.getWindowSize();
Seadragon.Utils.addEvent(document,"keydown",X);
S()}else{
   c.overflow=Y;
g.overflow=Z;
c.width=db;
c.height=bb;
f.backgroundColor="";
f.color="";
e.position=l;
e.zIndex="";
A.appendChild(k);
s=Seadragon.Utils.getElementSize(A);
Seadragon.Utils.removeEvent(document,"keydown",X);
V()}if(i){
   var o=i.getBounds();
i.resize(s);
var n=i.getBounds();
if(h)I=new Seadragon.Point(n.width/o.width,n.height/o.height);
else{
   i.update();
i.zoomBy(Math.max(I.x,I.y),a,b)}E=b;
p.trigger("resize",j);
cb()}};
h.setMouseNavEnabled=function(a){
   v.setTracking(a)};
h.setVisible=function(a){
   k.style.visibility=a?"":m};
h.showMessage=function(a,b){
   if(!b){
   G(a);
return}window.setTimeout(function(){
   !j.isOpen()&&G(a)},b)};
h.addEventListener=function(a,b){
   p.addListener(a,b)};
h.removeEventListener=function(a,b){
   p.removeListener(a,b)};
nb()}})();
Seadragon.Config.imagePath="http://seadragon.com/ajax/0.8/img/"

