Skip to content

Instantly share code, notes, and snippets.

@gasi
Created March 2, 2016 04:07
Show Gist options
  • Save gasi/e52f1c048261689331f4 to your computer and use it in GitHub Desktop.
Save gasi/e52f1c048261689331f4 to your computer and use it in GitHub Desktop.
Seadragon.com Viewer for content ID **h**
/*
FILE ARCHIVED ON 0:36:48 Aug 2, 2014 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 2:31:05 Feb 28, 2016.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
/**
* Zoom.it Embed (build 65069 on 2011-02-04)
* Copyright (c) Microsoft Corporation. All rights reserved.
* To learn more and create your own, visit: /web/20140802003648/http://zoom.it/
*/
(function(h, r, g, N) {
var l = "100%",
p = 10,
w = "absolute",
u = "relative",
o = "hidden",
L = " while executing ",
f = "function",
D = "mousewheel",
k = "px",
C = "inline-block",
F = "span",
j = "0px",
B = "none",
s = "div",
H = "fixed",
J = "undefined",
z = ",",
n = "number",
d = "",
I = "string",
b = null,
a = true,
t = .5,
c = false;
if (!h.Seadragon) h.Seadragon = {};
var v = h.Seadragon,
i = v.Config;
(function() {
if (i) return;
i = v.Config = {
debugMode: c,
animationTime: 1.5,
blendTime: t,
alwaysBlend: c,
autoHideControls: a,
constrainDuringPan: a,
immediateRender: c,
logarithmicZoom: a,
wrapHorizontal: c,
wrapVertical: c,
wrapOverlays: c,
transformOverlays: c,
minZoomDimension: b,
minZoomImageRatio: .8,
maxZoomPixelRatio: 2,
visibilityRatio: .8,
springStiffness: 5,
imageLoaderLimit: 2,
clickTimeThreshold: 200,
clickDistThreshold: 5,
zoomPerClick: 2,
zoomPerScroll: g.pow(2, 1 / 3),
zoomPerSecond: 2,
proxyUrl: b,
imagePath: "img/"
}
})();
var x = v.Strings;
(function() {
var a = "Hmm, this doesn't appear to be a valid Deep Zoom Image.";
if (x) return;
x = v.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)"
}
};
x.getString = function(f) {
for (var c = f.split("."), a = x, b = 0; b < c.length; b++) a = a[c[b]] || {};
if (typeof a != I) a = d;
var e = arguments;
return a.replace(/\{\d+\}/g, function(b) {
var a = parseInt(b.match(/\d+/)) + 1;
return a < e.length ? e[a] : d
})
};
x.setString = function(e, d) {
for (var c = e.split("."), b = x, a = 0; a < c.length - 1; a++) {
if (!b[c[a]]) b[c[a]] = {};
b = b[c[a]]
}
b[c[a]] = d
}
})();
var q = function() {
this.log = function(c, d) {
var a = h.console || {},
b = i.debugMode;
if (b && a.log) a.log(c);
else b && d && alert(c)
};
this.error = function(b, d) {
var c = h.console || {},
a = i.debugMode;
if (a && c.error) c.error(b);
else a && alert(b);
if (a) throw d || new Error(b)
};
this.fail = function(a) {
alert(x.getString("Errors.Failure"));
throw new Error(a)
}
};
q = v.Debug = new q;
var U = v.Profiler = function() {
var d = this,
o = d,
f = c,
e = 0,
h = b,
l = b,
j = Infinity,
g = 0,
i = 0,
n = Infinity,
k = 0,
m = 0;
d.getAvgUpdateTime = function() {
return g
};
d.getMinUpdateTime = function() {
return j
};
d.getMaxUpdateTime = function() {
return i
};
d.getAvgIdleTime = function() {
return k
};
d.getMinIdleTime = function() {
return n
};
d.getMaxIdleTime = function() {
return m
};
d.isMidUpdate = function() {
return f
};
d.getNumUpdates = function() {
return e
};
d.beginUpdate = function() {
f && o.endUpdate();
f = a;
h = (new Date).getTime();
if (e < 1) return;
var b = h - l;
k = (k * (e - 1) + b) / e;
if (b < n) n = b;
if (b > m) m = b
};
d.endUpdate = function() {
if (!f) return;
l = (new Date).getTime();
f = c;
var a = l - h;
e++;
g = (g * (e - 1) + a) / e;
if (a < j) j = a;
if (a > i) i = a
};
d.clearProfile = function() {
f = c;
e = 0;
h = b;
l = b;
j = Infinity;
g = 0;
i = 0;
n = Infinity;
k = 0;
m = 0
}
},
m = v.Point;
(function() {
if (m) return;
m = v.Point = function(a, b) {
this.x = typeof a == n ? a : 0;
this.y = typeof b == n ? b : 0
};
var a = m.prototype;
a.plus = function(a) {
return new m(this.x + a.x, this.y + a.y)
};
a.minus = function(a) {
return new m(this.x - a.x, this.y - a.y)
};
a.times = function(a) {
return new m(this.x * a, this.y * a)
};
a.divide = function(a) {
return new m(this.x / a, this.y / a)
};
a.negate = function() {
return new m(-this.x, -this.y)
};
a.distanceTo = function(a) {
return g.sqrt(g.pow(this.x - a.x, 2) + g.pow(this.y - a.y, 2))
};
a.apply = function(a) {
return new m(a(this.x), a(this.y))
};
a.equals = function(a) {
return a instanceof m && this.x === a.x && this.y === a.y
};
a.toString = function() {
return "(" + this.x + z + this.y + ")"
}
})();
var y = v.Rect;
(function() {
if (y) return;
y = v.Rect = function(d, e, c, b) {
var a = this;
a.x = typeof d == n ? d : 0;
a.y = typeof e == n ? e : 0;
a.width = typeof c == n ? c : 0;
a.height = typeof b == n ? b : 0
};
var a = y.prototype;
a.getAspectRatio = function() {
return this.width / this.height
};
a.getTopLeft = function() {
return new m(this.x, this.y)
};
a.getBottomRight = function() {
var a = this;
return new m(a.x + a.width, a.y + a.height)
};
a.getCenter = function() {
var a = this;
return new m(a.x + a.width / 2, a.y + a.height / 2)
};
a.getSize = function() {
return new m(this.width, this.height)
};
a.equals = function(a) {
var b = this;
return a instanceof y && 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 + z + a.y + z + a.width + "x" + a.height + "]"
}
})();
var Q = v.Spring = function(j) {
var c = this,
d = typeof j == n ? j : 0,
e = d,
b = d,
a = (new Date).getTime(),
h = a,
f = a;
function k(b) {
var a = i.springStiffness;
return (1 - g.exp(-b * a)) / (1 - g.exp(-a))
}
c.getCurrent = function() {
return d
};
c.getTarget = function() {
return b
};
c.resetTo = function(c) {
b = c;
f = a;
e = b;
h = f
};
c.springTo = function(c) {
e = d;
h = a;
b = c;
f = h + 1e3 * i.animationTime
};
c.shiftBy = function(a) {
e += a;
b += a
};
c.update = function() {
a = (new Date).getTime();
d = a >= f ? b : e + (b - e) * k((a - h) / (f - h))
}
},
A = v.Browser = {
UNKNOWN: 0,
IE: 1,
FIREFOX: 2,
SAFARI: 3,
CHROME: 4,
OPERA: 5
},
e = function() {
var t = "DOMMouseScroll",
l = this,
o = l,
x = ["Msxml2.XMLHTTP", "Msxml3.XMLHTTP", "Microsoft.XMLHTTP"],
z = {
bmp: c,
jpeg: a,
jpg: a,
png: a,
tif: c,
wdp: c
},
u = A.UNKNOWN,
p = 0,
v = c,
y = {};
(function() {
var d = navigator.appName,
o = navigator.appVersion,
a = navigator.userAgent;
if (d == "Microsoft Internet Explorer" && !!h.attachEvent && !!h.ActiveXObject) {
var i = a.indexOf("MSIE");
u = A.IE;
p = parseFloat(a.substring(i + 5, a.indexOf(";", i)));
var j = r.documentMode;
if (typeof j !== J) p = j
} else if (d == "Netscape" && !!h.addEventListener) {
var g = a.indexOf("Firefox"),
b = a.indexOf("Safari"),
l = a.indexOf("Chrome");
if (g >= 0) {
u = A.FIREFOX;
p = parseFloat(a.substring(g + 8))
} else if (b >= 0) {
var n = a.substring(0, b).lastIndexOf("/");
u = l >= 0 ? A.CHROME : A.SAFARI;
p = parseFloat(a.substring(n + 1, b))
}
} else if (d == "Opera" && !!h.opera && !!h.attachEvent) {
u = A.OPERA;
p = parseFloat(o)
}
for (var m = h.location.search.substring(1), k = m.split("&"), f = 0; f < k.length; f++) {
var c = k[f],
e = c.indexOf("=");
if (e > 0) y[c.substring(0, e)] = decodeURIComponent(c.substring(e + 1))
}
v = u == A.IE && p < 9 || u == A.CHROME && p < 2
})();
function w(a, b) {
if (b && a != r.body) return r.body;
else return a.offsetParent
}
l.getBrowser = function() {
return u
};
l.getBrowserVersion = function() {
return p
};
l.getElement = function(a) {
if (typeof a == I) a = r.getElementById(a);
return a
};
l.getElementPosition = function(a) {
var a = o.getElement(a),
b = new m,
c = o.getElementStyle(a).position == H,
d = w(a, c);
while (d) {
b.x += a.offsetLeft;
b.y += a.offsetTop;
if (c) b = b.plus(o.getPageScroll());
a = d;
c = o.getElementStyle(a).position == H;
d = w(a, c)
}
return b
};
l.getElementSize = function(a) {
var a = o.getElement(a);
return new m(a.clientWidth, a.clientHeight)
};
l.getElementStyle = function(a) {
var a = o.getElement(a);
if (a.currentStyle) return a.currentStyle;
else if (h.getComputedStyle) return h.getComputedStyle(a, d);
else q.fail("Unknown element style, no known technique.")
};
l.getEvent = function(a) {
return a ? a : h.event
};
l.getMousePosition = function(a) {
var a = o.getEvent(a),
b = new m;
if (a.type == t && u == A.FIREFOX && p < 3) {
b.x = a.screenX;
b.y = a.screenY
} else if (typeof a.pageX == n) {
b.x = a.pageX;
b.y = a.pageY
} else if (typeof a.clientX == n) {
b.x = a.clientX + r.body.scrollLeft + r.documentElement.scrollLeft;
b.y = a.clientY + r.body.scrollTop + r.documentElement.scrollTop
} else q.fail("Unknown event mouse position, no known technique.");
return b
};
l.getMouseScroll = function(b) {
var b = o.getEvent(b),
a = 0;
if (typeof b.wheelDelta == n) a = b.wheelDelta;
else if (typeof b.detail == n) a = b.detail * -1;
else q.fail("Unknown event mouse scroll, no known technique.");
return a ? a / g.abs(a) : 0
};
l.getPageScroll = function() {
var a = new m,
b = r.documentElement || {},
c = r.body || {};
if (typeof h.pageXOffset == n) {
a.x = h.pageXOffset;
a.y = h.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
};
l.getWindowSize = function() {
var a = new m,
b = r.documentElement || {},
c = r.body || {};
if (typeof h.innerWidth == n) {
a.x = h.innerWidth;
a.y = h.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 q.fail("Unknown window size, no known technique.");
return a
};
l.imageFormatSupported = function(a) {
var a = a ? a : d;
return !!z[a.toLowerCase()]
};
l.makeCenteredNode = function(h) {
var b = "border:none; margin:0px; padding:0px;",
h = e.getElement(h),
c = o.makeNeutralElement(s),
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>');
c.innerHTML = a.join(d);
c = c.firstChild;
var g = c,
f = c.getElementsByTagName(s);
while (f.length > 0) {
g = f[0];
f = g.getElementsByTagName(s)
}
g.appendChild(h);
return c
};
l.makeNeutralElement = function(c) {
var b = r.createElement(c),
a = b.style;
a.background = "transparent none";
a.border = B;
a.margin = j;
a.padding = j;
a.position = "static";
return b
};
l.makeTransparentImage = function(d) {
var c = o.makeNeutralElement("img"),
a = b;
if (u == A.IE && p < 7) {
a = o.makeNeutralElement(F);
a.style.display = C;
c.onload = function() {
a.style.width = a.style.width || c.width + k;
a.style.height = a.style.height || c.height + k;
c.onload = b;
c = b
};
c.src = d;
a.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + d + "', sizingMethod='scale')"
} else {
a = c;
a.src = d
}
return a
};
l.setElementOpacity = function(b, a, f) {
var b = o.getElement(b);
if (f && v) a = g.round(a);
if (a < 1) b.style.opacity = a;
else b.style.opacity = d;
var c = b.style.filter || d;
b.style.filter = c.replace(/[\s]*alpha\(.*?\)[\s]*/g, d);
if (a >= 1) return;
var e = g.round(100 * a),
h = " alpha(opacity=" + e + ") ";
b.style.filter += h
};
l.addEvent = function(a, c, d, b) {
var a = o.getElement(a);
if (a.addEventListener) {
c == D && a.addEventListener(t, d, b);
a.addEventListener(c, d, b)
} else if (a.attachEvent) {
a.attachEvent("on" + c, d);
b && a.setCapture && a.setCapture()
} else q.fail("Unable to attach event handler, no known technique.")
};
l.removeEvent = function(a, c, d, b) {
var a = o.getElement(a);
if (a.removeEventListener) {
c == D && a.removeEventListener(t, d, b);
a.removeEventListener(c, d, b)
} else if (a.detachEvent) {
a.detachEvent("on" + c, d);
b && a.releaseCapture && a.releaseCapture()
} else q.fail("Unable to detach event handler, no known technique.")
};
l.cancelEvent = function(b) {
var b = o.getEvent(b);
b.preventDefault && b.preventDefault();
b.cancel = a;
b.returnValue = c
};
l.stopEvent = function(b) {
var b = o.getEvent(b);
b.stopPropagation && b.stopPropagation();
b.cancelBubble = a
};
l.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)
}
};
l.getUrlParameter = function(c) {
var a = y[c];
return a ? a : b
};
l.makeAjaxRequest = function(j, d) {
var c = typeof d == f,
a = b;
if (c) var l = d,
d = function() {
h.setTimeout(e.createCallback(b, l, a), 1)
};
if (h.ActiveXObject)
for (var k = 0; k < x.length; k++) try {
a = new ActiveXObject(x[k]);
break
} catch (g) {
continue
} else if (h.XMLHttpRequest) a = new XMLHttpRequest;
!a && q.fail("Browser doesn't support XMLHttpRequest.");
if (i.proxyUrl) j = i.proxyUrl + j;
if (c) a.onreadystatechange = function() {
if (a.readyState == 4) {
a.onreadystatechange = new Function;
d()
}
};
try {
a.open("GET", j, c);
a.send(b)
} catch (g) {
q.log(g.name + " while making AJAX request: " + g.message);
a.onreadystatechange = b;
a = b;
c && d()
}
return c ? b : a
};
l.parseXml = function(e) {
var d = b;
if (h.ActiveXObject) try {
d = new ActiveXObject("Microsoft.XMLDOM");
d.async = c;
d.loadXML(e)
} catch (a) {
q.log(a.name + " while parsing XML (ActiveX): " + a.message)
} else if (h.DOMParser) try {
var f = new DOMParser;
d = f.parseFromString(e, "text/xml")
} catch (a) {
q.log(a.name + " while parsing XML (DOMParser): " + a.message)
} else q.fail("Browser doesn't support XML DOM.");
return d
}
};
e = v.Utils = new e;
var M = v.MouseTracker;
(function() {
var d = "mouseup",
j = "mousedown";
if (M) return;
var l = e.getBrowser() == A.IE && e.getBrowserVersion() < 9,
o = c,
t = c,
s = {},
m = [];
function p(a) {
return e.getMousePosition(a)
}
function k(b, d) {
var c = e.getMousePosition(b),
a = e.getElementPosition(d);
return c.minus(a)
}
function n(b, a) {
var d = r.body;
while (a && b != a && d != a) try {
a = a.parentNode
} catch (e) {
return c
}
return b == a
}
function u() {
o = a
}
function w() {
o = c
}(function() {
if (l) {
e.addEvent(r, j, u, c);
e.addEvent(r, d, w, c)
} else {
e.addEvent(h, j, u, a);
e.addEvent(h, d, w, a)
}
})();
M = v.MouseTracker = function(u) {
var w = "mousemove",
z = "mouseout",
y = "mouseover",
x = this,
v = x,
H = b,
M = g.random(),
u = e.getElement(u),
F = c,
A = c,
C = c,
E = c,
G = b,
O = b,
N = b;
x.target = u;
x.enterHandler = b;
x.exitHandler = b;
x.pressHandler = b;
x.releaseHandler = b;
x.clickHandler = b;
x.dragHandler = b;
x.scrollHandler = b;
function X() {
if (!F) {
e.addEvent(u, y, K, c);
e.addEvent(u, z, L, c);
e.addEvent(u, j, U, c);
e.addEvent(u, d, B, c);
e.addEvent(u, D, R, c);
e.addEvent(u, "click", T, c);
F = a;
s[M] = H
}
}
function Z() {
if (F) {
e.removeEvent(u, y, K, c);
e.removeEvent(u, z, L, c);
e.removeEvent(u, j, U, c);
e.removeEvent(u, d, B, c);
e.removeEvent(u, D, R, c);
e.removeEvent(u, "click", T, c);
I();
F = c;
delete s[M]
}
}
function Y() {
if (!A) {
if (l) {
e.removeEvent(u, d, B, c);
e.addEvent(u, d, V, a);
e.addEvent(u, w, Q, a)
} else {
e.addEvent(h, d, P, a);
e.addEvent(h, w, J, a)
}
A = a
}
}
function I() {
if (A) {
if (l) {
e.removeEvent(u, w, Q, a);
e.removeEvent(u, d, V, a);
e.addEvent(u, d, B, c)
} else {
e.removeEvent(h, w, J, a);
e.removeEvent(h, d, P, a)
}
A = c
}
}
function S(c, d) {
var b = s;
for (var a in b) b.hasOwnProperty(a) && M != a && b[a][c](d)
}
function ab() {
return E
}
function K(b) {
var b = e.getEvent(b);
l && A && !n(b.srcElement, u) && S("onMouseOver", b);
var g = b.target ? b.target : b.srcElement,
d = b.relatedTarget ? b.relatedTarget : b.fromElement;
if (!n(u, g) || n(u, d)) return;
E = a;
if (typeof v.enterHandler == f) try {
v.enterHandler(v, k(b, u), C, o)
} catch (c) {
q.error(c.name + " while executing enter handler: " + c.message, c)
}
}
function L(a) {
var a = e.getEvent(a);
l && A && !n(a.srcElement, u) && S("onMouseOut", a);
var d = a.target ? a.target : a.srcElement,
g = a.relatedTarget ? a.relatedTarget : a.toElement;
if (!n(u, d) || n(u, g)) return;
E = c;
if (typeof v.exitHandler == f) try {
v.exitHandler(v, k(a, u), C, o)
} catch (b) {
q.error(b.name + " while executing exit handler: " + b.message, b)
}
}
function U(b) {
var b = e.getEvent(b);
if (b.button == 2) return;
C = a;
G = p(b);
N = G;
O = (new Date).getTime();
if (typeof v.pressHandler == f) try {
v.pressHandler(v, k(b, u))
} catch (c) {
q.error(c.name + " while executing press handler: " + c.message, c)
}(v.pressHandler || v.dragHandler) && e.cancelEvent(b);
if (!l || !t) {
Y();
t = a;
m = [H]
} else l && m.push(H)
}
function B(a) {
var a = e.getEvent(a),
g = C,
d = E;
if (a.button == 2) return;
C = c;
if (typeof v.releaseHandler == f) try {
v.releaseHandler(v, k(a, u), g, d)
} catch (b) {
q.error(b.name + " while executing release handler: " + b.message, b)
}
g && d && W(a)
}
function V(a) {
var a = e.getEvent(a);
if (a.button == 2) return;
for (var b = 0; b < m.length; b++) {
var d = m[b];
!d.hasMouse() && d.onMouseUp(a)
}
I();
t = c;
a.srcElement.fireEvent("on" + a.type, r.createEventObject(a));
e.stopEvent(a)
}
function P(a) {
!E && B(a);
I()
}
function T(a) {
v.clickHandler && e.cancelEvent(a)
}
function W(a) {
var a = e.getEvent(a);
if (a.button == 2) return;
var h = (new Date).getTime() - O,
d = p(a),
c = N.distanceTo(d),
g = h <= i.clickTimeThreshold && c <= i.clickDistThreshold;
if (typeof v.clickHandler == f) try {
v.clickHandler(v, k(a, u), g, a.shiftKey)
} catch (b) {
q.error(b.name + " while executing click handler: " + b.message, b)
}
}
function J(a) {
var a = e.getEvent(a),
c = p(a),
d = c.minus(G);
G = c;
if (typeof v.dragHandler == f) {
try {
v.dragHandler(v, k(a, u), d, a.shiftKey)
} catch (b) {
q.error(b.name + " while executing drag handler: " + b.message, b)
}
e.cancelEvent(a)
}
}
function Q(b) {
for (var a = 0; a < m.length; a++) m[a].onMouseMove(b);
e.stopEvent(b)
}
function R(a) {
var a = e.getEvent(a),
c = e.getMouseScroll(a);
if (typeof v.scrollHandler == f) {
if (c) try {
v.scrollHandler(v, k(a, u), c, a.shiftKey)
} catch (b) {
q.error(b.name + " while executing scroll handler: " + b.message, b)
}
e.cancelEvent(a)
}
}(function() {
H = {
hasMouse: ab,
onMouseOver: K,
onMouseOut: L,
onMouseUp: B,
onMouseMove: J
}
})();
x.isTracking = function() {
return F
};
x.setTracking = function(a) {
if (a) X();
else Z()
}
}
})();
var W = v.EventManager = function() {
var b = this,
a = {};
b.addListener = function(b, c) {
if (typeof c != f) return;
if (!a[b]) a[b] = [];
a[b].push(c)
};
b.removeListener = function(e, d) {
var b = a[e];
if (typeof d != f) return;
else if (!b) return;
for (var c = 0; c < b.length; c++)
if (d == b[c]) {
b.splice(c, 1);
return
}
};
b.clearListeners = function(b) {
if (a[b]) delete a[b]
};
b.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(h, f)
} catch (c) {
q.error(c.name + L + e + " handler: " + c.message, c)
}
}
},
S;
(function() {
var d = 15000;
function g(i, j) {
var e = b,
f = b;
function g(a) {
e.onload = b;
e.onabort = b;
e.onerror = b;
f && h.clearTimeout(f);
h.setTimeout(function() {
j(i, a ? e : b)
}, 1)
}
this.start = function() {
e = new Image;
var j = function() {
g(a)
},
b = function() {
g(c)
},
k = function() {
q.log("Image timed out: " + i);
g(c)
};
e.onload = j;
e.onabort = b;
e.onerror = b;
f = h.setTimeout(k, d);
e.src = i
}
}
S = v.ImageLoader = function() {
var d = 0;
function h(b, e, c) {
d--;
if (typeof b == f) try {
b(c)
} catch (a) {
q.error(a.name + L + e + " callback: " + a.message, a)
}
}
this.loadImage = function(l, f) {
if (d >= i.imageLoaderLimit) return c;
var j = e.createCallback(b, h, f),
k = new g(l, j);
d++;
k.start();
return a
}
}
})();
var O, R;
(function() {
var i = {
REST: 0,
GROUP: 1,
HOVER: 2,
DOWN: 3
};
O = v.Button = function(W, V, S, T, U, y, q, v, x, z) {
var l = e.makeNeutralElement(F),
k = i.GROUP,
m = new M(l),
H = e.makeTransparentImage(V),
r = e.makeTransparentImage(S),
s = e.makeTransparentImage(T),
t = e.makeTransparentImage(U),
y = typeof y == f ? y : b,
q = typeof q == f ? q : b,
v = typeof v == f ? v : b,
x = typeof x == f ? x : b,
z = typeof z == f ? z : b,
G = 0,
P = 2e3,
D = b,
B = c;
this.elmt = l;
function E() {
h.setTimeout(R, 20)
}
function R() {
if (B) {
var c = (new Date).getTime(),
d = c - D,
b = 1 - d / P;
b = g.min(1, b);
b = g.max(0, b);
e.setElementOpacity(r, b, a);
b > 0 && E()
}
}
function N() {
B = a;
D = (new Date).getTime() + G;
h.setTimeout(E, G)
}
function Q() {
B = c;
e.setElementOpacity(r, 1, a)
}
function p(a) {
if (a >= i.GROUP && k == i.REST) {
Q();
k = i.GROUP
}
if (a >= i.HOVER && k == i.GROUP) {
s.style.visibility = d;
k = i.HOVER
}
if (a >= i.DOWN && k == i.HOVER) {
t.style.visibility = d;
k = i.DOWN
}
}
function n(a) {
if (a <= i.HOVER && k == i.DOWN) {
t.style.visibility = o;
k = i.HOVER
}
if (a <= i.GROUP && k == i.HOVER) {
s.style.visibility = o;
k = i.GROUP
}
if (a <= i.REST && k == i.GROUP) {
N();
k = i.REST
}
}
function K(d, c, a, b) {
if (a) {
p(i.DOWN);
x && x()
} else !b && p(i.HOVER)
}
function O(d, c, a) {
n(i.GROUP);
a && z && z()
}
function L() {
p(i.DOWN);
y && y()
}
function I(d, c, a, b) {
if (a && b) {
n(i.HOVER);
q && q()
} else if (a) n(i.GROUP);
else p(i.HOVER)
}
function J(c, b, a) {
v && a && v()
}
this.notifyGroupEnter = function() {
p(i.GROUP)
};
this.notifyGroupExit = function() {
n(i.REST)
};
(function() {
l.style.display = C;
l.style.position = u;
l.title = W;
l.appendChild(H);
l.appendChild(r);
l.appendChild(s);
l.appendChild(t);
var g = H.style,
f = r.style,
b = s.style,
c = t.style;
f.position = b.position = c.position = w;
f.top = b.top = c.top = j;
f.left = b.left = c.left = j;
b.visibility = c.visibility = o;
if (e.getBrowser() == A.FIREFOX && e.getBrowserVersion() < 3) f.top = b.top = c.top = d;
m.enterHandler = K;
m.exitHandler = O;
m.pressHandler = L;
m.releaseHandler = I;
m.clickHandler = J;
m.setTracking(a);
n(i.REST)
})()
};
R = v.ButtonGroup = function(b) {
var d = e.makeNeutralElement(F),
b = b.concat([]),
c = new M(d);
this.elmt = d;
function f() {
for (var a = 0; a < b.length; a++) b[a].notifyGroupEnter()
}
function g(f, e, c) {
if (!c)
for (var a = 0; a < b.length; a++) b[a].notifyGroupExit()
}
function h(f, e, d, c) {
if (!c)
for (var a = 0; a < b.length; a++) b[a].notifyGroupExit()
}
this.emulateEnter = function() {
f()
};
this.emulateExit = function() {
g()
};
(function() {
d.style.display = C;
for (var e = 0; e < b.length; e++) d.appendChild(b[e].elmt);
c.enterHandler = f;
c.exitHandler = g;
c.releaseHandler = h;
c.setTracking(a)
})()
}
})();
var T = v.TileSource = function(d, c, i, e, h, f) {
var b = this,
a = b,
j = c / d;
b.width = d;
b.height = c;
b.aspectRatio = d / c;
b.dimensions = new m(d, c);
b.minLevel = h ? h : 0;
b.maxLevel = f ? f : g.ceil(g.log(g.max(d, c)) / g.log(2));
b.tileSize = i ? i : 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 = g.ceil(b * d / a.tileSize),
h = g.ceil(b * c / a.tileSize);
return new m(f, h)
};
b.getPixelRatio = function(c) {
var b = a.dimensions.times(a.getLevelScale(c)),
d = 1 / b.x,
e = 1 / b.y;
return new m(d, e)
};
b.getTileAtPoint = function(h, d) {
var b = a.dimensions.times(a.getLevelScale(h)),
c = d.times(b.x),
e, f;
if (d.x >= 0 && d.x <= 1) e = g.floor(c.x / a.tileSize);
else e = g.ceil(b.x / a.tileSize) * g.floor(c.x / b.x) + g.floor((b.x + c.x % b.x) % b.x / a.tileSize);
if (d.y >= 0 && d.y <= j) f = g.floor(c.y / a.tileSize);
else f = g.ceil(b.y / a.tileSize) * g.floor(c.y / b.y) + g.floor((b.y + c.y % b.y) % b.y / a.tileSize);
return new m(e, f)
};
b.getTileBounds = function(k, f, h) {
var c = a.dimensions.times(a.getLevelScale(k)),
i = f === 0 ? 0 : a.tileSize * f - a.tileOverlap,
j = h === 0 ? 0 : a.tileSize * h - a.tileOverlap,
d = a.tileSize + (f === 0 ? 1 : 2) * a.tileOverlap,
e = a.tileSize + (h === 0 ? 1 : 2) * a.tileOverlap;
d = g.min(d, c.x - i);
e = g.min(e, c.y - j);
var b = 1 / c.x;
return new y(i * b, j * 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
}
},
P = v.DisplayRect = function(e, f, d, c, b, a) {
y.apply(this, arguments);
this.minLevel = b;
this.maxLevel = a
};
P.prototype = new y;
var K = v.DziTileSource = function(m, l, e, j, k, i, f) {
var b = this;
T.apply(b, [m, l, e, j]);
var n = b,
h = {};
b.fileFormat = i;
b.tileFormat = i;
b.displayRects = f;
(function() {
if (!f) return;
for (var c = f.length - 1; c >= 0; c--)
for (var b = f[c], a = b.minLevel; a <= b.maxLevel; a++) {
if (!h[a]) h[a] = [];
h[a].push(b)
}
})();
b.getTileUrl = function(a, b, c) {
return [k, a, "/", b, "_", c, ".", i].join(d)
};
b.tileExists = function(d, p, q) {
var f = h[d];
if (!f || !f.length) return a;
for (var i = n.getLevelScale(d), o = f.length - 1; o >= 0; o--) {
var b = f[o];
if (d < b.minLevel || d > b.maxLevel) continue;
var j = b.x * i,
k = b.y * i,
l = j + b.width * i,
m = k + b.height * i;
j = g.floor(j / e);
k = g.floor(k / e);
l = g.ceil(l / e);
m = g.ceil(m / e);
if (j <= p && p < l && k <= q && q < m) return a
}
return c
}
};
K.prototype = new T;
(function() {
var c = "Errors.Empty";
function a(a) {
Error.apply(this, arguments);
this.message = a
}
a.prototype = new Error;
function i(b) {
if (!(b instanceof a)) {
q.error(b.name + " while creating DZI from XML: " + b.message);
b = new a(x.getString("Errors.Unknown"))
}
return b
}
function d(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 j(c, i) {
if (!c) throw new a(x.getString("Errors.Security"));
else if (c.status !== 200 && c.status !== 0) {
var f = c.status,
h = f == 404 ? "Not Found" : c.statusText;
throw new a(x.getString("Errors.Status", f, h))
}
var d = b;
if (c.responseXML && c.responseXML.documentElement) d = c.responseXML;
else if (c.responseText) d = e.parseXml(c.responseText);
return g(d, i)
}
function g(d, g) {
var b = "Errors.Dzi";
if (!d || !d.documentElement) throw new a(x.getString("Errors.Xml"));
var e = d.documentElement,
c = e.tagName;
if (c == "Image") try {
return l(e, g)
} catch (f) {
var h = x.getString(b);
throw f instanceof a ? f : new a(h)
} else if (c == "Collection") throw new a(x.getString("Errors.Dzc"));
else if (c == "Error") return k(e);
throw new a(x.getString(b))
}
function l(b, m) {
var f = b.getAttribute("Format");
if (!e.imageFormatSupported(f)) throw new a(x.getString("Errors.ImageFormat", f.toUpperCase()));
for (var j = b.getElementsByTagName("Size")[0], h = b.getElementsByTagName("DisplayRect"), o = parseInt(j.getAttribute("Width"), p), n = parseInt(j.getAttribute("Height"), p), l = parseInt(b.getAttribute("TileSize")), k = parseInt(b.getAttribute("Overlap")), i = [], g = 0; g < h.length; g++) {
var d = h[g],
c = d.getElementsByTagName("Rect")[0];
i.push(new P(parseInt(c.getAttribute("X"), p), parseInt(c.getAttribute("Y"), p), parseInt(c.getAttribute("Width"), p), parseInt(c.getAttribute("Height"), p), parseInt(d.getAttribute("MinLevel"), p), parseInt(d.getAttribute("MaxLevel"), p)))
}
return new K(o, n, l, k, m, f, i)
}
function k(c) {
var b = c.getElementsByTagName("Message")[0],
d = b.firstChild.nodeValue;
throw new a(d)
}
K.getTilesUrl = d;
K.createFromJson = function(q, o) {
var r = typeof o == f,
m, k, g = q;
if (!g || !g.url && !g.tilesUrl) k = new a(x.getString(c));
else try {
var l = g.displayRects;
if (l && l.length)
for (var n = 0, s = l.length; n < s; n++) {
var j = l[n];
l[n] = new P(j.x || j[0], j.y || j[1], j.width || j[2], j.height || j[3], j.minLevel || j[4], j.maxLevel || j[5])
}
m = new K(g.width, g.height, g.tileSize, g.tileOverlap, g.tilesUrl || d(g.url), g.tileFormat, g.displayRects);
m.xmlUrl = g.url
} catch (p) {
k = i(p)
}
if (r) h.setTimeout(e.createCallback(b, o, m, k && k.message), 1);
else if (k) throw k;
else return m
};
K.createFromXml = function(l, m, n) {
var p = typeof n == f,
k = b;
if (!l) {
k = x.getString(c);
if (p) {
h.setTimeout(function() {
n(b, k)
}, 1);
return b
}
throw new a(k)
}
var q = d(l);
function o(d, e) {
try {
var c = d(e, q);
c.xmlUrl = l;
return c
} catch (a) {
if (p) {
k = i(a).message;
return b
} else throw i(a)
}
}
if (p) {
if (m) h.setTimeout(function() {
var a = o(g, e.parseXml(m));
n(a, k)
}, 1);
else e.makeAjaxRequest(l, function(b) {
var a = o(j, b);
n(a, k)
});
return b
}
if (m) return o(g, e.parseXml(m));
else return o(j, e.makeAjaxRequest(l))
}
})();
var X = v.Viewport = function(e, n) {
var d = this,
c = d,
e = new m(e.x, e.y),
s = n.x / n.y,
o = n.y / n.x,
h = new Q(0),
j = new Q(0),
l = new Q(i.logarithmicZoom ? 0 : 1),
f = b,
k = new y(0, 0, 1, o),
q = k.getCenter(),
A = g.LN2;
function z() {
c.goHome(a);
c.update()
}
function u(a) {
return g.log(a) / A
}
function w(a) {
return g.pow(2, a)
}
function r(c, b, a) {
return g.min(g.max(c, b), a)
}
function x(b, a) {
var d = b.x,
f = b.y,
c = r(d, a.x, a.x + a.width),
e = r(f, a.y, a.y + a.height);
return d === c && f === e ? b : new m(c, e)
}
function p(h) {
var k = c.getZoom(h),
g = 1 / k,
j = g / c.getAspectRatio(),
f = i.visibilityRatio,
d = (f - t) * g,
e = (f - t) * j,
a = 1 - 2 * d,
b = o - 2 * e;
if (a < 0) {
d += t * a;
a = 0
}
if (b < 0) {
e += t * b;
b = 0
}
return new v.Rect(d, e, a, b)
}
d.getHomeBounds = function() {
var b = c.getAspectRatio(),
a = new y(k.x, k.y, k.width, k.height);
if (s >= b) {
a.height = k.width / b;
a.y = q.y - a.height / 2
} else {
a.width = k.height * b;
a.x = q.x - a.width / 2
}
return a
};
d.getHomeCenter = function() {
return q
};
d.getHomeZoom = function() {
var a = s / c.getAspectRatio();
return a >= 1 ? 1 : a
};
d.getMinCenter = function(a) {
return p(a).getTopLeft()
};
d.getMaxCenter = function(a) {
return p(a).getBottomRight()
};
d.getMinZoom = function() {
var a = c.getHomeZoom();
if (i.minZoomDimension) var b = n.x <= n.y ? i.minZoomDimension / e.x : i.minZoomDimension / (e.x * o);
else var b = i.minZoomImageRatio * a;
return g.min(b, a)
};
d.getMaxZoom = function() {
var a = n.x * i.maxZoomPixelRatio / e.x;
return g.max(a, c.getHomeZoom())
};
d.getAspectRatio = function() {
return e.x / e.y
};
d.getContainerSize = function() {
return new m(e.x, e.y)
};
d.getBounds = function(b) {
var d = c.getCenter(b),
a = 1 / c.getZoom(b),
e = a / c.getAspectRatio();
return new y(d.x - a / 2, d.y - e / 2, a, e)
};
d.getCenter = function(r) {
var b = new m(h.getCurrent(), j.getCurrent()),
g = new m(h.getTarget(), j.getTarget());
if (r) return b;
else if (!f) return g;
var l = c.getZoom(),
d = 1 / l,
k = d / c.getAspectRatio(),
i = new y(b.x - d / 2, b.y - k / 2, d, k),
q = c.pixelFromPoint(f, a),
p = f.minus(i.getTopLeft()).times(e.x / i.width),
n = p.minus(q),
o = n.divide(e.x * l);
return g.plus(o)
};
d.getZoom = function(b) {
var a;
if (b) {
a = l.getCurrent();
return i.logarithmicZoom ? w(a) : a
} else {
a = l.getTarget();
return i.logarithmicZoom ? w(a) : a
}
};
d.applyConstraints = function(g) {
var h = c.getZoom(),
d = r(h, c.getMinZoom(), c.getMaxZoom());
h != d && c.zoomTo(d, f, g);
var b = c.getCenter(),
a = x(b, p());
if (i.wrapHorizontal) a.x = b.x;
if (i.wrapVertical) a.y = b.y;
if (!b.equals(a)) {
var e = 1 / d,
j = e / c.getAspectRatio();
c.fitBounds(new y(a.x - t * e, a.y - t * j, e, j), g)
}
};
d.ensureVisible = function(a) {
c.applyConstraints(a)
};
d.fitBounds = function(f, j) {
var h = c.getAspectRatio(),
i = f.getCenter(),
d = new y(f.x, f.y, f.width, f.height);
if (d.getAspectRatio() >= h) {
d.height = f.width / h;
d.y = i.y - d.height / 2
} else {
d.width = f.height * h;
d.x = i.x - d.width / 2
}
c.panTo(c.getCenter(a), a);
c.zoomTo(c.getZoom(a), b, a);
var g = c.getBounds(),
m = c.getZoom(),
k = 1 / d.width;
if (k == m || d.width == g.width) {
c.panTo(i, j);
return
}
var l = g.getTopLeft().times(e.x / g.width).minus(d.getTopLeft().times(e.x / d.width)).divide(e.x / g.width - e.x / d.width);
c.zoomTo(k, l, j)
};
d.goHome = function(b) {
var a = c.getCenter();
if (i.wrapHorizontal) {
a.x = (1 + a.x % 1) % 1;
h.resetTo(a.x);
h.update()
}
if (i.wrapVertical) {
a.y = (o + a.y % o) % o;
j.resetTo(a.y);
j.update()
}
c.fitBounds(k, b)
};
d.panBy = function(b, a) {
c.panTo(c.getCenter().plus(b), a)
};
d.panTo = function(b, q) {
if (q) {
h.resetTo(b.x);
j.resetTo(b.y);
return
}
if (!f) {
h.springTo(b.x);
j.springTo(b.y);
return
}
var l = c.getZoom(),
d = 1 / l,
k = d / c.getAspectRatio(),
i = new y(h.getCurrent() - d / 2, j.getCurrent() - k / 2, d, k),
p = c.pixelFromPoint(f, a),
o = f.minus(i.getTopLeft()).times(e.x / i.width),
m = o.minus(p),
n = m.divide(e.x * l),
g = b.minus(n);
h.springTo(g.x);
j.springTo(g.y)
};
d.zoomBy = function(d, b, a) {
c.zoomTo(c.getZoom() * d, b, a)
};
d.zoomTo = function(a, c, d) {
if (d) l.resetTo(i.logarithmicZoom ? u(a) : a);
else l.springTo(i.logarithmicZoom ? u(a) : a);
f = c instanceof m ? c : b
};
d.resize = function(d, h) {
var f = c.getBounds(),
b = f,
g = d.x / e.x;
e = new m(d.x, d.y);
if (h) {
b.width = f.width * g;
b.height = b.width / c.getAspectRatio()
}
c.fitBounds(b, a)
};
d.update = function() {
var m = h.getCurrent(),
n = j.getCurrent(),
e = l.getCurrent();
if (f) var k = c.pixelFromPoint(f, a);
l.update();
if (f && l.getCurrent() != e) {
var i = c.pixelFromPoint(f, a),
g = i.minus(k),
d = c.deltaPointsFromPixels(g, a);
h.shiftBy(d.x);
j.shiftBy(d.y)
} else f = b;
h.update();
j.update();
return h.getCurrent() != m || j.getCurrent() != n || l.getCurrent() != e
};
d.deltaPixelsFromPoints = function(a, b) {
return a.times(e.x * c.getZoom(b))
};
d.deltaPointsFromPixels = function(a, b) {
return a.divide(e.x * c.getZoom(b))
};
d.pixelFromPoint = function(d, b) {
var a = c.getBounds(b);
return d.minus(a.getTopLeft()).times(e.x / a.width)
};
d.pointFromPixel = function(d, b) {
var a = c.getBounds(b);
return d.divide(e.x / a.width).plus(a.getTopLeft())
};
z()
},
V, E;
(function() {
var n = "progid:DXImageTransform.Microsoft.Matrix(",
j = " when it's not yet loaded.",
h = "Attempting to draw tile ",
W = 100,
G = t,
u = e.getBrowser(),
P = e.getBrowserVersion(),
bb = navigator.userAgent,
R = !!r.createElement("canvas").getContext,
T = r.documentElement || {},
H = T.style || {},
C = c,
K = ["msTransform", "WebkitTransform", "MozTransform"],
f, B;
while (f = K.shift())
if (typeof H[f] !== J) {
C = a;
B = /webkit/i.test(f);
break
}
var X = "-webkit-transform",
L = "WebkitTransition",
Z = typeof H[L] !== J,
O = "progid:DXImageTransform.Microsoft.Matrix",
Y = new RegExp(O + "\\(.*?\\)", "g"),
ab = function() {
try {
return u == A.IE && !!r.documentElement.filters
} catch (a) {
return c
}
}(),
Q = u == A.SAFARI && P < 4 || u == A.CHROME,
p = R && !Q,
F = !p && C,
I = c,
M = typeof r.documentMode !== J ? "bicubic" : "nearest-neighbor";
function o(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 = b;
a.image = b;
a.loaded = c;
a.loading = c;
a.style = b;
a.position = b;
a.size = b;
a.blendStart = b;
a.opacity = b;
a.distance = b;
a.visibility = b;
a.beingDrawn = c;
a.lastDrawnTime = 0;
a.lastTouchTime = 0
}
o.prototype.toString = function() {
return this.level + "/" + this.x + "_" + this.y
};
o.prototype.drawHTML = function(l) {
var a = this;
if (!a.loaded) {
q.error(h + a.toString() + j);
return
}
if (!a.elmt) {
a.elmt = e.makeNeutralElement("img");
a.elmt.src = a.url;
a.style = a.elmt.style;
a.style.position = w;
a.style.msInterpolationMode = M;
if (F) a.style[f + "Origin"] = "0px 0px"
}
var m = a.elmt,
r = a.image,
c = a.style,
b = a.position,
i = a.size;
m.parentNode != l && l.appendChild(m);
if (F) c[f] = ["matrix(", (i.x / r.width).toFixed(8), ",0,0,", (i.y / r.height).toFixed(8), z, b.x.toFixed(8), B ? z : "px,", b.y.toFixed(8), B ? ")" : "px)"].join(d);
else if (I) {
var p = l.clientWidth,
o = l.clientHeight;
c.width = p + k;
c.height = o + k;
c.filter = [n, "M11=", (i.x / p).toFixed(8), ",M22=", (i.y / o).toFixed(8), ",Dx=", b.x.toFixed(8), ",Dy=", b.y.toFixed(8), ")"].join(d)
} else {
b = b.apply(g.floor);
i = i.apply(g.ceil);
c.left = b.x + k;
c.top = b.y + k;
c.width = i.x + k;
c.height = i.y + k
}
e.setElementOpacity(m, a.opacity)
};
o.prototype.drawCanvas = function(c) {
var a = this;
if (!a.loaded) {
q.error(h + a.toString() + j);
return
}
var b = a.position,
d = a.size;
c.globalAlpha = a.opacity;
c.drawImage(a.image, b.x, b.y, d.x, d.y)
};
o.prototype.unload = function() {
var a = this;
a.elmt && a.elmt.parentNode && a.elmt.parentNode.removeChild(a.elmt);
a.elmt = b;
a.image = b;
a.loaded = c;
a.loading = c
};
E = v.OverlayPlacement = {
CENTER: 0,
TOP_LEFT: 1,
TOP: 2,
TOP_RIGHT: 3,
RIGHT: 4,
BOTTOM_RIGHT: 5,
BOTTOM: 6,
BOTTOM_LEFT: 7,
LEFT: 8
};
function D(a) {
switch (a) {
case E.TOP_LEFT:
return function() {};
case E.TOP:
return function(a, b) {
a.x -= b.x / 2
};
case E.TOP_RIGHT:
return function(a, b) {
a.x -= b.x
};
case E.RIGHT:
return function(a, b) {
a.x -= b.x;
a.y -= b.y / 2
};
case E.BOTTOM_RIGHT:
return function(a, b) {
a.x -= b.x;
a.y -= b.y
};
case E.BOTTOM:
return function(a, b) {
a.x -= b.x / 2;
a.y -= b.y
};
case E.BOTTOM_LEFT:
return function(a, b) {
a.y -= b.y
};
case E.LEFT:
return function(a, b) {
a.y -= b.y / 2
};
case E.CENTER:
default:
return function(a, b) {
a.x -= b.x / 2;
a.y -= b.y / 2
}
}
}
function x(c, a, d) {
var b = this;
b.elmt = c;
b.scales = a instanceof y;
b.bounds = new y(a.x, a.y, a.width, a.height);
b.adjust = D(a instanceof m ? d : E.TOP_LEFT);
b.position = new m(a.x, a.y);
b.size = new m(a.width, a.height);
b.style = c.style;
b.naturalSize = new m(c.clientWidth, c.clientHeight)
}
x.prototype.destroy = function() {
var b = this.elmt,
a = this.style;
b.parentNode && b.parentNode.removeChild(b);
a.top = d;
a.left = d;
a.position = d;
if (this.scales) {
a.width = d;
a.height = d
}
};
x.prototype.drawHTML = function(m) {
var h = this,
c = h.elmt,
a = h.style,
o = h.scales,
j = h.naturalSize;
if (c.parentNode != m) {
m.appendChild(c);
a.position = w;
j.x = c.clientWidth;
j.y = c.clientHeight
}
var e = h.position,
b = h.size;
if (!o) {
b.x = j.x = j.x || c.clientWidth;
b.y = j.y = j.y || c.clientHeight
}
h.adjust(e, b);
if (i.transformOverlays && C) {
a[f + "Origin"] = "0px 0px";
a[f] = ["translate(", e.x.toFixed(8), "px,", e.y.toFixed(8), "px)"].join(d);
if (o) {
if (!c.clientWidth) a.width = l;
if (!c.clientHeight) a.height = l;
a[f] += [" scale(", (b.x / c.clientWidth).toFixed(8), z, (b.y / c.clientHeight).toFixed(8), ")"].join(d)
}
} else if (i.transformOverlays && I) {
var q = m.clientWidth,
p = m.clientHeight;
a.width = q + k;
a.height = p + k;
a.filter = [n, "M11=", (b.x / q).toFixed(8), ",M22=", (b.y / p).toFixed(8), ",Dx=", e.x.toFixed(8), ",Dy=", e.y.toFixed(8), ")"].join(d)
} else {
e = e.apply(g.floor);
b = b.apply(g.ceil);
a.left = e.x + k;
a.top = e.y + k;
if (o) {
a.width = b.x + k;
a.height = b.y + k
}
}
};
x.prototype.update = function(a, b) {
this.scales = a instanceof y;
this.bounds = new y(a.x, a.y, a.width, a.height);
this.adjust = D(a instanceof m ? b : E.TOP_LEFT)
};
V = v.Drawer = function(f, C, ib) {
var h = this,
B = e.getElement(ib),
z = e.makeNeutralElement(p ? "canvas" : s),
gb = p ? z.getContext("2d") : b,
T = new S,
J = new U,
eb = f.minLevel,
db = f.maxLevel,
fb = f.tileSize,
X = f.tileOverlap,
H = f.height / f.width,
F = {},
D = {},
r = {},
v = [],
k = {},
n = [],
bb = [],
K = 0,
L = 0,
I = c,
j = a;
h.elmt = B;
h.profiler = J;
(function() {
z.style.width = l;
z.style.height = l;
z.style.position = w;
B.style.textAlign = "left";
B.appendChild(z)
})();
function R(a) {
if (!F[a]) F[a] = f.getNumTiles(a);
return F[a]
}
function M(a) {
if (!D[a]) D[a] = f.getPixelRatio(a);
return D[a]
}
function hb(a, b, c, l, d, e) {
if (!r[a]) r[a] = {};
if (!r[a][b]) r[a][b] = {};
if (!r[a][b][c]) {
var g = (d + b % d) % d,
h = (e + c % e) % e,
i = f.getTileBounds(a, g, h),
k = f.tileExists(a, g, h),
m = f.getTileUrl(a, g, h);
i.x += 1 * (b - g) / d;
i.y += H * (c - h) / e;
r[a][b][c] = new o(a, b, c, i, k, m)
}
var j = r[a][b][c];
j.lastTouchTime = l;
return j
}
function cb(a, c) {
a.loading = T.loadImage(a.url, e.createCallback(b, Z, a, c))
}
function Z(d, s, n) {
d.loading = c;
if (I) {
q.error("Tile load callback in middle of drawing routine.");
return
} else if (!n) {
q.log("Tile " + d + " failed to load: " + d.url);
d.exists = c;
return
} else if (s < L) {
q.log("Ignoring tile " + d + " loaded before reset: " + d.url);
return
}
d.loaded = a;
d.image = n;
var k = v.length;
if (v.length >= W) {
for (var r = g.ceil(g.log(fb) / g.log(2)), e = b, i = -1, h = v.length - 1; h >= 0; h--) {
var f = v[h];
if (f.level <= r || f.beingDrawn) continue;
else if (!e) {
e = f;
i = h;
continue
}
var m = f.lastTouchTime,
l = e.lastTouchTime,
p = f.level,
o = e.level;
if (m < l || m == l && p > o) {
e = f;
i = h
}
}
if (e && i >= 0) {
e.unload();
k = i
}
}
v[k] = d;
j = a
}
function Y() {
r = {};
v = []
}
function y(b, d, g) {
if (!k[b]) return c;
if (d === N || g === N) {
var f = k[b];
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 c
}
return a
}
return k[b][d] === N || k[b][d][g] === N || k[b][d][g] === a
}
function ab(a, b, c) {
if (b === N || c === N) return y(a + 1);
else return y(a + 1, 2 * b, 2 * c) && y(a + 1, 2 * b, 2 * c + 1) && y(a + 1, 2 * b + 1, 2 * c) && y(a + 1, 2 * b + 1, 2 * c + 1)
}
function V(a, b, d, c) {
if (!k[a]) {
q.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 O(a) {
k[a] = {}
}
function P(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 E(b) {
for (var a = n.length - 1; a >= 0; a--)
if (n[a].elmt == b) return a;
return -1
}
function Q() {
j = c;
var Q = z,
Fb = gb,
gc = B,
xb = p,
D = bb;
while (D.length > 0) {
var e = D.pop();
e.beingDrawn = c
}
var ub = C.getContainerSize(),
sb = ub.x,
rb = ub.y;
if (xb) {
Q.width = sb;
Q.height = rb;
Fb.clearRect(0, 0, sb, rb)
} else Q.innerHTML = d;
var qb = C.getBounds(a),
s = qb.getTopLeft(),
r = qb.getBottomRight();
if (!i.wrapHorizontal && (r.x < 0 || s.x > 1)) return;
else if (!i.wrapVertical && (r.y < 0 || s.y > H)) return;
var Rb = R,
F = M,
cc = hb,
Yb = ab,
I = V,
Ob = O,
Kb = y,
Sb = X,
Nb = K,
bc = u === A.CHROME,
ec = g.abs,
hc = g.ceil,
jb = g.floor,
T = g.log,
lb = g.max,
k = g.min,
q = C.deltaPixelsFromPoints,
E = C.pixelFromPoint,
pb = f.getTileAtPoint,
Tb = i.alwaysBlend,
U = 1e3 * i.blendTime,
Lb = i.immediateRender,
Y = i.minZoomDimension,
fc = i.minImageRatio,
W = i.wrapHorizontal,
Z = i.wrapVertical,
vb = i.wrapOverlays;
if (!W) {
s.x = lb(s.x, 0);
r.x = k(r.x, 1)
}
if (!Z) {
s.y = lb(s.y, 0);
r.y = k(r.y, H)
}
var S = b,
L = c,
v = (new Date).getTime(),
mb = C.getCenter(),
Ib = E(mb),
Xb = q(F(0), c).x,
nb = Lb ? 1 : Xb;
Y = Y || 64;
var J = lb(eb, jb(T(Y) / T(2))),
Wb = q(F(0), a).x,
tb = k(db, jb(T(Wb / G) / T(2)));
J = k(J, tb);
for (var h = tb; h >= J; h--) {
var zb = c,
ob = q(F(h), a).x;
if (!L && ob >= G || h == J) {
zb = a;
L = a
} else if (!L) continue;
Ob(h);
var Pb = k(1, (ob - t) / t),
Jb = q(F(h), c).x,
Mb = nb / ec(nb - Jb),
Hb = pb(h, s),
w = pb(h, r),
Eb = Rb(h),
Ab = Eb.x,
Bb = Eb.y;
if (!W) w.x = k(w.x, Ab - 1);
if (!Z) w.y = k(w.y, Bb - 1);
for (var l = Hb.x; l <= w.x; l++)
for (var o = Hb.y; o <= w.y; o++) {
var e = cc(h, l, o, v, Ab, Bb),
fb = zb;
I(h, l, o, c);
if (!e.exists) continue;
if (L && !fb)
if (Yb(h, l, o)) I(h, l, o, a);
else fb = a;
if (!fb) continue;
var Db = e.bounds.getTopLeft(),
wb = e.bounds.getSize(),
Zb = E(Db, a),
kb = q(wb, a);
if (!Sb) kb = kb.plus(new m(1, 1));
var ac = E(Db, c),
dc = q(wb, c),
Vb = ac.plus(dc.divide(2)),
Qb = Ib.distanceTo(Vb);
e.position = Zb;
e.size = kb;
e.distance = Qb;
e.visibility = Mb;
if (e.loaded) {
if (!e.blendStart) e.blendStart = v;
var yb = v - e.blendStart,
ib = U === 0 ? 1 : k(1, yb / U);
if (Tb) ib *= Pb;
e.opacity = ib;
D.push(e);
if (ib >= 1) {
I(h, l, o, a);
bc && e.lastDrawnTime !== Nb && I(h, l, o, c)
} else if (yb < U) j = a;
e.lastDrawnTime = v
} else if (!e.loading) S = P(S, e)
}
if (Kb(h)) break
}
for (var x = D.length - 1; x >= 0; x--) {
var e = D[x];
if (xb) e.drawCanvas(Fb);
else e.drawHTML(Q);
e.beingDrawn = a
}
for (var Ub = n.length, x = 0; x < Ub; x++) {
var N = n[x],
Gb = N.bounds,
Cb = Gb.getTopLeft();
if (vb && W) Cb.x += jb(mb.x);
if (vb && Z);
N.position = E(Cb, a);
N.size = q(Gb.getSize(), a);
N.drawHTML(B)
}
if (S) {
cb(S, v);
j = a
}
K = v
}
h.addOverlay = function(b, d, c) {
var b = e.getElement(b);
if (E(b) >= 0) return;
n.push(new x(b, d, c));
j = a
};
h.updateOverlay = function(b, f, d) {
var b = e.getElement(b),
c = E(b);
if (c >= 0) {
n[c].update(f, d);
j = a
}
};
h.removeOverlay = function(c) {
var c = e.getElement(c),
b = E(c);
if (b >= 0) {
n[b].destroy();
n.splice(b, 1);
j = a
}
};
h.clearOverlays = function() {
while (n.length > 0) {
n.pop().destroy();
j = a
}
};
h.needsUpdate = function() {
return j
};
h.numTilesLoaded = function() {
return v.length
};
h.reset = function() {
Y();
L = (new Date).getTime();
j = a
};
h.update = function() {
J.beginUpdate();
I = a;
Q();
I = c;
J.endUpdate()
};
h.idle = function() {}
}
})();
var Y, G;
(function() {
var L = "----seadragon----",
Q = e.getBrowser();
G = v.ControlAnchor = {
NONE: 0,
TOP_LEFT: 1,
TOP_RIGHT: 2,
BOTTOM_RIGHT: 3,
BOTTOM_LEFT: 4
};
function P(c, b, a) {
if (b == G.TOP_RIGHT || b == G.BOTTOM_RIGHT) a.insertBefore(c, a.firstChild);
else a.appendChild(c)
}
function f(f, c, d) {
var b = this,
a = e.makeNeutralElement(F);
b.elmt = f;
b.anchor = c;
b.container = d;
b.wrapper = a;
a.style.display = C;
a.appendChild(f);
if (c == G.NONE) a.style.width = a.style.height = l;
P(a, c, d)
}
f.prototype.destroy = function() {
var a = this;
a.wrapper.removeChild(a.elmt);
a.container.removeChild(a.wrapper)
};
f.prototype.isVisible = function() {
return this.wrapper.style.display != B
};
f.prototype.setVisible = function(a) {
this.wrapper.style.display = a ? C : B
};
f.prototype.setOpacity = function(b) {
if (this.elmt[L] && Q == A.IE) e.setElementOpacity(this.elmt, b, a);
else e.setElementOpacity(this.wrapper, b, a)
};
var k = "fullpage",
E = "home",
t = "zoomin",
n = "zoomout",
J = "_rest.png",
y = "_grouphover.png",
z = "_hover.png",
D = "_pressed.png";
function N(d) {
var j = b,
f = c,
q = b,
l = b;
function H() {
d.viewport && d.viewport.goHome()
}
function w() {
d.setFullPage(!d.isFullPage());
j.emulateExit();
d.viewport && d.viewport.applyConstraints()
}
function s() {
l = (new Date).getTime();
q = i.zoomPerSecond;
f = a;
o()
}
function r() {
l = (new Date).getTime();
q = 1 / i.zoomPerSecond;
f = a;
o()
}
function m() {
f = c
}
function o() {
h.setTimeout(F, p)
}
function F() {
if (f && d.viewport) {
var a = (new Date).getTime(),
c = a - l,
b = g.pow(q, c / 1e3);
d.viewport.zoomBy(b);
d.viewport.applyConstraints();
l = a;
o()
}
}
function v() {
if (d.viewport) {
f = c;
d.viewport.zoomBy(i.zoomPerClick / 1);
d.viewport.applyConstraints()
}
}
function u() {
if (d.viewport) {
f = c;
d.viewport.zoomBy(1 / i.zoomPerClick);
d.viewport.applyConstraints()
}
}
function B() {
j.emulateEnter();
j.emulateExit()
}
function e(b, a) {
return i.imagePath + b + a
}
var I = new O(x.getString("Tooltips.ZoomIn"), e(t, J), e(t, y), e(t, z), e(t, D), s, m, v, s, m),
C = new O(x.getString("Tooltips.ZoomOut"), e(n, J), e(n, y), e(n, z), e(n, D), r, m, u, r, m),
G = new O(x.getString("Tooltips.Home"), e(E, J), e(E, y), e(E, z), e(E, D), b, H, b, b, b),
A = new O(x.getString("Tooltips.FullPage"), e(k, J), e(k, y), e(k, z), e(k, D), b, w, b, b, b);
j = new R([I, C, G, A]);
j.elmt[L] = a;
d.addEventListener("open", B);
return j.elmt
}
Y = v.Viewer = function(v) {
var n = this,
t = n,
P = e.getElement(v),
v = e.makeNeutralElement(s),
E = e.makeNeutralElement(s),
eb = e.makeNeutralElement(s),
fb = e.makeNeutralElement(s),
db = e.makeNeutralElement(s),
cb = e.makeNeutralElement(s),
A = b,
J = b,
k = b,
O = b,
z = new W,
D = new M(E),
S = new M(v),
y = [],
ab = a,
ib = b,
L = b,
kb = 1e3,
Ab = 2e3,
ib = b,
ab = c,
yb = r.body.style.width,
wb = r.body.style.height,
tb = r.body.style.overflow,
ub = r.documentElement.style.overflow,
bb = new m(1, 1),
C = b,
R = 0,
nb = 0,
qb = b,
ob = b,
F = c,
T = c,
Y = c;
n.container = P;
n.elmt = v;
n.source = b;
n.drawer = b;
n.viewport = b;
n.profiler = b;
n.tracker = D;
function Jb() {
var c = E.style,
b = v.style,
g = eb.style,
i = fb.style,
f = db.style,
e = cb.style;
b.width = l;
b.height = l;
b.position = u;
b.left = j;
b.top = j;
b.textAlign = "left";
c.width = l;
c.height = l;
c.overflow = o;
c.position = w;
c.top = j;
c.left = j;
g.position = i.position = f.position = e.position = w;
g.top = i.top = j;
g.left = e.left = j;
i.right = f.right = j;
e.bottom = f.bottom = j;
D.clickHandler = Fb;
D.pressHandler = Gb;
D.dragHandler = Hb;
D.releaseHandler = Db;
D.scrollHandler = Eb;
D.setTracking(a);
L = N(t);
L.style.marginRight = "4px";
L.style.marginBottom = "4px";
t.addControl(L, G.BOTTOM_RIGHT);
S.enterHandler = lb;
S.exitHandler = pb;
S.releaseHandler = Bb;
S.setTracking(a);
h.setTimeout(Q, 1);
v.appendChild(E);
v.appendChild(eb);
v.appendChild(fb);
v.appendChild(db);
v.appendChild(cb);
P.innerHTML = d;
P.appendChild(v)
}
function Z(f) {
var a = "normal",
c = r.createTextNode(f);
E.innerHTML = d;
E.appendChild(e.makeCenteredNode(c));
var b = c.parentNode.style;
b.fontFamily = "verdana";
b.fontSize = "13px";
b.fontSizeAdjust = B;
b.fontStyle = a;
b.fontStretch = a;
b.fontVariant = a;
b.fontWeight = a;
b.lineHeight = "1em";
b.textAlign = "center";
b.textDecoration = B
}
function vb() {
A && zb();
R = (new Date).getTime();
h.setTimeout(function() {
R > nb && Z(x.getString("Messages.Loading"))
}, 2e3);
return R
}
function gb(g, b, f) {
nb = (new Date).getTime();
if (g < R) {
q.log("Ignoring out-of-date open.");
z.trigger("ignore", t);
return
} else if (!b) {
Z(f);
z.trigger("error", t);
return
}
E.innerHTML = d;
C = e.getElementSize(v);
if (C.x === 0 || C.y === 0) {
h.setTimeout(function() {
gb(g, b, f)
}, p);
return
}
A = b;
k = new X(C, A.dimensions);
J = new V(A, k, E);
O = new U;
t.source = A;
t.viewport = k;
t.drawer = J;
t.profiler = O;
F = c;
T = a;
rb(Ib);
z.trigger("open", t)
}
function zb() {
t.source = A = b;
t.viewport = k = b;
t.drawer = J = b;
t.profiler = O = b;
E.innerHTML = d
}
function rb(c, a) {
if (F) return h.setTimeout(c, 1);
var b = (new Date).getTime(),
a = a ? a : b,
d = a + 1e3 / 60,
e = g.max(1, d - b);
return h.setTimeout(c, e)
}
function xb() {
if (!A) return;
O.beginUpdate();
var b = e.getElementSize(v);
if (!b.equals(C) && b.x > 0 && b.y > 0) {
k.resize(b, a);
C = b;
z.trigger("resize", t)
}
var d = k.update();
if (!F && d) {
z.trigger("animationstart", t);
hb()
}
if (d) {
J.update();
z.trigger("animation", t)
} else if (T || J.needsUpdate()) {
J.update();
T = c
} else J.idle();
if (F && !d) {
z.trigger("animationfinish", t);
!Y && Q()
}
F = d;
O.endUpdate()
}
function Ib() {
if (!A) return;
var a = (new Date).getTime();
xb();
rb(arguments.callee, a)
}
function mb(b) {
for (var a = y.length - 1; a >= 0; a--)
if (y[a].elmt == b) return a;
return -1
}
function jb() {
h.setTimeout(Cb, 20)
}
function Cb() {
if (ab) {
var c = (new Date).getTime(),
d = c - ib,
a = 1 - d / Ab;
a = g.min(1, a);
a = g.max(0, a);
for (var b = y.length - 1; b >= 0; b--) y[b].setOpacity(a);
a > 0 && jb()
}
}
function hb() {
ab = c;
for (var a = y.length - 1; a >= 0; a--) y[a].setOpacity(1)
}
function Q() {
if (!i.autoHideControls) return;
ab = a;
ib = (new Date).getTime() + kb;
h.setTimeout(jb, kb)
}
function lb() {
Y = a;
hb()
}
function pb(e, d, a) {
if (!a) {
Y = c;
!F && Q()
}
}
function Bb(e, d, b, a) {
if (!a) {
Y = c;
!F && Q()
}
}
function Fb(g, c, e, f) {
if (k && e) {
var b = i.zoomPerClick,
d = f ? 1 / b : b;
k.zoomBy(d, k.pointFromPixel(c, a));
k.applyConstraints()
}
}
function Gb(b, a) {
if (k) {
qb = a;
ob = k.getCenter()
}
}
function Hb(f, d, e) {
if (k)
if (i.constrainDuringPan) {
var b = d.minus(qb),
c = k.deltaPointsFromPixels(b.negate(), a);
k.panTo(ob.plus(c));
k.applyConstraints()
} else k.panBy(k.deltaPointsFromPixels(e.negate(), a))
}
function Db(d, c, a) {
a && k && k.applyConstraints()
}
function Eb(e, b, d) {
if (k) {
var c = g.pow(i.zoomPerScroll, d);
k.zoomBy(c, k.pointFromPixel(b, a));
k.applyConstraints()
}
}
function sb(a) {
a = e.getEvent(a);
a.keyCode === 27 && t.setFullPage(c)
}
n.isOpen = function() {
return !!A
};
n.openDzi = function(a, f) {
var d = vb(),
c = e.createCallback(b, gb, d);
switch (typeof a) {
case I:
K.createFromXml(a, f, c);
break;
default:
K.createFromJson(a, c)
}
};
n.openTileSource = function(b) {
var a = vb();
h.setTimeout(function() {
gb(a, b)
}, 1)
};
n.close = function() {
if (!A) return;
zb()
};
n.addControl = function(a, d) {
var a = e.getElement(a);
if (mb(a) >= 0) return;
var c = b;
switch (d) {
case G.TOP_RIGHT:
c = fb;
a.style.position = u;
break;
case G.BOTTOM_RIGHT:
c = db;
a.style.position = u;
break;
case G.BOTTOM_LEFT:
c = cb;
a.style.position = u;
break;
case G.TOP_LEFT:
c = eb;
a.style.position = u;
break;
case G.NONE:
default:
c = v;
a.style.position = w
}
y.push(new f(a, d, c))
};
n.removeControl = function(b) {
var b = e.getElement(b),
a = mb(b);
if (a >= 0) {
y[a].destroy();
y.splice(a, 1)
}
};
n.clearControls = function() {
while (y.length > 0) y.pop().destroy()
};
n.getNavControl = function() {
return L
};
n.isDashboardEnabled = function() {
for (var b = y.length - 1; b >= 0; b--)
if (y[b].isVisible()) return a;
return c
};
n.isFullPage = function() {
return v.parentNode == r.body
};
n.isMouseNavEnabled = function() {
return D.isTracking()
};
n.isVisible = function() {
return v.style.visibility != o
};
n.setDashboardEnabled = function(b) {
for (var a = y.length - 1; a >= 0; a--) y[a].setVisible(b)
};
n.setFullPage = function(j) {
if (j == t.isFullPage()) return;
var q = r.body,
c = q.style,
i = r.documentElement.style,
f = v.style,
h = E.style;
if (j) {
tb = c.overflow;
ub = i.overflow;
c.overflow = o;
i.overflow = o;
yb = c.width;
wb = c.height;
c.width = l;
c.height = l;
h.backgroundColor = "black";
h.color = "white";
f.position = H;
f.zIndex = "99999999";
q.appendChild(v);
C = e.getWindowSize();
e.addEvent(r, "keydown", sb);
lb()
} else {
c.overflow = tb;
i.overflow = ub;
c.width = yb;
c.height = wb;
h.backgroundColor = d;
h.color = d;
f.position = u;
f.zIndex = d;
P.appendChild(v);
C = e.getElementSize(P);
e.removeEvent(r, "keydown", sb);
pb()
}
if (k) {
var p = k.getBounds();
k.resize(C);
var n = k.getBounds();
if (j) bb = new m(n.width / p.width, n.height / p.height);
else {
k.update();
k.zoomBy(g.max(bb.x, bb.y), b, a)
}
T = a;
z.trigger("resize", t);
xb()
}
};
n.setMouseNavEnabled = function(a) {
D.setTracking(a)
};
n.setVisible = function(a) {
v.style.visibility = a ? d : o
};
n.showMessage = function(a, b) {
if (!b) {
Z(a);
return
}
h.setTimeout(function() {
!t.isOpen() && Z(a)
}, b)
};
n.addEventListener = function(a, b) {
z.addListener(a, b)
};
n.removeEventListener = function(a, b) {
z.removeListener(a, b)
};
Jb()
}
})();
})(window, document, Math);
(function() {
var e = "_blank",
d = "4px",
b = false,
i = "left",
f = "none",
g = "span",
a = true,
c = null,
p = "Tooltips.AboutButton",
j = "About.MainUrl",
r = "/web/20140802003648/http://seadragon.com/",
o = "About.LogoUrl",
n = "About.Description",
m = "About.Header";
if (typeof Seadragon.BrandedViewer == "function") return;
Seadragon.Strings.setString(m, "Welcome to Seadragon.");
Seadragon.Strings.setString(n, "Use your mouse and scroll wheel to pan and zoom around the image. To learn more, visit:");
Seadragon.Strings.setString(o, r);
Seadragon.Strings.setString(j, r);
Seadragon.Strings.setString(p, "About Seadragon");
var q = "../branding/",
y = "----seadragon----",
x = "about",
C = "_rest.png",
z = "_grouphover.png",
A = "_hover.png",
B = "_pressed.png";
function k(a) {
return Seadragon.Config.imagePath + q + x + a
}
function v(d) {
var j = new Seadragon.Button(Seadragon.Strings.getString(p), k(C), k(z), k(A), k(B), c, f, c, c, c),
b = new Seadragon.ButtonGroup([j]);
function f() {
d.setAboutScreenVisible(a)
}
function i() {
b.emulateEnter();
b.emulateExit()
}
b.elmt[y] = a;
d.addEventListener("open", i);
var e = b.elmt,
h = Seadragon.Utils.makeNeutralElement(g);
e.appendChild(h);
return e
}
var w = "logo_big.png",
s = 70,
t = 18;
function l(a) {
Seadragon.Utils.addEvent(a, "mouseup", Seadragon.Utils.stopEvent);
Seadragon.Utils.addEvent(a, "click", Seadragon.Utils.stopEvent)
}
function h(c) {
var b = "normal",
a = c.style;
a.color = "white";
a.fontFamily = "verdana";
a.fontSize = "13px";
a.fontSizeAdjust = f;
a.fontStyle = b;
a.fontStretch = b;
a.fontVariant = b;
a.fontWeight = b;
a.lineHeight = "1em";
a.textAlign = i;
a.textDecoration = f
}
function u(J) {
var x = "100%",
k = "0px",
B = "absolute",
c = "div",
g = Seadragon.Utils.makeNeutralElement(c),
H = new Seadragon.MouseTracker(g);
g.style.position = B;
g.style.left = g.style.top = k;
g.style.width = g.style.height = x;
H.setTracking(a);
H.clickHandler = function(d, c, a) {
a && J.setAboutScreenVisible(b)
};
var p = Seadragon.Utils.makeNeutralElement(c),
u = Seadragon.Utils.makeNeutralElement(c),
A = Seadragon.Utils.makeNeutralElement(c),
D = Seadragon.Utils.makeNeutralElement(c);
p.style.position = A.style.position = u.style.position = D.style.position = B;
p.style.background = "black";
p.style.left = p.style.top = k;
p.style.width = p.style.height = x;
Seadragon.Utils.setElementOpacity(p, .7);
A.style.left = k;
A.style.top = "20px";
u.style.left = u.style.top = k;
u.style.width = u.style.height = x;
u.style.textAlign = i;
D.style.right = d;
D.style.bottom = "8px";
g.appendChild(p);
g.appendChild(u);
g.appendChild(A);
g.appendChild(D);
var v = Seadragon.Utils.makeNeutralElement(c),
y = Seadragon.Utils.makeNeutralElement("p"),
C = Seadragon.Utils.makeNeutralElement("p"),
E = Seadragon.Utils.makeNeutralElement("p"),
r = Seadragon.Utils.makeNeutralElement("a");
y.appendChild(document.createTextNode(Seadragon.Strings.getString(m)));
C.appendChild(document.createTextNode(Seadragon.Strings.getString(n)));
r.appendChild(document.createTextNode(Seadragon.Strings.getString(j)));
h(y);
h(C);
h(E);
h(r);
y.style.fontWeight = "bold";
y.style.paddingTop = "2em";
C.style.margin = "1em auto";
r.href = Seadragon.Strings.getString(j);
r.target = e;
r.style.color = "yellow";
r.style.textDecoration = f;
l(r);
var F = s,
G = t;
if (Seadragon.Utils.getBrowser() == Seadragon.Browser.IE && Seadragon.Utils.getBrowserVersion() < 8) G -= (100 - F) / 2;
v.style.width = F + "%";
v.style.marginLeft = G + "%";
v.style.textAlign = i;
E.appendChild(r);
v.appendChild(y);
v.appendChild(C);
v.appendChild(E);
u.appendChild(Seadragon.Utils.makeCenteredNode(v));
var z = Seadragon.Utils.makeNeutralElement("a"),
I = Seadragon.Utils.makeTransparentImage(Seadragon.Config.imagePath + q + w);
z.href = Seadragon.Strings.getString(o);
z.target = e;
l(z);
z.appendChild(I);
A.appendChild(z);
return g
}
Seadragon.BrandedViewer = function(r) {
var j = "animationfinish",
i = new Seadragon.Viewer(r),
n = v(i),
m = u(i),
k = b;
function s() {
i.addControl(n, Seadragon.ControlAnchor.BOTTOM_LEFT);
n.style.marginLeft = d;
n.style.marginBottom = d;
i.addEventListener("open", o)
}
function o() {
var b = i.viewport,
d = b.getZoom();
b.zoomBy(.01, c, a);
b.update();
k = a;
window.setTimeout(function() {
if (b !== i.viewport) return;
b.zoomTo(d * (Seadragon.Config.logarithmicZoom ? 1.65 : 1.15));
window.setTimeout(function() {
k && b === i.viewport && a(d);
i.addEventListener(j, q)
}, Seadragon.Config.animationTime * 1e3 / 2);
var a = p(b, "zoomTo")
}, 50)
}
function p(a, c) {
var d = a[c];
a[c] = function() {
k = b;
d.apply(a, arguments);
a[c] = d
};
return d
}
function q(a) {
k = b;
a.removeEventListener(j, arguments.callee)
}
s();
i.getLogoControl = function() {
return n
};
i.getAboutScreen = function() {
return m
};
i.isAboutScreenVisible = function() {
return m.parentNode == i.elmt
};
i.isIntroAnimating = function() {
return k
};
i.setAboutScreenVisible = function(a) {
if (a == i.isAboutScreenVisible()) return;
if (a) i.elmt.appendChild(m);
else i.elmt.removeChild(m)
};
i.addAboutFooterLink = function(d, i) {
var c = m.lastChild,
a = Seadragon.Utils.makeNeutralElement("a");
h(a);
l(a);
a.href = d;
a.target = e;
a.appendChild(document.createTextNode(i || d));
a.style.color = "yellow";
a.style.textDecoration = f;
if (c.firstChild) {
var b = Seadragon.Utils.makeNeutralElement(g);
h(b);
b.style.color = "gray";
b.appendChild(document.createTextNode(" | "));
c.appendChild(b)
}
c.appendChild(a)
};
i.setLogoCaption = function(i, c) {
var f = n.lastChild,
b = Seadragon.Utils.makeNeutralElement(c ? "a" : g),
a = b.style;
h(b);
a.color = "#ccc";
a.fontSize = "10px";
a.position = "relative";
a.bottom = "8px";
a.left = d;
b.appendChild(document.createTextNode(i));
if (c) {
b.href = c;
b.target = e;
a.color = "#cc0"
}
f.innerHTML = "";
f.appendChild(b)
};
return i
}
})();
(function() {
if (!window.Silverlight) {
window.Silverlight = {};
} else {
return;
}
Silverlight._silverlightCount = 0;
Silverlight.__onSilverlightInstalledCalled = false;
Silverlight.fwlinkRoot = '/web/20140802003648/http://go2.microsoft.com/fwlink/?LinkID=';
Silverlight.__installationEventFired = false;
Silverlight.onGetSilverlight = null;
Silverlight.onSilverlightInstalled = function() {
window.location.reload(false);
};
Silverlight.isInstalled = function(version) {
if (version == undefined)
version = null;
var isVersionSupported = false;
var container = null;
try {
var control = null;
var tryNS = false;
if (window.ActiveXObject) {
try {
control = new ActiveXObject('AgControl.AgControl');
if (version === null) {
isVersionSupported = true;
} else if (control.IsVersionSupported(version)) {
isVersionSupported = true;
}
control = null;
} catch (e) {
tryNS = true;
}
} else {
tryNS = true;
}
if (tryNS) {
var plugin = navigator.plugins["Silverlight Plug-In"];
if (plugin) {
if (version === null) {
isVersionSupported = true;
} else {
var actualVer = plugin.description;
if (actualVer === "1.0.30226.2")
actualVer = "2.0.30226.2";
var actualVerArray = actualVer.split(".");
while (actualVerArray.length > 3) {
actualVerArray.pop();
}
while (actualVerArray.length < 4) {
actualVerArray.push(0);
}
var reqVerArray = version.split(".");
while (reqVerArray.length > 4) {
reqVerArray.pop();
}
var requiredVersionPart;
var actualVersionPart;
var index = 0;
do {
requiredVersionPart = parseInt(reqVerArray[index]);
actualVersionPart = parseInt(actualVerArray[index]);
index++;
}
while (index < reqVerArray.length && requiredVersionPart === actualVersionPart);
if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) {
isVersionSupported = true;
}
}
}
}
} catch (e) {
isVersionSupported = false;
}
return isVersionSupported;
};
Silverlight.WaitForInstallCompletion = function() {
if (!Silverlight.isBrowserRestartRequired && Silverlight.onSilverlightInstalled) {
try {
navigator.plugins.refresh();
} catch (e) {}
if (Silverlight.isInstalled(null) && !Silverlight.__onSilverlightInstalledCalled) {
Silverlight.onSilverlightInstalled();
Silverlight.__onSilverlightInstalledCalled = true;
} else {
setTimeout(Silverlight.WaitForInstallCompletion, 3000);
}
}
};
Silverlight.__startup = function() {
navigator.plugins.refresh();
Silverlight.isBrowserRestartRequired = Silverlight.isInstalled(null);
if (!Silverlight.isBrowserRestartRequired) {
Silverlight.WaitForInstallCompletion();
if (!Silverlight.__installationEventFired) {
Silverlight.onInstallRequired();
Silverlight.__installationEventFired = true;
}
} else if (window.navigator.mimeTypes) {
var mimeSL2 = navigator.mimeTypes["application/x-silverlight-2"];
var mimeSL2b2 = navigator.mimeTypes["application/x-silverlight-2-b2"];
var mimeSL2b1 = navigator.mimeTypes["application/x-silverlight-2-b1"];
var mimeHighestBeta = mimeSL2b1;
if (mimeSL2b2)
mimeHighestBeta = mimeSL2b2;
if (!mimeSL2 && (mimeSL2b1 || mimeSL2b2)) {
if (!Silverlight.__installationEventFired) {
Silverlight.onUpgradeRequired();
Silverlight.__installationEventFired = true;
}
} else if (mimeSL2 && mimeHighestBeta) {
if (mimeSL2.enabledPlugin && mimeHighestBeta.enabledPlugin) {
if (mimeSL2.enabledPlugin.description != mimeHighestBeta.enabledPlugin.description) {
if (!Silverlight.__installationEventFired) {
Silverlight.onRestartRequired();
Silverlight.__installationEventFired = true;
}
}
}
}
}
if (!Silverlight.disableAutoStartup) {
if (window.removeEventListener) {
window.removeEventListener('load', Silverlight.__startup, false);
} else {
window.detachEvent('onload', Silverlight.__startup);
}
}
};
if (!Silverlight.disableAutoStartup) {
if (window.addEventListener) {
window.addEventListener('load', Silverlight.__startup, false);
} else {
window.attachEvent('onload', Silverlight.__startup);
}
}
Silverlight.createObject = function(source, parentElement, id, properties, events, initParams, userContext) {
var slPluginHelper = new Object();
var slProperties = properties;
var slEvents = events;
slPluginHelper.version = slProperties.version;
slProperties.source = source;
slPluginHelper.alt = slProperties.alt;
if (initParams)
slProperties.initParams = initParams;
if (slProperties.isWindowless && !slProperties.windowless)
slProperties.windowless = slProperties.isWindowless;
if (slProperties.framerate && !slProperties.maxFramerate)
slProperties.maxFramerate = slProperties.framerate;
if (id && !slProperties.id)
slProperties.id = id;
delete slProperties.ignoreBrowserVer;
delete slProperties.inplaceInstallPrompt;
delete slProperties.version;
delete slProperties.isWindowless;
delete slProperties.framerate;
delete slProperties.data;
delete slProperties.src;
delete slProperties.alt;
if (Silverlight.isInstalled(slPluginHelper.version)) {
for (var name in slEvents) {
if (slEvents[name]) {
if (name == "onLoad" && typeof slEvents[name] == "function" && slEvents[name].length != 1) {
var onLoadHandler = slEvents[name];
slEvents[name] = function(sender) {
return onLoadHandler(document.getElementById(id), userContext, sender)
};
}
var handlerName = Silverlight.__getHandlerName(slEvents[name]);
if (handlerName != null) {
slProperties[name] = handlerName;
slEvents[name] = null;
} else {
throw "typeof events." + name + " must be 'function' or 'string'";
}
}
}
slPluginHTML = Silverlight.buildHTML(slProperties);
} else {
slPluginHTML = Silverlight.buildPromptHTML(slPluginHelper);
}
if (parentElement) {
parentElement.innerHTML = slPluginHTML;
} else {
return slPluginHTML;
}
};
Silverlight.buildHTML = function(slProperties) {
var htmlBuilder = [];
htmlBuilder.push('<object type=\"application/x-silverlight\" data="data:application/x-silverlight,"');
if (slProperties.id != null) {
htmlBuilder.push(' id="' + Silverlight.HtmlAttributeEncode(slProperties.id) + '"');
}
if (slProperties.width != null) {
htmlBuilder.push(' width="' + slProperties.width + '"');
}
if (slProperties.height != null) {
htmlBuilder.push(' height="' + slProperties.height + '"');
}
htmlBuilder.push(' >');
delete slProperties.id;
delete slProperties.width;
delete slProperties.height;
for (var name in slProperties) {
if (slProperties[name]) {
htmlBuilder.push('<param name="' + Silverlight.HtmlAttributeEncode(name) + '" value="' + Silverlight.HtmlAttributeEncode(slProperties[name]) + '" />');
}
}
htmlBuilder.push('<\/object>');
return htmlBuilder.join('');
};
Silverlight.createObjectEx = function(params) {
var parameters = params;
var html = Silverlight.createObject(parameters.source, parameters.parentElement, parameters.id, parameters.properties, parameters.events, parameters.initParams, parameters.context);
if (parameters.parentElement == null) {
return html;
}
};
Silverlight.buildPromptHTML = function(slPluginHelper) {
var slPluginHTML = "";
var urlRoot = Silverlight.fwlinkRoot;
var version = slPluginHelper.version;
if (slPluginHelper.alt) {
slPluginHTML = slPluginHelper.alt;
} else {
if (!version) {
version = "";
}
slPluginHTML = "<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>";
slPluginHTML = slPluginHTML.replace('{1}', version);
slPluginHTML = slPluginHTML.replace('{2}', urlRoot + '108181');
}
return slPluginHTML;
};
Silverlight.getSilverlight = function(version) {
if (Silverlight.onGetSilverlight) {
Silverlight.onGetSilverlight();
}
var shortVer = "";
var reqVerArray = String(version).split(".");
if (reqVerArray.length > 1) {
var majorNum = parseInt(reqVerArray[0]);
if (isNaN(majorNum) || majorNum < 2) {
shortVer = "1.0";
} else {
shortVer = reqVerArray[0] + '.' + reqVerArray[1];
}
}
var verArg = "";
if (shortVer.match(/^\d+\056\d+$/)) {
verArg = "&v=" + shortVer;
}
Silverlight.followFWLink("149156" + verArg);
};
Silverlight.followFWLink = function(linkid) {
top.location = Silverlight.fwlinkRoot + String(linkid);
};
Silverlight.HtmlAttributeEncode = function(strInput) {
var c;
var retVal = '';
if (strInput == null) {
return null;
}
for (var cnt = 0; cnt < strInput.length; cnt++) {
c = strInput.charCodeAt(cnt);
if (((c > 96) && (c < 123)) || ((c > 64) && (c < 91)) || ((c > 43) && (c < 58) && (c != 47)) || (c == 95)) {
retVal = retVal + String.fromCharCode(c);
} else {
retVal = retVal + '&#' + c + ';';
}
}
return retVal;
};
Silverlight.default_error_handler = function(sender, args) {
var iErrorCode;
var errorType = args.ErrorType;
iErrorCode = args.ErrorCode;
var errMsg = "\nSilverlight error message \n";
errMsg += "ErrorCode: " + iErrorCode + "\n";
errMsg += "ErrorType: " + errorType + " \n";
errMsg += "Message: " + args.ErrorMessage + " \n";
if (errorType == "ParserError") {
errMsg += "XamlFile: " + args.xamlFile + " \n";
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
} else if (errorType == "RuntimeError") {
if (args.lineNumber != 0) {
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
errMsg += "MethodName: " + args.methodName + " \n";
}
alert(errMsg);
};
Silverlight.__cleanup = function() {
for (var i = Silverlight._silverlightCount - 1; i >= 0; i--) {
window['__slEvent' + i] = null;
}
Silverlight._silverlightCount = 0;
if (window.removeEventListener) {
window.removeEventListener('unload', Silverlight.__cleanup, false);
} else {
window.detachEvent('onunload', Silverlight.__cleanup);
}
};
Silverlight.__getHandlerName = function(handler) {
var handlerName = "";
if (typeof handler == "string") {
handlerName = handler;
} else if (typeof handler == "function") {
if (Silverlight._silverlightCount == 0) {
if (window.addEventListener) {
window.addEventListener('unload', Silverlight.__cleanup, false);
} else {
window.attachEvent('onunload', Silverlight.__cleanup);
}
}
var count = Silverlight._silverlightCount++;
handlerName = "__slEvent" + count;
window[handlerName] = handler;
} else {
handlerName = null;
}
return handlerName;
};
Silverlight.onRequiredVersionAvailable = function() {};
Silverlight.onRestartRequired = function() {};
Silverlight.onUpgradeRequired = function() {};
Silverlight.onInstallRequired = function() {};
Silverlight.IsVersionAvailableOnError = function(sender, args) {
var retVal = false;
try {
if (args.ErrorCode == 8001 && !Silverlight.__installationEventFired) {
Silverlight.onUpgradeRequired();
Silverlight.__installationEventFired = true;
} else if (args.ErrorCode == 8002 && !Silverlight.__installationEventFired) {
Silverlight.onRestartRequired();
Silverlight.__installationEventFired = true;
} else if (args.ErrorCode == 5014 || args.ErrorCode == 2106) {
if (Silverlight.__verifySilverlight2UpgradeSuccess(args.getHost())) {
retVal = true;
}
} else {
retVal = true;
}
} catch (e) {}
return retVal;
};
Silverlight.IsVersionAvailableOnLoad = function(sender) {
var retVal = false;
try {
if (Silverlight.__verifySilverlight2UpgradeSuccess(sender.getHost())) {
retVal = true;
}
} catch (e) {}
return retVal;
};
Silverlight.__verifySilverlight2UpgradeSuccess = function(host) {
var retVal = false;
var version = "4.0.50401";
var installationEvent = null;
try {
if (host.IsVersionSupported(version + ".99")) {
installationEvent = Silverlight.onRequiredVersionAvailable;
retVal = true;
} else if (host.IsVersionSupported(version + ".0")) {
installationEvent = Silverlight.onRestartRequired;
} else {
installationEvent = Silverlight.onUpgradeRequired;
}
if (installationEvent && !Silverlight.__installationEventFired) {
installationEvent();
Silverlight.__installationEventFired = true;
}
} catch (e) {}
return retVal;
};
})();
if (!window.Silverlight) {
window.Silverlight = {};
}
Silverlight.supportedUserAgent = function(version, userAgent) {
try {
var ua = null;
if (userAgent) {
ua = userAgent;
} else {
ua = window.navigator.userAgent;
}
var slua = {
OS: 'Unsupported',
Browser: 'Unsupported'
};
if (ua.indexOf('Windows NT') >= 0 || ua.indexOf('Mozilla/4.0 (compatible; MSIE 6.0)') >= 0) {
slua.OS = 'Windows';
} else if (ua.indexOf('PPC Mac OS X') >= 0) {
slua.OS = 'MacPPC';
} else if (ua.indexOf('Intel Mac OS X') >= 0) {
slua.OS = 'MacIntel';
} else if (ua.indexOf('Linux') >= 0) {
slua.OS = 'Linux';
}
if (slua.OS != 'Unsupported') {
if (ua.indexOf('MSIE') >= 0) {
if (navigator.userAgent.indexOf('Win64') == -1) {
if (parseInt(ua.split('MSIE')[1]) >= 6) {
slua.Browser = 'MSIE';
}
}
} else if (ua.indexOf('Firefox') >= 0) {
var versionArr = ua.split('Firefox/')[1].split('.');
var major = parseInt(versionArr[0]);
if (major >= 2) {
slua.Browser = 'Firefox';
} else {
var minor = parseInt(versionArr[1]);
if ((major == 1) && (minor >= 5)) {
slua.Browser = 'Firefox';
}
}
} else if (ua.indexOf('Chrome') >= 0) {
slua.Browser = 'Chrome';
} else if (ua.indexOf('Safari') >= 0) {
slua.Browser = 'Safari';
}
}
var sl_version = parseInt(version);
var supUA = (!(slua.OS == 'Unsupported' || slua.Browser == 'Unsupported' || (slua.OS == 'Windows' && slua.Browser == 'Safari') || (slua.OS.indexOf('Mac') >= 0 && slua.Browser == 'MSIE') || (slua.OS.indexOf('Mac') >= 0 && slua.Browser == 'Chrome')));
if ((slua.OS.indexOf('Windows') >= 0 && slua.Browser == 'Chrome' && sl_version < 4)) {
return false;
}
if ((slua.OS == 'MacPPC') && (sl_version > 1)) {
return ((supUA && (slua.OS != 'MacPPC')));
}
if ((slua.OS == 'Linux') && (sl_version > 2)) {
return ((supUA && (slua.OS != 'Linux')));
}
if (version == '1.0') {
return (supUA && (ua.indexOf('Windows NT 5.0') < 0));
} else {
return (supUA);
}
} catch (e) {
return false;
}
};
(function() {
if (!window.Silverlight) {
throw new Error("Silverlight.js has not been included.");
} else if (!Silverlight.supportedUserAgent) {
throw new Error("Silverlight.supportedUserAgent.js has not been included.");
} else if (!window.Seadragon) {
throw new Error("Seadragon Ajax has not been included.");
} else if (Seadragon.ComboViewer) {
return;
}
Seadragon.Config.imagePath = "/web/20140802003648/http://zoom.it/images/seajax/";
Seadragon.Config.xapPath = "/web/20140802003648/http://zoom.it/scripts/";
Seadragon.Config.windowlessMode = false;
Seadragon.Config.constrainDuringPan = false;
Seadragon.Config.visibilityRatio = 0.5;
Seadragon.Strings.setString("About.Header", "Welcome to Zoom.it");
Seadragon.Strings.setString("About.Description", "Explore this Deep Zoom Image by clicking to zoom and dragging to pan (or by spinning your scroll wheel). " + "\n\nCreate and share your own at:");
Seadragon.Strings.setString("About.LogoUrl", "/web/20140802003648/http://zoom.it/");
Seadragon.Strings.setString("About.MainUrl", "/web/20140802003648/http://zoom.it/");
Seadragon.Strings.setString("About.SilverlightBefore", "Want better performance? ");
Seadragon.Strings.setString("About.SilverlightDuring", "Install Silverlight");
Seadragon.Strings.setString("About.SilverlightAfter", "");
Seadragon.Strings.setString("About.SilverlightUrl", "/web/20140802003648/http://www.microsoft.com/getsilverlight/");
Seadragon.Strings.setString("Tooltips.AboutButton", "About Zoom.it");
var SL_VERSION = "3.0.40818.0";
var SL_XAPNAME = "DeepZoomViewer.xap";
var SL_ICON = "../branding/silverlight.png";
var SL_BLESSED = Silverlight.supportedUserAgent(SL_VERSION.substr(0, 3));
var SL_INSTALLED = SL_BLESSED && Silverlight.isInstalled(SL_VERSION);
var IS_FILE_SCHEME = window.location.protocol.toLowerCase() == "file:";
var ComboViewer = function(container, callback, initDziXmlUrlOrJsonObj, initDziXmlString) {
var self = this;
var viewer = null;
var pluginLoaded = false;
var containerElmt = Seadragon.Utils.getElement(container);
var slTileSourceFactory = null;
var currentTileSource = null;
this.isSilverlight = SL_INSTALLED;
this.rawViewer = null;
this.onFirstInteraction = null;
this.onSilverlightInstall = null;
this.onResize = null;
function createAjaxViewer(dziTileSource) {
self.isSilverlight = false;
viewer = self.rawViewer = new Seadragon.BrandedViewer(container);
var aboutScreen = viewer.getAboutScreen();
var aboutPara = aboutScreen.getElementsByTagName("p")[1];
var aboutDesc = aboutPara.parentNode;
var apStyle = aboutPara.style;
if (SL_BLESSED && !SL_INSTALLED && !IS_FILE_SCHEME) {
var upgradePara = Seadragon.Utils.makeNeutralElement("p");
var upgradeLink = Seadragon.Utils.makeNeutralElement("a");
upgradeLink.href = Seadragon.Strings.getString("About.SilverlightUrl");
upgradeLink.target = "_blank";
var upStyle = upgradePara.style;
var ulStyle = upgradeLink.style;
upStyle.color = ulStyle.color = apStyle.color;
upStyle.fontFamily = ulStyle.fontFamily = apStyle.fontFamily;
upStyle.fontSize = ulStyle.fontSize = apStyle.fontSize;
upStyle.fontSizeAdjust = ulStyle.fontSizeAdjust = apStyle.fontSizeAdjust;
upStyle.fontStyle = ulStyle.fontStyle = apStyle.fontStyle;
upStyle.fontStretch = ulStyle.fontStretch = apStyle.fontStretch;
upStyle.fontVariant = ulStyle.fontVariant = apStyle.fontVariant;
upStyle.fontWeight = ulStyle.fontWeight = apStyle.fontWeight;
upStyle.lineHeight = ulStyle.lineHeight = apStyle.lineHeight;
upStyle.textAlign = ulStyle.textAlign = apStyle.textAlign;
upStyle.textDecoration = ulStyle.textDecoration = apStyle.textDecoration;
ulStyle.color = "#0cf";
ulStyle.fontWeight = "bold";
ulStyle.textDecoration = "none";
ulStyle.background = "transparent url(" +
Seadragon.Config.imagePath + SL_ICON + ") no-repeat scroll left center";
ulStyle.marginLeft = "4px";
ulStyle.paddingLeft = "18px";
upStyle.marginTop = "1em";
Seadragon.Utils.addEvent(upgradeLink, "mouseup", Seadragon.Utils.stopEvent);
Seadragon.Utils.addEvent(upgradeLink, "click", function(event) {
Seadragon.Utils.stopEvent(event);
var eventHandler = self.onSilverlightInstall;
if (typeof eventHandler === "function") {
eventHandler(self);
}
});
upgradeLink.appendChild(document.createTextNode(Seadragon.Strings.getString("About.SilverlightDuring")));
upgradePara.appendChild(document.createTextNode(Seadragon.Strings.getString("About.SilverlightBefore")));
upgradePara.appendChild(upgradeLink);
upgradePara.appendChild(document.createTextNode(Seadragon.Strings.getString("About.SilverlightAfter")));
aboutDesc.appendChild(upgradePara);
}
viewer.addEventListener("animation", onAjaxAnimation);
viewer.addEventListener("resize", onAjaxResize);
if (dziTileSource) {
viewer.openTileSource(dziTileSource);
} else if (initDziXmlUrlOrJsonObj) {
viewer.openDzi(initDziXmlUrlOrJsonObj, initDziXmlString);
}
}
function callCallback(wasCalledBefore) {
if (typeof callback == "function") {
callback(self, wasCalledBefore);
}
}
function init(dziUrl, dziTileSource) {
var HOSTNAME_REGEX = /http[s]?:\/\/([^\/]+)/;
function isLocal(hostname) {
return hostname.indexOf('.') < 0 && hostname.indexOf("localhost") < 0;
}
var pageIsLocal = isLocal(location.hostname);
var dziPath = dziUrl || "";
var dziPathMatches = dziPath.match(HOSTNAME_REGEX);
var dziPathIsAbsolute = !!dziPathMatches;
var dziIsLocal = dziPathIsAbsolute ? isLocal(dziPathMatches[1]) : pageIsLocal;
var xapPath = (Seadragon.Config.xapPath || "").toLowerCase();
var xapPathMatches = xapPath.match(HOSTNAME_REGEX);
var xapPathIsAbsolute = !!xapPathMatches;
var xapIsLocal = xapPathIsAbsolute ? isLocal(xapPathMatches[1]) : pageIsLocal;
var crossZone = (xapIsLocal !== dziIsLocal);
if (!SL_INSTALLED || IS_FILE_SCHEME || crossZone) {
window.setTimeout(function() {
createAjaxViewer(dziTileSource);
callCallback();
}, 1);
return;
}
var objectDiv = Seadragon.Utils.makeNeutralElement("div");
var objectDivStyle = objectDiv.style;
objectDivStyle.width = "100%";
objectDivStyle.height = "100%";
containerElmt.innerHTML = "";
containerElmt.appendChild(objectDiv);
var initParams = !dziUrl ? "" : ["url=", dziUrl, ",height=", dziTileSource.height].join('');
var props = {
"width": "100%",
"height": "100%",
"background": "transparent",
"version": SL_VERSION,
"enableHtmlAccess": "true",
"windowless": (Seadragon.Config.windowlessMode || false).toString()
};
var events = {
"onLoad": onPluginLoad,
"onError": onPluginError
};
Silverlight.createObject(Seadragon.Config.xapPath + SL_XAPNAME, objectDiv, "", props, events, initParams, null);
}
function onPluginLoad(objectElmt, userContext, sender) {
if (self.isSilverlight) {
var slContent = sender.getHost().Content;
viewer = self.rawViewer = slContent.Viewer;
slTileSourceFactory = slContent.TileSourceFactory;
if (currentTileSource) {
self.openTileSource(currentTileSource);
}
}
updateSilverlightStrings();
viewer.addEventListener("Animation", onSilverlightAnimation);
viewer.addEventListener("Resize", onSilverlightResize);
callCallback(pluginLoaded ? true : false)
pluginLoaded = true;
}
function onPluginError(sender, args) {
if (!pluginLoaded) {
pluginLoaded = true;
createAjaxViewer();
callCallback();
} else {
Seadragon.Debug.error(["Silverlight ", args.ErrorType, " [", args.ErrorCode, "]: ", args.ErrorMessage].join(''));
}
}
function parseDziArgs(xmlUrlOrJsonObj, xmlString, callback) {
var dziUrl;
function finish(dziTileSource, error) {
if (!dziTileSource) {
throw new Error(error);
}
callback(dziUrl, dziTileSource);
}
switch (typeof xmlUrlOrJsonObj) {
case "string":
dziUrl = xmlUrlOrJsonObj;
Seadragon.DziTileSource.createFromXml(dziUrl, xmlString, finish);
break;
default:
dziUrl = xmlUrlOrJsonObj.url;
Seadragon.DziTileSource.createFromJson(xmlUrlOrJsonObj, finish);
break;
}
}
function updateSilverlightStrings() {
if (!self.isSilverlight) {
return;
}
viewer.AboutPage.HeaderText = Seadragon.Strings.getString("About.Header");
viewer.AboutPage.DescriptionText = Seadragon.Strings.getString("About.Description");
viewer.AboutPage.LogoHyperlinkUrl = Seadragon.Strings.getString("About.LogoUrl");
viewer.AboutPage.MainHyperlinkUrl = viewer.AboutPage.MainHyperlinkText = Seadragon.Strings.getString("About.MainUrl");
viewer.LogoTooltip = Seadragon.Strings.getString("Tooltips.AboutButton");
}
function onAjaxAnimation(viewer) {
if (viewer.isIntroAnimating()) {
return;
}
viewer.removeEventListener("animation", arguments.callee);
var eventHandler = self.onFirstInteraction;
if (typeof eventHandler === "function") {
eventHandler(self);
}
}
function onSilverlightAnimation(viewer) {
if (viewer.IsIntroAnimating) {
return;
}
viewer.removeEventListener("Animation", arguments.callee);
var eventHandler = self.onFirstInteraction;
if (typeof eventHandler === "function") {
eventHandler(self);
}
}
function onAjaxResize(viewer) {
var eventHandler = self.onResize;
if (typeof eventHandler === "function") {
eventHandler(self);
}
}
function onSilverlightResize(viewer) {
var eventHandler = self.onResize;
if (typeof eventHandler === "function") {
eventHandler(self);
}
}
function openSilverlightDzi(dziUrl, dziTileSource) {
viewer.LoadURL(dziUrl, dziTileSource.height);
}
this.openDzi = function(xmlUrlOrJsonObj, xmlString) {
if (self.isSilverlight) {
parseDziArgs(xmlUrlOrJsonObj, xmlString, openSilverlightDzi);
currentTileSource = null;
} else {
viewer.openDzi(xmlUrlOrJsonObj, xmlString);
}
};
this.openTileSource = function(tileSource) {
if (self.isSilverlight) {
var jsTS = tileSource;
var slTS = slTileSourceFactory.CreateTileSource(jsTS.width, jsTS.height, jsTS.tileSize, jsTS.tileOverlap);
slTS.GetTileUrl = function(sender, e) {
var level = e.Level,
col = e.Col,
row = e.Row;
if (jsTS.tileExists(level, col, row)) {
e.TileUrl = jsTS.getTileUrl(level, col, row);
}
};
viewer.OpenTileSource(slTS, jsTS.height);
currentTileSource = jsTS;
} else {
viewer.openTileSource(tileSource);
}
};
this.close = function() {
if (self.isSilverlight) {
viewer.Close();
} else {
viewer.close();
}
};
this.isOpen = function() {
if (self.isSilverlight) {
return viewer.IsOpen;
} else {
return viewer.isOpen();
}
};
this.setAboutHeader = function(str) {
if (self.isSilverlight) {
viewer.AboutPage.HeaderText = str;
} else {
var aboutPara = viewer.getAboutScreen().getElementsByTagName("p")[0];
aboutPara.innerHTML = "";
aboutPara.appendChild(document.createTextNode(str));
}
};
this.setAboutDescription = function(str) {
if (self.isSilverlight) {
viewer.AboutPage.DescriptionText = str;
} else {
var aboutPara = viewer.getAboutScreen().getElementsByTagName("p")[1];
aboutPara.innerHTML = "";
aboutPara.appendChild(document.createTextNode(str));
}
};
this.setAboutMainLink = function(url, text) {
if (self.isSilverlight) {
viewer.AboutPage.MainHyperlinkUrl = url;
viewer.AboutPage.MainHyperlinkText = text || url;
} else {
var aboutLink = viewer.getAboutScreen().getElementsByTagName("a")[0];
aboutLink.href = url;
aboutLink.innerHTML = "";
aboutLink.appendChild(document.createTextNode(text || url));
}
};
this.addAboutFooterLink = function(url, text) {
if (self.isSilverlight) {
viewer.AboutPage.AddCustomHyperlink(url, text || url);
} else {
viewer.addAboutFooterLink(url, text);
}
};
this.setLogoCaption = function(text, url) {
if (self.isSilverlight) {
viewer.SetLogoCaption(text, url);
} else {
viewer.setLogoCaption(text, url);
}
};
this.setLogoTooltip = function(str) {
if (self.isSilverlight) {
viewer.LogoTooltip = str;
} else {
var aboutButton = viewer.getLogoControl().firstChild;
aboutButton.title = str;
}
};
this.isFullPage = function() {
if (self.isSilverlight) {
return viewer.IsFullPage;
} else {
return viewer.isFullPage();
}
};
this.setFullPage = function(value) {
if (self.isSilverlight) {
viewer.SetFullPage(value);
} else {
viewer.setFullPage(value);
}
};
(function() {
if (initDziXmlUrlOrJsonObj) {
parseDziArgs(initDziXmlUrlOrJsonObj, initDziXmlString, init);
} else {
init();
}
})();
};
Seadragon.ComboViewer = {};
Seadragon.ComboViewer.create = function(container, callback) {
new ComboViewer(container, callback);
};
Seadragon.ComboViewer.createAndOpenDzi = function(container, xmlUrlOrJsonObj, xmlStringOrJsonCallback, xmlCallback) {
var callback, xmlString;
switch (typeof xmlUrlOrJsonObj) {
case "string":
xmlString = xmlStringOrJsonCallback;
callback = xmlCallback;
break;
default:
callback = xmlStringOrJsonCallback;
break;
}
new ComboViewer(container, callback, xmlUrlOrJsonObj, xmlString);
};
})();
var _gat = new Object({
c: "length",
lb: "4.3.1",
m: "cookie",
b: undefined,
cb: function(d, a) {
this.zb = d;
this.Nb = a
},
r: "__utma=",
W: "__utmb=",
ma: "__utmc=",
Ta: "__utmk=",
na: "__utmv=",
oa: "__utmx=",
Sa: "GASO=",
X: "__utmz=",
lc: "/web/20140802003648/http://www.google-analytics.com/__utm.gif",
mc: "/web/20140802003648/https://ssl.google-analytics.com/__utm.gif",
Wa: "utmcid=",
Ya: "utmcsr=",
$a: "utmgclid=",
Ua: "utmccn=",
Xa: "utmcmd=",
Za: "utmctr=",
Va: "utmcct=",
Hb: false,
_gasoDomain: undefined,
_gasoCPath: undefined,
e: window,
a: document,
k: navigator,
t: function(d) {
var a = 1,
c = 0,
h,
o;
if (!_gat.q(d)) {
a = 0;
for (h = d[_gat.c] - 1; h >= 0; h--) {
o = d.charCodeAt(h);
a = (a << 6 & 268435455) + o + (o << 14);
c = a & 266338304;
a = c != 0 ? a ^ c >> 21 : a
}
}
return a
},
C: function(d, a, c) {
var h = _gat,
o = "-",
k, l, s = h.q;
if (!s(d) && !s(a) && !s(c)) {
k = h.w(d, a);
if (k > -1) {
l = d.indexOf(c, k);
if (l < 0) l = d[h.c];
o = h.F(d, k + h.w(a, "=") + 1, l)
}
}
return o
},
Ea: function(d) {
var a = false,
c = 0,
h, o;
if (!_gat.q(d)) {
a = true;
for (h = 0; h < d[_gat.c]; h++) {
o = d.charAt(h);
c += "." == o ? 1 : 0;
a = a && c <= 1 && (0 == h && "-" == o || _gat.P(".0123456789", o))
}
}
return a
},
d: function(d, a) {
var c = encodeURIComponent;
return c instanceof Function ? (a ? encodeURI(d) : c(d)) : escape(d)
},
J: function(d, a) {
var c = decodeURIComponent,
h;
d = d.split("+").join(" ");
if (c instanceof Function) try {
h = a ? decodeURI(d) : c(d)
} catch (o) {
h = unescape(d)
} else h = unescape(d);
return h
},
Db: function(d) {
return d && d.hash ? _gat.F(d.href, _gat.w(d.href, "#")) : ""
},
q: function(d) {
return _gat.b == d || "-" == d || "" == d
},
Lb: function(d) {
return d[_gat.c] > 0 && _gat.P(" \n\r\t", d)
},
P: function(d, a) {
return _gat.w(d, a) > -1
},
h: function(d, a) {
d[d[_gat.c]] = a
},
T: function(d) {
return d.toLowerCase()
},
z: function(d, a) {
return d.split(a)
},
w: function(d, a) {
return d.indexOf(a)
},
F: function(d, a, c) {
c = _gat.b == c ? d[_gat.c] : c;
return d.substring(a, c)
},
uc: function() {
var d = _gat.b,
a = window;
if (a && a.gaGlobal && a.gaGlobal.hid) d = a.gaGlobal.hid;
else {
d = Math.round(Math.random() * 2147483647);
a.gaGlobal = a.gaGlobal ? a.gaGlobal : {};
a.gaGlobal.hid = d
}
return d
},
wa: function() {
return Math.round(Math.random() * 2147483647)
},
Gc: function() {
return (_gat.wa() ^ _gat.vc()) * 2147483647
},
vc: function() {
var d = _gat.k,
a = _gat.a,
c = _gat.e,
h = a[_gat.m] ?
a[_gat.m] : "",
o = c.history[_gat.c],
k, l, s = [d.appName, d.version, d.language ? d.language : d.browserLanguage, d.platform, d.userAgent, d.javaEnabled() ? 1 : 0].join("");
if (c.screen) s += c.screen.width + "x" + c.screen.height + c.screen.colorDepth;
else if (c.java) {
l = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
s += l.screen.width + "x" + l.screen.height
}
s += h;
s += a.referrer ? a.referrer : "";
k = s[_gat.c];
while (o > 0) s += o-- ^ k++;
return _gat.t(s)
}
});
_gat.hc = function() {
var d = this,
a = _gat.cb;
function c(h, o) {
return new a(h, o)
}
d.db = "utm_campaign";
d.eb = "utm_content";
d.fb = "utm_id";
d.gb = "utm_medium";
d.hb = "utm_nooverride";
d.ib = "utm_source";
d.jb = "utm_term";
d.kb = "gclid";
d.pa = 0;
d.I = 0;
d.wb = "15768000";
d.Tb = "1800";
d.ea = [];
d.ga = [];
d.Ic = "cse";
d.Gb = "q";
d.ab = "google";
d.fa = [c(d.ab, d.Gb), c("yahoo", "p"), c("msn", "q"), c("bing", "q"), c("aol", "query"), c("aol", "encquery"), c("lycos", "query"), c("ask", "q"), c("altavista", "q"), c("netscape", "query"), c("cnn", "query"), c("looksmart", "qt"), c("about",
"terms"), c("mamma", "query"), c("alltheweb", "q"), c("gigablast", "q"), c("voila", "rdata"), c("virgilio", "qs"), c("live", "q"), c("baidu", "wd"), c("alice", "qs"), c("yandex", "text"), c("najdi", "q"), c("aol", "q"), c("club-internet", "query"), c("mama", "query"), c("seznam", "q"), c("search", "q"), c("wp", "szukaj"), c("onet", "qt"), c("netsprint", "q"), c("google.interia", "q"), c("szukacz", "q"), c("yam", "k"), c("pchome", "q"), c("kvasir", "searchExpr"), c("sesam", "q"), c("ozu", "q"), c("terra", "query"), c("nostrum", "query"), c("mynet", "q"),
c("ekolay", "q"), c("search.ilse", "search_for")
];
d.B = undefined;
d.Kb = false;
d.p = "/";
d.ha = 100;
d.Da = "/__utm.gif";
d.ta = 1;
d.ua = 1;
d.G = "|";
d.sa = 1;
d.qa = 1;
d.pb = 1;
d.g = "auto";
d.D = 1;
d.Ga = 1000;
d.Yc = 10;
d.nc = 10;
d.Zc = 0.2
};
_gat.Y = function(d, a) {
var c, h, o, k, l, s, q, f = this,
n = _gat,
w = n.q,
x = n.c,
g, z = a;
f.a = d;
function B(i) {
var b = i instanceof Array ? i.join(".") : "";
return w(b) ? "-" : b
}
function A(i, b) {
var e = [],
j;
if (!w(i)) {
e = n.z(i, ".");
if (b)
for (j = 0; j < e[x]; j++)
if (!n.Ea(e[j])) e[j] = "-"
}
return e
}
function p() {
return u(63072000000)
}
function u(i) {
var b = new Date,
e = new Date(b.getTime() + i);
return "expires=" + e.toGMTString() + "; "
}
function m(i, b) {
f.a[n.m] = i + "; path=" + z.p + "; " + b + f.Cc()
}
function r(i, b, e) {
var j = f.V,
t, v;
for (t = 0; t < j[x]; t++) {
v = j[t][0];
v += w(b) ? b : b + j[t][4];
j[t][2](n.C(i, v, e))
}
}
f.Jb = function() {
return n.b == g || g == f.t()
};
f.Ba = function() {
return l ? l : "-"
};
f.Wb = function(i) {
l = i
};
f.Ma = function(i) {
g = n.Ea(i) ? i * 1 : "-"
};
f.Aa = function() {
return B(s)
};
f.Na = function(i) {
s = A(i)
};
f.Hc = function() {
return g ? g : "-"
};
f.Cc = function() {
return w(z.g) ? "" : "domain=" + z.g + ";"
};
f.ya = function() {
return B(c)
};
f.Ub = function(i) {
c = A(i, 1)
};
f.K = function() {
return B(h)
};
f.La = function(i) {
h = A(i, 1)
};
f.za = function() {
return B(o)
};
f.Vb = function(i) {
o = A(i, 1)
};
f.Ca = function() {
return B(k)
};
f.Xb = function(i) {
k = A(i);
for (var b = 0; b < k[x]; b++)
if (b < 4 && !n.Ea(k[b])) k[b] = "-"
};
f.Dc = function() {
return q
};
f.Uc = function(i) {
q = i
};
f.pc = function() {
c = [];
h = [];
o = [];
k = [];
l = n.b;
s = [];
g = n.b
};
f.t = function() {
var i = "",
b;
for (b = 0; b < f.V[x]; b++) i += f.V[b][1]();
return n.t(i)
};
f.Ha = function(i) {
var b = f.a[n.m],
e = false;
if (b) {
r(b, i, ";");
f.Ma(f.t());
e = true
}
return e
};
f.Rc = function(i) {
r(i, "", "&");
f.Ma(n.C(i, n.Ta, "&"))
};
f.Wc = function() {
var i = f.V,
b = [],
e;
for (e = 0; e < i[x]; e++) n.h(b, i[e][0] + i[e][1]());
n.h(b, n.Ta + f.t());
return b.join("&")
};
f.bd = function(i, b) {
var e = f.V,
j = z.p,
t;
f.Ha(i);
z.p = b;
for (t = 0; t < e[x]; t++)
if (!w(e[t][1]())) e[t][3]();
z.p = j
};
f.dc = function() {
m(n.r + f.ya(), p())
};
f.Pa = function() {
m(n.W + f.K(), u(z.Tb * 1000))
};
f.ec = function() {
m(n.ma + f.za(), "")
};
f.Ra = function() {
m(n.X + f.Ca(), u(z.wb * 1000))
};
f.fc = function() {
m(n.oa + f.Ba(), p())
};
f.Qa = function() {
m(n.na + f.Aa(), p())
};
f.cd = function() {
m(n.Sa + f.Dc(), "")
};
f.V = [
[n.r, f.ya, f.Ub, f.dc, "."],
[n.W, f.K, f.La, f.Pa, ""],
[n.ma, f.za, f.Vb, f.ec, ""],
[n.oa, f.Ba, f.Wb, f.fc, ""],
[n.X, f.Ca, f.Xb, f.Ra, "."],
[n.na,
f.Aa, f.Na, f.Qa, "."
]
]
};
_gat.jc = function(d) {
var a = this,
c = _gat,
h = d,
o, k = function(l) {
var s = (new Date).getTime(),
q;
q = (s - l[3]) * (h.Zc / 1000);
if (q >= 1) {
l[2] = Math.min(Math.floor(l[2] * 1 + q), h.nc);
l[3] = s
}
return l
};
a.O = function(l, s, q, f, n, w, x) {
var g, z = h.D,
B = q.location;
if (!o) o = new c.Y(q, h);
o.Ha(f);
g = c.z(o.K(), ".");
if (g[1] < 500 || n) {
if (w) g = k(g);
if (n || !w || g[2] >= 1) {
if (!n && w) g[2] = g[2] * 1 - 1;
g[1] = g[1] * 1 + 1;
l = "?utmwv=" + _gat.lb + "&utmn=" + c.wa() + (c.q(B.hostname) ? "" : "&utmhn=" + c.d(B.hostname)) + (h.ha == 100 ? "" : "&utmsp=" + c.d(h.ha)) + l;
if (0 == z || 2 == z) {
var A =
new Image(1, 1);
A.src = h.Da + l;
var p = 2 == z ? function() {} : x || function() {};
A.onload = p
}
if (1 == z || 2 == z) {
var u = new Image(1, 1);
u.src = ("https:" == B.protocol ? c.mc : c.lc) + l + "&utmac=" + s + "&utmcc=" + a.wc(q, f);
u.onload = x || function() {}
}
}
}
o.La(g.join("."));
o.Pa()
};
a.wc = function(l, s) {
var q = [],
f = [c.r, c.X, c.na, c.oa],
n, w = l[c.m],
x;
for (n = 0; n < f[c.c]; n++) {
x = c.C(w, f[n] + s, ";");
if (!c.q(x)) c.h(q, f[n] + x + ";")
}
return c.d(q.join("+"))
}
};
_gat.i = function() {
this.la = []
};
_gat.i.bb = function(d, a, c, h, o, k) {
var l = this;
l.cc = d;
l.Oa = a;
l.L = c;
l.sb = h;
l.Pb = o;
l.Qb = k
};
_gat.i.bb.prototype.S = function() {
var d = this,
a = _gat.d;
return "&" + ["utmt=item", "utmtid=" + a(d.cc), "utmipc=" + a(d.Oa), "utmipn=" + a(d.L), "utmiva=" + a(d.sb), "utmipr=" + a(d.Pb), "utmiqt=" + a(d.Qb)].join("&")
};
_gat.i.$ = function(d, a, c, h, o, k, l, s) {
var q = this;
q.v = d;
q.ob = a;
q.bc = c;
q.ac = h;
q.Yb = o;
q.ub = k;
q.$b = l;
q.xb = s;
q.ca = []
};
_gat.i.$.prototype.mb = function(d, a, c, h, o) {
var k = this,
l = k.Eb(d),
s = k.v,
q = _gat;
if (q.b ==
l) q.h(k.ca, new q.i.bb(s, d, a, c, h, o));
else {
l.cc = s;
l.Oa = d;
l.L = a;
l.sb = c;
l.Pb = h;
l.Qb = o
}
};
_gat.i.$.prototype.Eb = function(d) {
var a, c = this.ca,
h;
for (h = 0; h < c[_gat.c]; h++) a = d == c[h].Oa ? c[h] : a;
return a
};
_gat.i.$.prototype.S = function() {
var d = this,
a = _gat.d;
return "&" + ["utmt=tran", "utmtid=" + a(d.v), "utmtst=" + a(d.ob), "utmtto=" + a(d.bc), "utmttx=" + a(d.ac), "utmtsp=" + a(d.Yb), "utmtci=" + a(d.ub), "utmtrg=" + a(d.$b), "utmtco=" + a(d.xb)].join("&")
};
_gat.i.prototype.nb = function(d, a, c, h, o, k, l, s) {
var q = this,
f = _gat,
n = q.xa(d);
if (f.b ==
n) {
n = new f.i.$(d, a, c, h, o, k, l, s);
f.h(q.la, n)
} else {
n.ob = a;
n.bc = c;
n.ac = h;
n.Yb = o;
n.ub = k;
n.$b = l;
n.xb = s
}
return n
};
_gat.i.prototype.xa = function(d) {
var a, c = this.la,
h;
for (h = 0; h < c[_gat.c]; h++) a = d == c[h].v ? c[h] : a;
return a
};
_gat.gc = function(d) {
var a = this,
c = "-",
h = _gat,
o = d;
a.Ja = screen;
a.qb = !self.screen && self.java ? java.awt.Toolkit.getDefaultToolkit() : h.b;
a.a = document;
a.e = window;
a.k = navigator;
a.Ka = c;
a.Sb = c;
a.tb = c;
a.Ob = c;
a.Mb = 1;
a.Bb = c;
function k() {
var l, s, q, f, n = "ShockwaveFlash",
w = "$version",
x = a.k ? a.k.plugins : h.b;
if (x && x[h.c] > 0)
for (l = 0; l < x[h.c] && !q; l++) {
s = x[l];
if (h.P(s.name, "Shockwave Flash")) q = h.z(s.description, "Shockwave Flash ")[1]
} else {
n = n + "." + n;
try {
f = new ActiveXObject(n + ".7");
q = f.GetVariable(w)
} catch (g) {}
if (!q) try {
f =
new ActiveXObject(n + ".6");
q = "WIN 6,0,21,0";
f.AllowScriptAccess = "always";
q = f.GetVariable(w)
} catch (z) {}
if (!q) try {
f = new ActiveXObject(n);
q = f.GetVariable(w)
} catch (z) {}
if (q) {
q = h.z(h.z(q, " ")[1], ",");
q = q[0] + "." + q[1] + " r" + q[2]
}
}
return q ? q : c
}
a.xc = function() {
var l;
if (self.screen) {
a.Ka = a.Ja.width + "x" + a.Ja.height;
a.Sb = a.Ja.colorDepth + "-bit"
} else if (a.qb) try {
l = a.qb.getScreenSize();
a.Ka = l.width + "x" + l.height
} catch (s) {}
a.Ob = h.T(a.k && a.k.language ? a.k.language : (a.k && a.k.browserLanguage ? a.k.browserLanguage : c));
a.Mb =
a.k && a.k.javaEnabled() ? 1 : 0;
a.Bb = o ? k() : c;
a.tb = h.d(a.a.characterSet ? a.a.characterSet : (a.a.charset ? a.a.charset : c))
};
a.Xc = function() {
return "&" + ["utmcs=" + h.d(a.tb), "utmsr=" + a.Ka, "utmsc=" + a.Sb, "utmul=" + a.Ob, "utmje=" + a.Mb, "utmfl=" + h.d(a.Bb)].join("&")
}
};
_gat.n = function(d, a, c, h, o) {
var k = this,
l = _gat,
s = l.q,
q = l.b,
f = l.P,
n = l.C,
w = l.T,
x = l.z,
g = l.c;
k.a = a;
k.f = d;
k.Rb = c;
k.ja = h;
k.o = o;
function z(p) {
return s(p) || "0" == p || !f(p, "://")
}
function B(p) {
var u = "";
p = w(x(p, "://")[1]);
if (f(p, "/")) {
p = x(p, "/")[1];
if (f(p, "?")) u = x(p, "?")[0]
}
return u
}
function A(p) {
var u = "";
u = w(x(p, "://")[1]);
if (f(u, "/")) u = x(u, "/")[0];
return u
}
k.Fc = function(p) {
var u = k.Fb(),
m = k.o;
return new l.n.s(n(p, m.fb + "=", "&"), n(p, m.ib + "=", "&"), n(p, m.kb + "=", "&"), k.ba(p, m.db, "(not set)"), k.ba(p, m.gb, "(not set)"),
k.ba(p, m.jb, u && !s(u.R) ? l.J(u.R) : q), k.ba(p, m.eb, q))
};
k.Ib = function(p) {
var u = A(p),
m = B(p);
if (f(u, k.o.ab)) {
p = x(p, "?").join("&");
if (f(p, "&" + k.o.Gb + "="))
if (m == k.o.Ic) return true
}
return false
};
k.Fb = function() {
var p, u, m = k.Rb,
r, i, b = k.o.fa;
if (z(m) || k.Ib(m)) return;
p = A(m);
for (r = 0; r < b[g]; r++) {
i = b[r];
if (f(p, w(i.zb))) {
m = x(m, "?").join("&");
if (f(m, "&" + i.Nb + "=")) {
u = x(m, "&" + i.Nb + "=")[1];
if (f(u, "&")) u = x(u, "&")[0];
return new l.n.s(q, i.zb, q, "(organic)", "organic", u, q)
}
}
}
};
k.ba = function(p, u, m) {
var r = n(p, u + "=", "&"),
i = !s(r) ?
l.J(r) : (!s(m) ? m : "-");
return i
};
k.Nc = function(p) {
var u = k.o.ea,
m = false,
r, i;
if (p && "organic" == p.da) {
r = w(l.J(p.R));
for (i = 0; i < u[g]; i++) m = m || w(u[i]) == r
}
return m
};
k.Ec = function() {
var p = "",
u = "",
m = k.Rb;
if (z(m) || k.Ib(m)) return;
p = w(x(m, "://")[1]);
if (f(p, "/")) {
u = l.F(p, l.w(p, "/"));
if (f(u, "?")) u = x(u, "?")[0];
p = x(p, "/")[0]
}
if (0 == l.w(p, "www.")) p = l.F(p, 4);
return new l.n.s(q, p, q, "(referral)", "referral", q, u)
};
k.sc = function(p) {
var u = "";
if (k.o.pa) {
u = l.Db(p);
u = "" != u ? u + "&" : u
}
u += p.search;
return u
};
k.zc = function() {
return new l.n.s(q,
"(direct)", q, "(direct)", "(none)", q, q)
};
k.Oc = function(p) {
var u = false,
m, r, i = k.o.ga;
if (p && "referral" == p.da) {
m = w(l.d(p.ia));
for (r = 0; r < i[g]; r++) u = u || f(m, w(i[r]))
}
return u
};
k.U = function(p) {
return q != p && p.Fa()
};
k.yc = function(p, u) {
var m = "",
r = "-",
i, b, e = 0,
j, t, v = k.f;
if (!p) return "";
t = k.a[l.m] ? k.a[l.m] : "";
m = k.sc(k.a.location);
if (k.o.I && p.Jb()) {
r = p.Ca();
if (!s(r) && !f(r, ";")) {
p.Ra();
return ""
}
}
r = n(t, l.X + v + ".", ";");
i = k.Fc(m);
if (k.U(i)) {
b = n(m, k.o.hb + "=", "&");
if ("1" == b && !s(r)) return ""
}
if (!k.U(i)) {
i = k.Fb();
if (!s(r) &&
k.Nc(i)) return ""
}
if (!k.U(i) && u) {
i = k.Ec();
if (!s(r) && k.Oc(i)) return ""
}
if (!k.U(i))
if (s(r) && u) i = k.zc();
if (!k.U(i)) return "";
if (!s(r)) {
var y = x(r, "."),
E = new l.n.s;
E.Cb(y.slice(4).join("."));
j = w(E.ka()) == w(i.ka());
e = y[3] * 1
}
if (!j || u) {
var F = n(t, l.r + v + ".", ";"),
I = F.lastIndexOf("."),
G = I > 9 ? l.F(F, I + 1) * 1 : 0;
e++;
G = 0 == G ? 1 : G;
p.Xb([v, k.ja, G, e, i.ka()].join("."));
p.Ra();
return "&utmcn=1"
} else return "&utmcr=1"
}
};
_gat.n.s = function(d, a, c, h, o, k, l) {
var s = this;
s.v = d;
s.ia = a;
s.ra = c;
s.L = h;
s.da = o;
s.R = k;
s.vb = l
};
_gat.n.s.prototype.ka =
function() {
var d = this,
a = _gat,
c = [],
h = [
[a.Wa, d.v],
[a.Ya, d.ia],
[a.$a, d.ra],
[a.Ua, d.L],
[a.Xa, d.da],
[a.Za, d.R],
[a.Va, d.vb]
],
o, k;
if (d.Fa())
for (o = 0; o < h[a.c]; o++)
if (!a.q(h[o][1])) {
k = h[o][1].split("+").join("%20");
k = k.split(" ").join("%20");
a.h(c, h[o][0] + k)
}
return c.join("|")
};
_gat.n.s.prototype.Fa = function() {
var d = this,
a = _gat.q;
return !(a(d.v) && a(d.ia) && a(d.ra))
};
_gat.n.s.prototype.Cb = function(d) {
var a = this,
c = _gat,
h = function(o) {
return c.J(c.C(d, o, "|"))
};
a.v = h(c.Wa);
a.ia = h(c.Ya);
a.ra = h(c.$a);
a.L = h(c.Ua);
a.da =
h(c.Xa);
a.R = h(c.Za);
a.vb = h(c.Va)
};
_gat.Z = function() {
var d = this,
a = _gat,
c = {},
h = "k",
o = "v",
k = [h, o],
l = "(",
s = ")",
q = "*",
f = "!",
n = "'",
w = {};
w[n] = "'0";
w[s] = "'1";
w[q] = "'2";
w[f] = "'3";
var x = 1;
function g(m, r, i, b) {
if (a.b == c[m]) c[m] = {};
if (a.b == c[m][r]) c[m][r] = [];
c[m][r][i] = b
}
function z(m, r, i) {
return a.b != c[m] && a.b != c[m][r] ? c[m][r][i] : a.b
}
function B(m, r) {
if (a.b != c[m] && a.b != c[m][r]) {
c[m][r] = a.b;
var i = true,
b;
for (b = 0; b < k[a.c]; b++)
if (a.b != c[m][k[b]]) {
i = false;
break
}
if (i) c[m] = a.b
}
}
function A(m) {
var r = "",
i = false,
b, e;
for (b = 0; b < k[a.c]; b++) {
e = m[k[b]];
if (a.b !=
e) {
if (i) r += k[b];
r += p(e);
i = false
} else i = true
}
return r
}
function p(m) {
var r = [],
i, b;
for (b = 0; b < m[a.c]; b++)
if (a.b != m[b]) {
i = "";
if (b != x && a.b == m[b - 1]) {
i += b.toString();
i += f
}
i += u(m[b]);
a.h(r, i)
}
return l + r.join(q) + s
}
function u(m) {
var r = "",
i, b, e;
for (i = 0; i < m[a.c]; i++) {
b = m.charAt(i);
e = w[b];
r += a.b != e ? e : b
}
return r
}
d.Kc = function(m) {
return a.b != c[m]
};
d.N = function() {
var m = [],
r;
for (r in c)
if (a.b != c[r]) a.h(m, r.toString() + A(c[r]));
return m.join("")
};
d.Sc = function(m) {
if (m == a.b) return d.N();
var r = [m.N()],
i;
for (i in c)
if (a.b !=
c[i] && !m.Kc(i)) a.h(r, i.toString() + A(c[i]));
return r.join("")
};
d._setKey = function(m, r, i) {
if (typeof i != "string") return false;
g(m, h, r, i);
return true
};
d._setValue = function(m, r, i) {
if (typeof i != "number" && (a.b == Number || !(i instanceof Number))) return false;
if (Math.round(i) != i || i == NaN || i == Infinity) return false;
g(m, o, r, i.toString());
return true
};
d._getKey = function(m, r) {
return z(m, h, r)
};
d._getValue = function(m, r) {
return z(m, o, r)
};
d._clearKey = function(m) {
B(m, h)
};
d._clearValue = function(m) {
B(m, o)
}
};
_gat.ic = function(d, a) {
var c = this;
c.jd = a;
c.Pc = d;
c._trackEvent = function(h, o, k) {
return a._trackEvent(c.Pc, h, o, k)
}
};
_gat.kc = function(d) {
var a = this,
c = _gat,
h = c.b,
o = c.q,
k = c.w,
l = c.F,
s = c.C,
q = c.P,
f = c.z,
n = "location",
w = c.c,
x = h,
g = new c.hc,
z = false;
a.a = document;
a.e = window;
a.ja = Math.round((new Date).getTime() / 1000);
a.H = d;
a.yb = a.a.referrer;
a.va = h;
a.j = h;
a.A = h;
a.M = false;
a.aa = h;
a.rb = "";
a.l = h;
a.Ab = h;
a.f = h;
a.u = h;
function B() {
if ("auto" == g.g) {
var b = a.a.domain;
if ("www." == l(b, 0, 4)) b = l(b, 4);
g.g = b
}
g.g = c.T(g.g)
}
function A() {
var b = g.g,
e = k(b, "www.google.") * k(b, ".google.") * k(b, "google.");
return e || "/" != g.p || k(b, "google.org") > -1
}
function p(b,
e, j) {
if (o(b) || o(e) || o(j)) return "-";
var t = s(b, c.r + a.f + ".", e),
v;
if (!o(t)) {
v = f(t, ".");
v[5] = v[5] ? v[5] * 1 + 1 : 1;
v[3] = v[4];
v[4] = j;
t = v.join(".")
}
return t
}
function u() {
return "file:" != a.a[n].protocol && A()
}
function m(b) {
if (!b || "" == b) return "";
while (c.Lb(b.charAt(0))) b = l(b, 1);
while (c.Lb(b.charAt(b[w] - 1))) b = l(b, 0, b[w] - 1);
return b
}
function r(b, e, j) {
if (!o(b())) {
e(c.J(b()));
if (!q(b(), ";")) j()
}
}
function i(b) {
var e, j = "" != b && a.a[n].host != b;
if (j)
for (e = 0; e < g.B[w]; e++) j = j && k(c.T(b), c.T(g.B[e])) == -1;
return j
}
a.Bc = function() {
if (!g.g ||
"" == g.g || "none" == g.g) {
g.g = "";
return 1
}
B();
return g.pb ? c.t(g.g) : 1
};
a.tc = function(b, e) {
if (o(b)) b = "-";
else {
e += g.p && "/" != g.p ? g.p : "";
var j = k(b, e);
b = j >= 0 && j <= 8 ? "0" : ("[" == b.charAt(0) && "]" == b.charAt(b[w] - 1) ? "-" : b)
}
return b
};
a.Ia = function(b) {
var e = "",
j = a.a;
e += a.aa ? a.aa.Xc() : "";
e += g.qa ? a.rb : "";
e += g.ta && !o(j.title) ? "&utmdt=" + c.d(j.title) : "";
e += "&utmhid=" + c.uc() + "&utmr=" + a.va + "&utmp=" + a.Tc(b);
return e
};
a.Tc = function(b) {
var e = a.a[n];
b = h != b && "" != b ? c.d(b, true) : c.d(e.pathname + unescape(e.search), true);
return b
};
a.$c =
function(b) {
if (a.Q()) {
var e = "";
if (a.l != h && a.l.N().length > 0) e += "&utme=" + c.d(a.l.N());
e += a.Ia(b);
x.O(e, a.H, a.a, a.f)
}
};
a.qc = function() {
var b = new c.Y(a.a, g);
return b.Ha(a.f) ? b.Wc() : h
};
a._getLinkerUrl = function(b, e) {
var j = f(b, "#"),
t = b,
v = a.qc();
if (v)
if (e && 1 >= j[w]) t += "#" + v;
else if (!e || 1 >= j[w])
if (1 >= j[w]) t += (q(b, "?") ? "&" : "?") + v;
else t = j[0] + (q(b, "?") ? "&" : "?") + v + "#" + j[1];
return t
};
a.Zb = function() {
var b;
if (a.A && a.A[w] >= 10 && !q(a.A, "=")) {
a.u.Uc(a.A);
a.u.cd();
c._gasoDomain = g.g;
c._gasoCPath = g.p;
b = a.a.createElement("script");
b.type = "text/javascript";
b.id = "_gasojs";
b.src = "/web/20140802003648/https://www.google.com/analytics/reporting/overlay_js?gaso=" + a.A + "&" + c.wa();
a.a.getElementsByTagName("head")[0].appendChild(b)
}
};
a.Jc = function() {
var b = a.a[c.m],
e = a.ja,
j = a.u,
t = a.f + "",
v = a.e,
y = v ? v.gaGlobal : h,
E, F = q(b, c.r + t + "."),
I = q(b, c.W + t),
G = q(b, c.ma + t),
C, D = [],
H = "",
K = false,
J;
b = o(b) ? "" : b;
if (g.I) {
E = c.Db(a.a[n]);
if (g.pa && !o(E)) H = E + "&";
H += a.a[n].search;
if (!o(H) && q(H, c.r)) {
j.Rc(H);
if (!j.Jb()) j.pc();
C = j.ya()
}
r(j.Ba, j.Wb, j.fc);
r(j.Aa, j.Na, j.Qa)
}
if (!o(C))
if (o(j.K()) ||
o(j.za())) {
C = p(H, "&", e);
a.M = true
} else {
D = f(j.K(), ".");
t = D[0]
}
else if (F)
if (!I || !G) {
C = p(b, ";", e);
a.M = true
} else {
C = s(b, c.r + t + ".", ";");
D = f(s(b, c.W + t, ";"), ".")
}
else {
C = [t, c.Gc(), e, e, e, 1].join(".");
a.M = true;
K = true
}
C = f(C, ".");
if (v && y && y.dh == t) {
C[4] = y.sid ? y.sid : C[4];
if (K) {
C[3] = y.sid ? y.sid : C[4];
if (y.vid) {
J = f(y.vid, ".");
C[1] = J[0];
C[2] = J[1]
}
}
}
j.Ub(C.join("."));
D[0] = t;
D[1] = D[1] ? D[1] : 0;
D[2] = undefined != D[2] ? D[2] : g.Yc;
D[3] = D[3] ? D[3] : C[4];
j.La(D.join("."));
j.Vb(t);
if (!o(j.Hc())) j.Ma(j.t());
j.dc();
j.Pa();
j.ec()
};
a.Lc =
function() {
x = new c.jc(g)
};
a._initData = function() {
var b;
if (!z) {
a.Lc();
a.f = a.Bc();
a.u = new c.Y(a.a, g)
}
if (u()) a.Jc();
if (!z) {
if (u()) {
a.va = a.tc(a.Ac(), a.a.domain);
if (g.sa) {
a.aa = new c.gc(g.ua);
a.aa.xc()
}
if (g.qa) {
b = new c.n(a.f, a.a, a.va, a.ja, g);
a.rb = b.yc(a.u, a.M)
}
}
a.l = new c.Z;
a.Ab = new c.Z;
z = true
}
if (!c.Hb) a.Mc()
};
a._visitCode = function() {
a._initData();
var b = s(a.a[c.m], c.r + a.f + ".", ";"),
e = f(b, ".");
return e[w] < 4 ? "" : e[1]
};
a._cookiePathCopy = function(b) {
a._initData();
if (a.u) a.u.bd(a.f, b)
};
a.Mc = function() {
var b = a.a[n].hash,
e;
e = b && "" != b && 0 == k(b, "#gaso=") ? s(b, "gaso=", "&") : s(a.a[c.m], c.Sa, ";");
if (e[w] >= 10) {
a.A = e;
if (a.e.addEventListener) a.e.addEventListener("load", a.Zb, false);
else a.e.attachEvent("onload", a.Zb)
}
c.Hb = true
};
a.Q = function() {
return a._visitCode() % 10000 < g.ha * 100
};
a.Vc = function() {
var b, e, j = a.a.links;
if (!g.Kb) {
var t = a.a.domain;
if ("www." == l(t, 0, 4)) t = l(t, 4);
g.B.push("." + t)
}
for (b = 0; b < j[w] && (g.Ga == -1 || b < g.Ga); b++) {
e = j[b];
if (i(e.host))
if (!e.gatcOnclick) {
e.gatcOnclick = e.onclick ? e.onclick : a.Qc;
e.onclick = function(v) {
var y = !this.target || this.target == "_self" || this.target == "_top" || this.target == "_parent";
y = y && !a.oc(v);
a.ad(v, this, y);
return y ? false : (this.gatcOnclick ? this.gatcOnclick(v) : true)
}
}
}
};
a.Qc = function() {};
a._trackPageview = function(b) {
if (u()) {
a._initData();
if (g.B) a.Vc();
a.$c(b);
a.M = false
}
};
a._trackTrans = function() {
var b = a.f,
e = [],
j, t, v, y;
a._initData();
if (a.j && a.Q()) {
for (j = 0; j < a.j.la[w]; j++) {
t = a.j.la[j];
c.h(e, t.S());
for (v = 0; v < t.ca[w]; v++) c.h(e, t.ca[v].S())
}
for (y = 0; y < e[w]; y++) x.O(e[y], a.H, a.a, b, true)
}
};
a._setTrans =
function() {
var b = a.a,
e, j, t, v, y = b.getElementById ? b.getElementById("utmtrans") : (b.utmform && b.utmform.utmtrans ? b.utmform.utmtrans : h);
a._initData();
if (y && y.value) {
a.j = new c.i;
v = f(y.value, "UTM:");
g.G = !g.G || "" == g.G ? "|" : g.G;
for (e = 0; e < v[w]; e++) {
v[e] = m(v[e]);
j = f(v[e], g.G);
for (t = 0; t < j[w]; t++) j[t] = m(j[t]);
if ("T" == j[0]) a._addTrans(j[1], j[2], j[3], j[4], j[5], j[6], j[7], j[8]);
else if ("I" == j[0]) a._addItem(j[1], j[2], j[3], j[4], j[5], j[6])
}
}
};
a._addTrans = function(b, e, j, t, v, y, E, F) {
a.j = a.j ? a.j : new c.i;
return a.j.nb(b, e,
j, t, v, y, E, F)
};
a._addItem = function(b, e, j, t, v, y) {
var E;
a.j = a.j ? a.j : new c.i;
E = a.j.xa(b);
if (!E) E = a._addTrans(b, "", "", "", "", "", "", "");
E.mb(e, j, t, v, y)
};
a._setVar = function(b) {
if (b && "" != b && A()) {
a._initData();
var e = new c.Y(a.a, g),
j = a.f;
e.Na(j + "." + c.d(b));
e.Qa();
if (a.Q()) x.O("&utmt=var", a.H, a.a, a.f)
}
};
a._link = function(b, e) {
if (g.I && b) {
a._initData();
a.a[n].href = a._getLinkerUrl(b, e)
}
};
a._linkByPost = function(b, e) {
if (g.I && b && b.action) {
a._initData();
b.action = a._getLinkerUrl(b.action, e)
}
};
a._setXKey = function(b, e,
j) {
a.l._setKey(b, e, j)
};
a._setXValue = function(b, e, j) {
a.l._setValue(b, e, j)
};
a._getXKey = function(b, e) {
return a.l._getKey(b, e)
};
a._getXValue = function(b, e) {
return a.l.getValue(b, e)
};
a._clearXKey = function(b) {
a.l._clearKey(b)
};
a._clearXValue = function(b) {
a.l._clearValue(b)
};
a._createXObj = function() {
a._initData();
return new c.Z
};
a._sendXEvent = function(b) {
var e = "";
a._initData();
if (a.Q()) {
e += "&utmt=event&utme=" + c.d(a.l.Sc(b)) + a.Ia();
x.O(e, a.H, a.a, a.f, false, true)
}
};
a._createEventTracker = function(b) {
a._initData();
return new c.ic(b, a)
};
a._trackEvent = function(b, e, j, t) {
var v = true,
y = a.Ab;
if (h != b && h != e && "" != b && "" != e) {
y._clearKey(5);
y._clearValue(5);
v = y._setKey(5, 1, b) ? v : false;
v = y._setKey(5, 2, e) ? v : false;
v = h == j || y._setKey(5, 3, j) ? v : false;
v = h == t || y._setValue(5, 1, t) ? v : false;
if (v) a._sendXEvent(y)
} else v = false;
return v
};
a.ad = function(b, e, j) {
a._initData();
if (a.Q()) {
var t = new c.Z;
t._setKey(6, 1, e.href);
var v = j ? function() {
a.rc(b, e)
} : undefined;
x.O("&utmt=event&utme=" + c.d(t.N()) + a.Ia(), a.H, a.a, a.f, false, true, v)
}
};
a.rc = function(b,
e) {
if (!b) b = a.e.event;
var j = true;
if (e.gatcOnclick) j = e.gatcOnclick(b);
if (j || typeof j == "undefined")
if (!e.target || e.target == "_self") a.e.location = e.href;
else if (e.target == "_top") a.e.top.document.location = e.href;
else if (e.target == "_parent") a.e.parent.document.location = e.href
};
a.oc = function(b) {
if (!b) b = a.e.event;
var e = b.shiftKey || b.ctrlKey || b.altKey;
if (!e)
if (b.modifiers && a.e.Event) e = b.modifiers & a.e.Event.CONTROL_MASK || b.modifiers & a.e.Event.SHIFT_MASK || b.modifiers & a.e.Event.ALT_MASK;
return e
};
a._setDomainName =
function(b) {
g.g = b
};
a.dd = function() {
return g.g
};
a._addOrganic = function(b, e) {
c.h(g.fa, new c.cb(b, e))
};
a._clearOrganic = function() {
g.fa = []
};
a.hd = function() {
return g.fa
};
a._addIgnoredOrganic = function(b) {
c.h(g.ea, b)
};
a._clearIgnoredOrganic = function() {
g.ea = []
};
a.ed = function() {
return g.ea
};
a._addIgnoredRef = function(b) {
c.h(g.ga, b)
};
a._clearIgnoredRef = function() {
g.ga = []
};
a.fd = function() {
return g.ga
};
a._setAllowHash = function(b) {
g.pb = b ? 1 : 0
};
a._setCampaignTrack = function(b) {
g.qa = b ? 1 : 0
};
a._setClientInfo = function(b) {
g.sa =
b ? 1 : 0
};
a._getClientInfo = function() {
return g.sa
};
a._setCookiePath = function(b) {
g.p = b
};
a._setTransactionDelim = function(b) {
g.G = b
};
a._setCookieTimeout = function(b) {
g.wb = b
};
a._setDetectFlash = function(b) {
g.ua = b ? 1 : 0
};
a._getDetectFlash = function() {
return g.ua
};
a._setDetectTitle = function(b) {
g.ta = b ? 1 : 0
};
a._getDetectTitle = function() {
return g.ta
};
a._setLocalGifPath = function(b) {
g.Da = b
};
a._getLocalGifPath = function() {
return g.Da
};
a._setLocalServerMode = function() {
g.D = 0
};
a._setRemoteServerMode = function() {
g.D = 1
};
a._setLocalRemoteServerMode =
function() {
g.D = 2
};
a.gd = function() {
return g.D
};
a._getServiceMode = function() {
return g.D
};
a._setSampleRate = function(b) {
g.ha = b
};
a._setSessionTimeout = function(b) {
g.Tb = b
};
a._setAllowLinker = function(b) {
g.I = b ? 1 : 0
};
a._setAllowAnchor = function(b) {
g.pa = b ? 1 : 0
};
a._setCampNameKey = function(b) {
g.db = b
};
a._setCampContentKey = function(b) {
g.eb = b
};
a._setCampIdKey = function(b) {
g.fb = b
};
a._setCampMediumKey = function(b) {
g.gb = b
};
a._setCampNOKey = function(b) {
g.hb = b
};
a._setCampSourceKey = function(b) {
g.ib = b
};
a._setCampTermKey = function(b) {
g.jb =
b
};
a._setCampCIdKey = function(b) {
g.kb = b
};
a._getAccount = function() {
return a.H
};
a._getVersion = function() {
return _gat.lb
};
a.kd = function(b) {
g.B = [];
if (b) g.B = b
};
a.md = function(b) {
g.Kb = b
};
a.ld = function(b) {
g.Ga = b
};
a._setReferrerOverride = function(b) {
a.yb = b
};
a.Ac = function() {
return a.yb
}
};
_gat._getTracker = function(d) {
var a = new _gat.kc(d);
return a
};
(function() {
if (!window.Seadragon) {
var msg = "Seadragon Progress Bar requires Seadragon Ajax!";
alert(msg);
throw new Error(msg);
} else if (Seadragon.ProgressBar) {
return;
}
var DEFAULTS = {};
DEFAULTS.barImage = "images/bramus/custom1_bar.gif";
DEFAULTS.boxImage = "images/bramus/custom1_box.gif";
var PB = function(elmt, options) {
this.outer = Seadragon.Utils.getElement(elmt);
this.container = Seadragon.Utils.makeNeutralElement("div");
this.imgBar = Seadragon.Utils.makeNeutralElement("img");
this.imgBox = Seadragon.Utils.makeNeutralElement("img");
this.spring = new Seadragon.Spring();
this.animating = false;
this.initElements(options || {});
};
var PBproto = PB.prototype;
PBproto.initElements = function(options) {
var o = this.outer;
var c = this.container;
var iBar = this.imgBar;
var iBox = this.imgBox;
c.title = "0%";
iBar.src = options.barImage || DEFAULTS.barImage;
iBox.src = options.boxImage || DEFAULTS.boxImage;
var cStyle = c.style;
var iBarStyle = iBar.style;
var iBoxStyle = iBox.style;
cStyle.width = "100%";
cStyle.height = "100%";
cStyle.position = "relative";
cStyle.overflow = "hidden";
iBarStyle.position = iBoxStyle.position = "absolute";
iBarStyle.height = iBoxStyle.height = "100%";
iBarStyle.top = iBoxStyle.top = "0px";
iBoxStyle.width = "100%";
iBoxStyle.left = "0px";
iBarStyle.width = "200%";
iBarStyle.right = "0%";
c.appendChild(iBar);
c.appendChild(iBox);
o.innerHTML = "";
o.appendChild(c);
};
PBproto.update = function() {
var target = this.spring.getTarget();
this.spring.update();
var current = this.spring.getCurrent();
var percentage = Math.round(current);
this.container.title = percentage + "%";
this.imgBar.style.right = -percentage + "%";
this.animating = current != target;
if (this.animating) {
this.scheduleUpdate();
}
};
PBproto.scheduleUpdate = function() {
var pb = this;
window.setTimeout(function() {
pb.update();
}, 1);
};
PBproto.getPercentage = function(current) {
if (current) {
return this.spring.getCurrent();
} else {
return this.spring.getTarget();
}
};
PBproto.setPercentage = function(percentage, immediately) {
this.spring.update();
percentage = Math.max(percentage, 0);
percentage = Math.min(percentage, 100);
if (immediately) {
this.spring.resetTo(percentage);
} else {
this.spring.springTo(percentage);
}
if (!this.animating) {
this.update();
}
};
Seadragon.ProgressBar = PB;
})();
(function() {
if (!window.Seadragon || !Seadragon.ComboViewer) {
throw new Error("missing Seadragon combo viewer component");
} else if (typeof Seadragon.tinydziEmbed == "function") {
return;
}
Seadragon.Strings.setString("TinyDZI.Tooltips.AboutButton", "About Zoom.it");
Seadragon.Strings.setString("TinyDZI.About.Header", "If you like it, Zoom.it");
Seadragon.Strings.setString("TinyDZI.About.Description", "Explore this Deep Zoom Image by clicking to zoom and dragging to pan (or by spinning your scroll wheel). " + "\n\nShare this image or create your own at:");
Seadragon.Strings.setString("TinyDZI.About.ReturnLink", "/web/20140802003648/http://zoom.it/{0}");
Seadragon.Strings.setString("TinyDZI.About.PrivacyLinkText", "Privacy");
Seadragon.Strings.setString("TinyDZI.About.PrivacyLinkUrl", "/web/20140802003648/http://go.microsoft.com/fwlink/?LinkID=74170");
Seadragon.Strings.setString("TinyDZI.About.FeedbackLinkText", "FAQ");
Seadragon.Strings.setString("TinyDZI.About.FeedbackLinkUrl", "/web/20140802003648/http://zoom.it/pages/faq/");
Seadragon.Strings.setString("TinyDZI.Errors.NoId", "Sorry, we can't find this image. Please check the URL.");
Seadragon.Strings.setString("TinyDZI.Errors.None", "Sorry, we can't find this image. Please check the URL.");
Seadragon.Strings.setString("TinyDZI.Errors.Internal", "Sorry, an unexpected error occurred.");
Seadragon.Strings.setString("TinyDZI.Errors.Abuse", "This image has been blocked for violating the Zoom.it Code of Conduct.");
Seadragon.Strings.setString("TinyDZI.Errors.Type", "We couldn't find an image at that URL.");
Seadragon.Strings.setString("TinyDZI.Errors.Http", "We got a {0} error at the URL you gave us.");
Seadragon.Strings.setString("TinyDZI.Errors.Network", "We couldn't reach the URL you gave us.");
Seadragon.Strings.setString("TinyDZI.Errors.SiteDownMaintenance", "Sorry, we're down for maintenance. Please check back later.");
Seadragon.Strings.setString("TinyDZI.Errors.SiteDownOverload", "Sorry, we're experiencing heavy load. Please check back later.");
Seadragon.Strings.setString("TinyDZI.Errors.Unknown", "Sorry, an unknown error occurred.");
Seadragon.Strings.setString("TinyDZI.Retry.ChangeText", "Change the URL");
Seadragon.Strings.setString("TinyDZI.Retry.EnterText", "Change the URL");
Seadragon.Strings.setString("TinyDZI.Retry.RetryText", "try again");
Seadragon.Strings.setString("TinyDZI.Retry.Structure", " {0} or {1}?");
Seadragon.Config.tinydziRoot = "/web/20140802003648/http://zoom.it/";
var HEAD = document.getElementsByTagName("head")[0];
var CLASS_NAME = "__seadragon";
var URL_STATUS = "server/status.ashx";
var URL_IMAGE_INFO = "server/imageinfo.ashx";
var URL_RETRY = "server/retry.ashx";
var ARG_ID = "id";
var ARG_FORMAT = "format";
var ARG_CALLBACK = "callback";
var PB_IMAGE_PATH = "../progressbars/";
var PB_BOX_IMAGE = "percentImage-black.png";
var PB_BAR_IMAGE = "percentImage_back5.png";
var JSON_ID = "Id";
var JSON_URL = "Url";
var JSON_STAGE = "Stage";
var JSON_STAGE_TEXT = "StageText";
var JSON_PROGRESS = "Progress";
var JSON_ERROR_DETAILS = "ErrorDetails";
var JSON_SITE_DOWN = "SiteDown";
var JSON_SOURCE_URL = "Source";
var JSON_TITLE = "Title";
var JSON_ATTRIBUTION_TEXT = "AttributionText";
var JSON_ATTRIBUTION_LINK = "AttributionLink";
var JSON_IMAGE_WIDTH = "Width";
var JSON_IMAGE_HEIGHT = "Height";
var JSON_TILE_SIZE = "TileSize";
var JSON_TILE_OVERLAP = "TileOverlap";
var JSON_TILE_FORMAT = "TileFormat";
var SITE_DOWN_MAINTENANCE = 1;
var SITE_DOWN_OVERLOAD = 2;
var STAGE_ERROR_INTERNAL = -100;
var STAGE_ERROR_ABUSE = -90;
var STAGE_ERROR_TYPE = -20;
var STAGE_ERROR_HTTP = -15;
var STAGE_ERROR_NETWORK = -10;
var STAGE_ERROR_UNKNOWN = -1;
var STAGE_NONE = 0;
var STAGE_QUEUED = 10;
var STAGE_BEGINNING = 20;
var STAGE_DOWNLOADING = 40;
var STAGE_CONVERTING = 70;
var STAGE_FINALIZING = 90;
var STAGE_READY = 100;
var nextId = 0;
function makeHttpGetUrl(url, params) {
var s = [url];
var hasQ = url.indexOf('?') >= 0;
for (var key in params) {
if (params.hasOwnProperty(key)) {
var value = params[key];
if (hasQ) {
s.push('&');
} else {
s.push('?');
hasQ = true;
}
s.push(key);
s.push('=');
s.push(value);
}
}
return s.join('');
}
function makeJsonpRequest(url) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = url;
HEAD.appendChild(script);
return script;
}
function makeRandomCallback(actualCallback) {
var name = "_jsonCallback" +
Math.round(Math.random() * 100000000).toString();
window[name] = function() {
actualCallback.apply(this, arguments);
window[name] = undefined;
};
return name;
}
function makeContainer(width, height) {
var html = [];
var id = CLASS_NAME + (++nextId);
html.push('<div id="');
html.push(id);
html.push('" class="');
html.push(CLASS_NAME);
html.push('" style="width: ');
html.push(width || "auto");
html.push('; height: ');
html.push(height || "400px");
html.push('; border: 1px solid black; background: black; color: white; ');
html.push('margin: 0px; padding: 0px;"></div>');
document.write(html.join(''));
return document.getElementById(id);
}
function setTextCss(textStyle) {
textStyle.color = "white";
textStyle.fontFamily = 'sans-serif';
textStyle.fontSize = "16px";
textStyle.fontSizeAdjust = "none";
textStyle.fontStyle = "normal";
textStyle.fontStretch = "normal";
textStyle.fontVariant = "normal";
textStyle.fontWeight = "normal";
textStyle.lineHeight = "1em";
textStyle.marginTop = "0.25em";
textStyle.marginBottom = "0.25em";
textStyle.textAlign = "center";
textStyle.textDecoration = "none";
}
function isErrorStage(stage) {
return stage < 0;
}
var Worker = function(width, height, contentId) {
this.contentId = contentId;
this.sourceUrl = null;
this.container = makeContainer(width, height);
this.containerInner = null;
this.progressBar = null;
this.progressTextElmt = null;
this.attributionText = null;
this.attributionLink = null;
};
Worker.prototype.initialize = function(statusJson, imageInfoJson) {
var haveStatus = !!statusJson && !!statusJson[JSON_STAGE_TEXT];
var statusReady = haveStatus && !!statusJson[JSON_URL] && statusJson[JSON_STAGE] == STAGE_READY;
var haveImageInfo = !!imageInfoJson && !!imageInfoJson[JSON_TILE_FORMAT];
this.attributionText = statusJson[JSON_ATTRIBUTION_TEXT];
this.attributionLink = statusJson[JSON_ATTRIBUTION_LINK];
this.sourceUrl = statusJson[JSON_SOURCE_URL];
if (statusReady && haveImageInfo) {
this.handleImageInfo(statusJson[JSON_URL], imageInfoJson);
return;
}
this.containerInner = Seadragon.Utils.makeNeutralElement("span");
this.container.appendChild(Seadragon.Utils.makeCenteredNode(this.containerInner));
if (!this.contentId) {
this.switchToError(Seadragon.Strings.getString("TinyDZI.Errors.NoId"), false);
return;
}
if (statusReady) {
this.switchToLoading();
this.fetchImageInfo(statusJson[JSON_URL]);
return;
}
this.switchToProgress();
if (haveStatus) {
this.handleStatusResponse(statusJson);
} else {
this.scheduleFetchStatus();
}
};
Worker.prototype.fetchImageInfo = function(dziUrl) {
var script = null;
var worker = this;
var tempCallbackName = makeRandomCallback(function(imageInfoJson) {
worker.handleImageInfo(dziUrl, imageInfoJson);
script.parentNode.removeChild(script);
});
var url = Seadragon.Config.tinydziRoot + URL_IMAGE_INFO;
var params = {};
params[ARG_ID] = this.contentId;
params[ARG_FORMAT] = "json";
params[ARG_CALLBACK] = tempCallbackName;
params["__rand__"] = Math.random();
script = makeJsonpRequest(makeHttpGetUrl(url, params));
};
Worker.prototype.fetchStatus = function(retrying) {
var script = null;
var worker = this;
var tempCallbackName = makeRandomCallback(function(statusJson) {
worker.handleStatusResponse(statusJson, retrying);
script.parentNode.removeChild(script);
});
var url = Seadragon.Config.tinydziRoot +
(retrying ? URL_RETRY : URL_STATUS);
var params = {};
params[ARG_ID] = this.contentId;
params[ARG_FORMAT] = "json";
params[ARG_CALLBACK] = tempCallbackName;
params["__rand__"] = Math.random();
script = makeJsonpRequest(makeHttpGetUrl(url, params));
};
Worker.prototype.scheduleFetchStatus = function() {
var worker = this;
window.setTimeout(function() {
worker.fetchStatus();
}, 1000);
};
Worker.prototype.handleImageInfo = function(dziUrl, imageInfoJson) {
this.switchToViewer({
url: dziUrl,
width: imageInfoJson[JSON_IMAGE_WIDTH],
height: imageInfoJson[JSON_IMAGE_HEIGHT],
tileSize: imageInfoJson[JSON_TILE_SIZE],
tileOverlap: imageInfoJson[JSON_TILE_OVERLAP],
tileFormat: imageInfoJson[JSON_TILE_FORMAT]
});
};
Worker.prototype.handleStatusResponse = function(statusJson, retrying) {
var stage = statusJson[JSON_STAGE];
var siteDownCode = statusJson[JSON_SITE_DOWN];
var errorDetails = statusJson[JSON_ERROR_DETAILS];
if (retrying && siteDownCode && isErrorStage(stage)) {
var stringName = (siteDownCode == SITE_DOWN_OVERLOAD) ? "TinyDZI.Errors.SiteDownOverload" : "TinyDZI.Errors.SiteDownMaintenance";
this.switchToError(Seadragon.Strings.getString(stringName), false);
return;
}
var allowRetry = !siteDownCode;
this.sourceUrl = statusJson[JSON_SOURCE_URL];
switch (stage) {
case STAGE_ERROR_INTERNAL:
var msg = Seadragon.Strings.getString("TinyDZI.Errors.Internal", errorDetails);
this.switchToError(msg, allowRetry);
return;
case STAGE_ERROR_ABUSE:
var msg = Seadragon.Strings.getString("TinyDZI.Errors.Abuse", errorDetails);
this.switchToError(msg, false);
return;
case STAGE_ERROR_TYPE:
var msg = Seadragon.Strings.getString("TinyDZI.Errors.Type", errorDetails);
this.switchToError(msg, allowRetry);
return;
case STAGE_ERROR_HTTP:
var msg = Seadragon.Strings.getString("TinyDZI.Errors.Http", errorDetails);
this.switchToError(msg, allowRetry);
return;
case STAGE_ERROR_NETWORK:
var msg = Seadragon.Strings.getString("TinyDZI.Errors.Network", errorDetails);
this.switchToError(msg, allowRetry);
return;
case STAGE_ERROR_UNKNOWN:
var msg = Seadragon.Strings.getString("TinyDZI.Errors.Unknown", errorDetails);
this.switchToError(msg, allowRetry);
return;
case STAGE_NONE:
var msg = Seadragon.Strings.getString("TinyDZI.Errors.None", errorDetails);
this.switchToError(msg, false);
return;
case STAGE_READY:
this.progressBar.setPercentage(100);
this.progressTextElmt.innerHTML = "Loading...";
this.attributionText = statusJson[JSON_ATTRIBUTION_TEXT];
this.attributionLink = statusJson[JSON_ATTRIBUTION_LINK];
this.fetchImageInfo(statusJson[JSON_URL]);
return;
}
if (isErrorStage(stage)) {
var msg = Seadragon.Strings.getString("TinyDZI.Errors.Unknown", errorDetails);
this.switchToError(msg, allowRetry);
return;
}
this.progressTextElmt.innerHTML = statusJson[JSON_STAGE_TEXT] + "...";
this.progressBar.setPercentage(Math.round(100 * (statusJson[JSON_PROGRESS] || 0)));
this.scheduleFetchStatus();
};
Worker.prototype.switchToError = function(errorMsg, allowRetry) {
var errorElmt = Seadragon.Utils.makeNeutralElement("div");
var errorElmtStyle = errorElmt.style;
setTextCss(errorElmtStyle);
errorElmtStyle.color = "#f84";
errorElmtStyle.margin = "0em 2em";
errorElmt.appendChild(document.createTextNode(errorMsg));
this.containerInner.innerHTML = "";
this.containerInner.appendChild(errorElmt);
if (!allowRetry) {
return;
}
var createLink = Seadragon.Utils.makeNeutralElement("a");
var retryLink = Seadragon.Utils.makeNeutralElement("a");
var root = Seadragon.Config.tinydziRoot;
if (this.sourceUrl) {
createLink.href = [root, "pages/create/?url=", window.encodeURIComponent(this.sourceUrl)].join('');
createLink.appendChild(document.createTextNode(Seadragon.Strings.getString("TinyDZI.Retry.ChangeText")));
} else {
createLink.href = [root, "pages/create/"].join('');
createLink.appendChild(document.createTextNode(Seadragon.Strings.getString("TinyDZI.Retry.EnterText")));
}
retryLink.href = [root, this.contentId].join('');
retryLink.appendChild(document.createTextNode(Seadragon.Strings.getString("TinyDZI.Retry.RetryText")));
var createLinkStyle = createLink.style;
var retryLinkStyle = retryLink.style;
setTextCss(createLinkStyle);
setTextCss(retryLinkStyle);
createLinkStyle.color = retryLinkStyle.color = "#ff0";
createLinkStyle.textDecoration = retryLinkStyle.textDecoration = "none";
createLinkStyle.whiteSpace = retryLinkStyle.whiteSpace = "nowrap";
errorElmt.appendChild(document.createTextNode(" "));
errorElmt.appendChild(createLink)
errorElmt.appendChild(document.createTextNode(" or "));
errorElmt.appendChild(retryLink);
errorElmt.appendChild(document.createTextNode("?"));
var worker = this;
Seadragon.Utils.addEvent(retryLink, "click", function(event) {
Seadragon.Utils.cancelEvent(event);
worker.switchToProgress();
worker.fetchStatus(true);
});
};
Worker.prototype.switchToLoading = function() {
var loadingSpan = Seadragon.Utils.makeNeutralElement("span");
var loadingSpanStyle = loadingSpan.style;
setTextCss(loadingSpanStyle);
loadingSpan.appendChild(document.createTextNode("Loading..."));
this.containerInner.innerHTML = "";
this.containerInner.appendChild(loadingSpan);
};
Worker.prototype.switchToProgress = function() {
var pBarDiv = Seadragon.Utils.makeNeutralElement("div");
var pTextDiv = Seadragon.Utils.makeNeutralElement("div");
var pBarStyle = pBarDiv.style;
var pTextStyle = pTextDiv.style;
pBarStyle.width = "250px";
pBarStyle.height = "15px";
pBarStyle.maxWidth = "50%";
pBarStyle.margin = "auto";
pBarStyle.paddingBottom = "5px";
pTextDiv.innerHTML = "&nbsp;";
setTextCss(pTextStyle);
this.progressBar = new Seadragon.ProgressBar(pBarDiv, {
barImage: Seadragon.Config.imagePath + PB_IMAGE_PATH + PB_BAR_IMAGE,
boxImage: Seadragon.Config.imagePath + PB_IMAGE_PATH + PB_BOX_IMAGE
});
this.progressTextElmt = pTextDiv;
this.containerInner.innerHTML = "";
this.containerInner.appendChild(pBarDiv);
this.containerInner.appendChild(pTextDiv);
};
Worker.prototype.switchToViewer = function(dziInfo) {
var id = this.contentId;
var attrText = this.attributionText;
var attrLink = this.attributionLink || this.sourceUrl;
Seadragon.ComboViewer.createAndOpenDzi(this.container, dziInfo, function(viewer, wasCalledBefore) {
viewer.setAboutHeader(Seadragon.Strings.getString("TinyDZI.About.Header", id));
viewer.setAboutDescription(Seadragon.Strings.getString("TinyDZI.About.Description", id));
viewer.setAboutMainLink(Seadragon.Strings.getString("TinyDZI.About.ReturnLink", id));
viewer.addAboutFooterLink(Seadragon.Strings.getString("TinyDZI.About.PrivacyLinkUrl", id), Seadragon.Strings.getString("TinyDZI.About.PrivacyLinkText", id));
viewer.addAboutFooterLink(Seadragon.Strings.getString("TinyDZI.About.FeedbackLinkUrl", id), Seadragon.Strings.getString("TinyDZI.About.FeedbackLinkText", id));
viewer.setLogoTooltip(Seadragon.Strings.getString("TinyDZI.Tooltips.AboutButton", id));
if (attrText) {
viewer.setLogoCaption(attrText, attrLink);
}
if (!wasCalledBefore) {
var callback = Seadragon.tinydziEmbed.onViewerCreate;
if (typeof callback === "function") {
callback(id, viewer);
}
viewer.onFirstInteraction = function() {
var callback = Seadragon.tinydziEmbed.onFirstInteraction;
if (typeof callback === "function") {
callback(id, viewer);
}
};
}
viewer.onResize = function(viewer) {
var callback = Seadragon.tinydziEmbed.onViewerResize;
if (typeof callback === "function") {
callback(id, viewer);
}
};
});
};
Seadragon.tinydziEmbed = function(width, height, contentId, statusJson, imageInfoJson) {
new Worker(width, height, contentId).initialize(statusJson, imageInfoJson);
};
Seadragon.tinydziEmbed.onViewerCreate = null;
Seadragon.tinydziEmbed.onFirstInteraction = null;
Seadragon.tinydziEmbed.onViewerResize = null;
})();
(function() {
var BASE = "/web/20140802003648/http://zoom.it/";
var PUBLIC = "/web/20140802003648/http://zoom.it/";
Seadragon.Config.imagePath = BASE + "images/seajax/";
Seadragon.Config.xapPath = BASE + "scripts/";
Seadragon.Config.tinydziRoot = BASE;
Seadragon.Strings.setString("About.LogoUrl", PUBLIC);
Seadragon.Strings.setString("About.MainUrl", PUBLIC + "pages/create/");
Seadragon.Strings.setString("TinyDZI.About.ReturnLink", PUBLIC + "{0}");
try {
Seadragon.Tracker = Seadragon.Tracker || _gat._getTracker("UA-5779771-7");
Seadragon.Tracker._setReferrerOverride(window.location.href);
} catch (e) {}
Seadragon.tinydziEmbed.onViewerCreate = function(id, viewer) {
if (!Seadragon.Tracker) {
return;
}
// track whether this embed is silverlight or ajax
Seadragon.Tracker._trackPageview("/tracking/embed/" + id + "/viewer-is-" +
(viewer.isSilverlight ? "silverlight" : "seajax"));
};
Seadragon.tinydziEmbed.onFirstInteraction = function(id, viewer) {
if (!Seadragon.Tracker) {
return;
}
// track that first interaction occurred!
Seadragon.Tracker._trackPageview("/tracking/embed/" + id +
"/first-user-interaction");
};
})();
Seadragon.tinydziEmbed("auto", "400px", "h", {
"AttributionLink": null,
"AttributionText": null,
"ErrorDetails": "",
"Id": "h",
"Progress": 1,
"SiteDown": 0,
"Source": "http:\/\/upload.wikimedia.org\/wikipedia\/commons\/3\/36\/SeattleI5Skyline.jpg",
"Stage": 100,
"StageText": "Ready",
"Title": null,
"Type": 1,
"TypeText": "Image",
"Url": "http:\/\/cache.zoom.it\/content\/h.dzi"
}, {
"Height": 2405,
"Id": "h",
"TileFormat": "jpg",
"TileOverlap": 1,
"TileSize": 254,
"Width": 4013
});
try {
Seadragon.Tracker._trackPageview("/h.js?width=auto&height=400px");
} catch (e) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment