////////////////////////////////////////////////////////////////////// // Pano2VR pro 5.0beta3a/11769 HTML5/CSS3 & WebGL Panorama Player // // License: Stephan Knowles // // (c) 2015, Garden Gnome Software, http://ggnome.com // ////////////////////////////////////////////////////////////////////// var xa = function () { function h(x, h) { this.x = x; this.y = h } h.prototype.K = function (x, h) { this.x = x; this.y = h }; h.prototype.wa = function (x, h, n) { var r = h.y - x.y; this.x = x.x + (h.x - x.x) * n; this.y = x.y + r * n }; h.prototype.Sb = function (x, k, n, r, u) { var L; L = new h; L.wa(x, n, u); x = new h; x.wa(n, r, u); n = new h; n.wa(r, k, u); k = new h; k.wa(L, x, u); L = new h; L.wa(x, n, u); x = new h; x.wa(k, L, u); this.x = x.x; this.y = x.y }; h.prototype.Tb = function (x, k, n, r, u) { var L = new h, O = .5, T = .25; do { L.Sb(x, k, n, r, O); var Aa = L.x - u, O = 0 < Aa ? O - T : O + T, T = T / 2 } while (.01 < Math.abs(Aa)); this.x = L.x; this.y = L.y }; return h }(), Ga = function () { function h(x, h, n, r, u) { this.x = x; this.y = h; this.z = n; this.ra = r; this.S = u } h.prototype.K = function (h, k, n, r, u) { this.x = h; this.y = k; this.z = n; this.ra = r; this.S = u }; h.prototype.toString = function () { return "(" + this.x + "," + this.y + "," + this.z + ") - (" + this.ra + "," + this.S + ")" }; h.prototype.D = function (h) { var k = Math.sin(h); h = Math.cos(h); var n = this.y, r = this.z; this.y = h * n - k * r; this.z = k * n + h * r }; h.prototype.gc = function () { var h = this.y; this.y = -this.z; this.z = h }; h.prototype.fc = function () { var h = this.y; this.y = this.z; this.z = -h }; h.prototype.L = function (h) { var k = Math.sin(h); h = Math.cos(h); var n = this.x, r = this.z; this.x = h * n + k * r; this.z = -k * n + h * r }; h.prototype.hc = function () { var h = this.x; this.x = -this.z; this.z = h }; h.prototype.Y = function (h) { var k = Math.sin(h); h = Math.cos(h); var n = this.x, r = this.y; this.x = h * n - k * r; this.y = k * n + h * r }; h.prototype.Mb = function () { var h = this.x; this.x = -this.y; this.y = h }; h.prototype.clone = function () { return new h(this.x, this.y, this.z, this.ra, this.S) }; h.prototype.length = function () { return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z) }; h.prototype.lb = function (h) { return this.x * h.x + this.y * h.y + this.z * h.z }; h.prototype.Ab = function (h, k) { var n; n = Math.cos(k * Math.PI / 180); this.x = n * Math.sin(h * Math.PI / 180); this.y = Math.sin(k * Math.PI / 180); this.z = n * Math.cos(h * Math.PI / 180) }; h.prototype.wa = function (h, k, n) { this.x = h.x * n + k.x * (1 - n); this.y = h.y * n + k.y * (1 - n); this.z = h.z * n + k.z * (1 - n); this.ra = h.ra * n + k.ra * (1 - n); this.S = h.S * n + k.S * (1 - n) }; return h }(); function Gc() { var h; "undefined" != typeof Float32Array ? h = new Float32Array(16) : h = Array(16); return h } function Hc(h) { h[0] = 1; h[1] = 0; h[2] = 0; h[3] = 0; h[4] = 0; h[5] = 1; h[6] = 0; h[7] = 0; h[8] = 0; h[9] = 0; h[10] = 1; h[11] = 0; h[12] = 0; h[13] = 0; h[14] = 0; h[15] = 1 } function Ud(h, x, k) { var n, r = k[0], u = k[1]; k = k[2]; var L = Math.sqrt(r * r + u * u + k * k); if (L) { 1 != L && (L = 1 / L, r *= L, u *= L, k *= L); var O = Math.sin(x), T = Math.cos(x), Aa = 1 - T; x = h[0]; var L = h[1], Vb = h[2], lb = h[3], Nb = h[4], Sa = h[5], Ob = h[6], Ta = h[7], sc = h[8], hc = h[9], ic = h[10], tc = h[11], jc = r * r * Aa + T, Wb = u * r * Aa + k * O, Pb = k * r * Aa - u * O, Bb = r * u * Aa - k * O, kc = u * u * Aa + T, lc = k * u * Aa + r * O, mc = r * k * Aa + u * O, r = u * k * Aa - r * O, u = k * k * Aa + T; n ? h != n && (n[12] = h[12], n[13] = h[13], n[14] = h[14], n[15] = h[15]) : n = h; n[0] = x * jc + Nb * Wb + sc * Pb; n[1] = L * jc + Sa * Wb + hc * Pb; n[2] = Vb * jc + Ob * Wb + ic * Pb; n[3] = lb * jc + Ta * Wb + tc * Pb; n[4] = x * Bb + Nb * kc + sc * lc; n[5] = L * Bb + Sa * kc + hc * lc; n[6] = Vb * Bb + Ob * kc + ic * lc; n[7] = lb * Bb + Ta * kc + tc * lc; n[8] = x * mc + Nb * r + sc * u; n[9] = L * mc + Sa * r + hc * u; n[10] = Vb * mc + Ob * r + ic * u; n[11] = lb * mc + Ta * r + tc * u } } function Vd(h, x, k) { h = .1 * Math.tan(h * Math.PI / 360); x = h * x; var n = -x, r = -h; k || (k = Gc()); var u = x - n, L = h - r; k[0] = .2 / u; k[1] = 0; k[2] = 0; k[3] = 0; k[4] = 0; k[5] = .2 / L; k[6] = 0; k[7] = 0; k[8] = (x + n) / u; k[9] = (h + r) / L; k[10] = -100.1 / 99.9; k[11] = -1; k[12] = 0; k[13] = 0; k[14] = -20 / 99.9; k[15] = 0 } function Wd() { var h = "perspective", x = ["Webkit", "Moz", "O", "ms", "Ms"], k; k = !1; for (k = 0; k < x.length; k++) "undefined" !== typeof document.documentElement.style[x[k] + "Perspective"] && (h = x[k] + "Perspective"); "undefined" !== typeof document.documentElement.style[h] ? "webkitPerspective" in document.documentElement.style ? (h = document.createElement("style"), x = document.createElement("div"), k = document.head || document.getElementsByTagName("head")[0], h.textContent = "@media (-webkit-transform-3d) {#ggswhtml5{height:5px}}", k.appendChild(h), x.id = "ggswhtml5", document.documentElement.appendChild(x), k = 5 === x.offsetHeight, h.parentNode.removeChild(h), x.parentNode.removeChild(x)) : k = !0 : k = !1; return k } function Fe() { var h; if (h = !!window.WebGLRenderingContext) try { var x = document.createElement("canvas"); x.width = 100; x.height = 100; var k = x.getContext("webgl"); k || (k = x.getContext("experimental-webgl")); h = k ? !0 : !1 } catch (n) { h = !1 } return h } function Gf() { this.Ia = { Ua: 1, Va: 1, ab: 0, bb: 0, Ra: 0, eb: 0, scale: 1 }; this.ga = !0; this.La = [] } var Hf = function () { function h() { var h; this.J = Array(6); for (h = 0; 6 > h; h++) this.J[h] = new Gf } h.prototype.Ub = function (h, k, n, r) { for (var u = 0; 6 > u; u++) { var L; if (L = this.J[u]) { var O; O = []; O.push(new Ga(-1, -1, -1, 0, 0)); O.push(new Ga(1, -1, -1, 1, 0)); O.push(new Ga(1, 1, -1, 1, 1)); O.push(new Ga(-1, 1, -1, 0, 1)); for (var T = 0; T < O.length; T++) 4 > u ? O[T].L(-Math.PI / 2 * u) : O[T].D(Math.PI / 2 * (4 == u ? -1 : 1)), r && (O[T].Y(r.Da * Math.PI / 180), O[T].D(-r.pitch * Math.PI / 180)), O[T].L(-h * Math.PI / 180), O[T].D(k * Math.PI / 180), O[T].Y(n * Math.PI / 180); L.ga = 0 < O.length } } }; return h }(); function pano2vrPlayer(h) { function x(e) { var a, b; b = []; b.title = ""; b.description = ""; b.author = ""; b.datetime = ""; b.copyright = ""; b.source = ""; b.information = ""; b.comment = ""; b.latitude = 0; b.longitude = 0; b.tags = []; if (e && ((a = e.getAttributeNode("title")) && (b.title = a.nodeValue.toString()), (a = e.getAttributeNode("description")) && (b.description = a.nodeValue.toString()), (a = e.getAttributeNode("author")) && (b.author = a.nodeValue.toString()), (a = e.getAttributeNode("datetime")) && (b.datetime = a.nodeValue.toString()), (a = e.getAttributeNode("copyright")) && (b.copyright = a.nodeValue.toString()), (a = e.getAttributeNode("source")) && (b.source = a.nodeValue.toString()), (a = e.getAttributeNode("info")) && (b.information = a.nodeValue.toString()), (a = e.getAttributeNode("comment")) && (b.comment = a.nodeValue.toString()), (a = e.getAttributeNode("latitude")) && (b.latitude = Number(a.nodeValue)), (a = e.getAttributeNode("longitude")) && (b.longitude = Number(a.nodeValue)), a = e.getAttributeNode("tags"))) { e = a.nodeValue.toString().split("|"); for (a = 0; a < e.length; a++) "" == e[a] && (e.splice(a, 1), a--); b.tags = e } return b } function k(e) { d.Ob("beforechangenode", { cc: Ha, qc: e }); "" != Ha && -1 == Xd.indexOf(Ha) && Xd.push(Ha); "{" == e.charAt(0) ? Ha = e.substr(1, e.length - 2) : Ha = ""; d.skinObj && d.skinObj.changeActiveNode && d.skinObj.changeActiveNode(e); d.Ob("changenode", { cc: Ha, oc: e }) } function n(e) { return function () { d.dirty = !0; d.ob = !0; e.v && (e.f && e.f.complete ? (e.loaded = !0, e.v.drawImage(e.f, 0, 0, e.width, e.height), e.f = null, e.Ca = null) : e.Ca && e.Ca.complete && !e.loaded && (e.v.drawImage(e.Ca, 0, 0, e.width, e.height), e.Ca = null)) } } function r(e) { for (var a = 0; a < G.length; a++) if (G[a].id == e) return G[a]; for (a = 0; a < F.length; a++) if (F[a].id == e) return F[a]; for (a = 0; a < Ua.length; a++) if (Ua[a].id == e) return Ua[a]; return null } function u(e) { try { e.obj = document.createElement("img"); e.obj.setAttribute("style", "-webkit-user-drag:none; max-width:none;"); e.obj.setAttribute("class", "ggmedia"); d.Na && e.obj.setAttribute("id", d.Na + e.id); e.obj.ondragstart = function () { return !1 }; if (1 == e.sa || 4 == e.sa) e.fa = function () { e.Ma(!e.ua) }, e.Wa = function () { e.hb = !1; e.obj.style[tb] = "none" }, e.Ma = function (b) { e.ua = b; e.obj.style.zIndex = e.ua ? 8E4 : 0; e.obj.style[tb] = "all 1s ease 0s"; e.hb = !0; Yd() }, e.obj.addEventListener(O(), e.Wa, !1), e.obj.addEventListener("transitionend", e.Wa, !1); e.obj.setAttribute("src", Ma(e.url)); e.ma && (e.obj.width = e.ma); e.pa && (e.obj.height = e.pa); Ua.push(e); e.obj.style.position = "absolute"; e.fa && (e.obj.onclick = e.fa); C.appendChild(e.obj) } catch (a) { $a() } } function L(e) { try { e.obj = document.createElement("video"); e.obj.setAttribute("class", "ggmedia"); d.Na && e.obj.setAttribute("id", d.Na + e.id); e.obj.setAttribute("style", "max-width:none;"); if (1 == e.sa || 4 == e.sa) e.fa = function () { e.Ma(!e.ua) }, e.Wa = function () { e.hb = !1; e.obj.style[tb] = "none" }, e.Ma = function (b) { e.ua = b; e.ua ? (e.obj.style.zIndex = 8E4, e.obj.style[tb] = "all 1s ease 0s", d.playSound(e.id)) : (e.obj.style.zIndex = 0, e.obj.style[tb] = "all 1s ease 0s"); e.hb = !0; Yd() }, e.obj.addEventListener(O(), e.Wa, !1), e.obj.addEventListener("transitionend", e.Wa, !1); 2 == e.sa && (e.fa = function () { d.playPauseSound(e.id) }, e.Ma = function (b) { b ? d.playSound(e.id) : d.pauseSound(e.id) }); var a; for (a = 0; a < e.url.length; a++) { var b; b = document.createElement("source"); b.setAttribute("src", Ma(e.url[a])); e.obj.appendChild(b) } "" != e.poster && (e.obj.poster = Ma(e.poster), 0 > e.loop && (e.obj.dc = "none")); e.obj.volume = e.level * P; 0 == e.loop && (e.obj.qa = 1E7); 1 <= e.loop && (e.obj.qa = e.loop - 1); (1 == e.mode || 2 == e.mode || 3 == e.mode || 5 == e.mode) && 0 <= e.loop && (e.obj.autoplay = !0); F.push(e); e.obj.style.position = "absolute"; e.ma && (e.obj.width = e.ma); e.pa && (e.obj.height = e.pa); C.appendChild(e.obj); d.j && (e.source = d.j.createMediaElementSource(e.obj), 2 == e.mode || 3 == e.mode || 5 == e.mode ? (e.la = d.j.createChannelSplitter(2), e.F = d.j.createGain(), e.B = d.j.createGain(), e.C = d.j.createGain(), e.G = d.j.createGain(), e.ka = d.j.createChannelMerger(2), e.source.connect(e.la), e.la.connect(e.F, 0), e.la.connect(e.B, 0), e.la.connect(e.C, 1), e.la.connect(e.G, 1), e.F.connect(e.ka, 0, 0), e.B.connect(e.ka, 0, 1), e.C.connect(e.ka, 0, 0), e.G.connect(e.ka, 0, 1), e.ka.connect(d.j.destination)) : (e.ea = d.j.createGain(), e.source.connect(e.ea), e.ea.connect(d.j.destination))); e.fa && (e.obj.onclick = e.fa); e.Fb = !0; e.obj.addEventListener("ended", function () { if (0 < this.qa) return this.qa--, this.currentTime = 0, this.play(), !0; this.Fb = !1 }, !1) } catch (c) { $a() } } function O() { var e, a = document.createElement("fakeelement"), b = { OTransition: "oTransitionEnd", MSTransition: "msTransitionEnd", MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd", transition: "transitionEnd" }; for (e in b) if (void 0 !== a.style[e]) return b[e] } function T(e) { var a = -1, b; for (b = 0; b < G.length; b++) G[b].id == e.id && null != G[b].obj && G[b].url.join() == e.url.join() && G[b].loop == e.loop && G[b].mode == e.mode && (a = b); if (-1 == a) { for (b = 0; b < G.length; b++) if (G[b].id == e.id && null != G[b].obj) { if (d.j && nc) Kc.push(G[b]), 1 != qa && 2 != qa && d.pb(G[b]); else { try { G[b].obj.pause() } catch (c) { $a() } try { G[b].obj.parentElement.removeChild(G[b].obj), delete G[b].obj, G[b].obj = null } catch (f) { $a() } } a = b } e.obj = document.createElement("audio"); e.obj.setAttribute("class", "ggmedia"); d.Na && e.obj.setAttribute("id", d.Na + e.id); for (b = 0; b < e.url.length; b++) { var p; p = document.createElement("source"); "" != e.url[b] && "#" != e.url[b] && (p.setAttribute("src", Ma(e.url[b])), e.obj.appendChild(p)) } e.obj.volume = e.level * P; 0 == e.loop && (e.obj.qa = 1E7); 1 <= e.loop && (e.obj.qa = e.loop - 1); 0 <= a ? G[a] = e : G.push(e); 0 < e.obj.childNodes.length && (d.l.appendChild(e.obj), e.obj.addEventListener("ended", function () { 0 < this.qa && (this.qa--, this.currentTime = 0, this.zb && (this.ea && 0 == this.ea.gain.value || 0 == this.F.gain.value && 0 == this.G.gain.value && 0 == this.B.gain.value && 0 == this.C.gain.value) || this.play()); return !0 }, !1), d.j && (e.source = d.j.createMediaElementSource(e.obj), 0 == e.loop && e.source.mediaElement && (e.source.mediaElement.loop = !0), e.zb = !1, 2 == e.mode || 3 == e.mode || 5 == e.mode ? (e.la = d.j.createChannelSplitter(2), e.F = d.j.createGain(), e.B = d.j.createGain(), e.C = d.j.createGain(), e.G = d.j.createGain(), e.ka = d.j.createChannelMerger(2), e.source.connect(e.la), e.la.connect(e.F, 0), e.la.connect(e.B, 0), e.la.connect(e.C, 1), e.la.connect(e.G, 1), e.F.connect(e.ka, 0, 0), e.B.connect(e.ka, 0, 1), e.C.connect(e.ka, 0, 0), e.G.connect(e.ka, 0, 1), e.ka.connect(d.j.destination)) : (e.ea = d.j.createGain(), e.source.connect(e.ea), e.ea.connect(d.j.destination)))) } 1 != e.mode && 2 != e.mode && 3 != e.mode && 5 != e.mode || !(0 <= e.loop) || d.j && nc || (e.obj.autoplay = !0) } function Aa(e, a) { var b; if (0 != Lc.length || !kd || ld) { Ia = document.createElement("div"); b = "left: " + e + "px;" + ("top:\t " + a + "px;"); b += "z-index: 5000;"; b += "position:relative;"; b += "display: table;"; b += "background-color: white;"; b += "border: 1px solid lightgray;"; b += "box-shadow: 1px 1px 3px #333;"; b += "font-family: Verdana, Arial, Helvetica, sans-serif;"; b += "font-size: 9pt;"; b += "opacity : 0.95;"; Ia.setAttribute("style", b); b = document.createElement("style"); var c = document.createTextNode(".contextrow:hover { background-color: #3399FF }"); b.type = "text/css"; b.styleSheet ? b.styleSheet.cssText = c.nodeValue : b.appendChild(c); Ia.appendChild(b); for (c = 0; c < Lc.length; c++) { var f = Lc[c], p = document.createElement("div"); b = "text-align: left;"; b += "margin: 0;"; b += "padding: 5px 20px;"; b += "vertical-align: left;"; p.setAttribute("style", b); p.setAttribute("class", "contextrow"); b = document.createElement("a"); b.href = f.url; b.target = "_blank"; b.innerHTML = f.text; b.setAttribute("style", "color: black; text-decoration: none;"); p.appendChild(b); Ia.appendChild(p) } 0 < Lc.length && (!kd || ld) && Ia.appendChild(document.createElement("hr")); ld && (c = document.createElement("div"), c.setAttribute("class", "contextrow"), b = "text-align: left;margin: 0;", b += "padding: 5px 20px;", b += "vertical-align: left;", b += "cursor: pointer;", c.setAttribute("style", b), c.onclick = d.toggleFullscreen, c.innerHTML = Mc() ? "Exit Fullscreen" : "Enter Fullscreen", Ia.appendChild(c)); kd || (c = document.createElement("div"), b = "text-align: left;margin: 0;", b += "padding: 5px 20px;", b += "vertical-align: left;", c.setAttribute("style", b), c.setAttribute("class", "contextrow"), b = document.createElement("a"), b.href = "https://apps.fastout.com", b.target = "_blank", b.innerHTML = "Copyright © 2015 Fastout AB", b.setAttribute("style", "color: black; text-decoration: none;"), c.appendChild(b), Ia.appendChild(c)); d.l.insertBefore(Ia, d.l.firstChild); Ia.onclick = function () { Ia && (d.l.removeChild(Ia), Ia = null) }; Ia.oncontextmenu = Ia.onclick } } function Vb() { setTimeout(function () { d.setFullscreen(!1) }, 10); setTimeout(function () { d.setFullscreen(!1) }, 100) } function lb() { var e = new Date; Zd++; 120 <= Zd && ($a(), Zd = 0); $d = md = 0; oc && (Ac(), oc = !1); 0 <= ra && (Va ? (Ja = .4 * (Xb - nd), ub = .4 * (mb - od), nd += Ja, od += ub) : (Ja = .1 * -Nc * Cb / 8, ub = .1 * -Oc * Cb / 8), Ge(Ja, ub), d.update()); Pc && (d.changeFov(.4 * (R - y)), .001 > Math.abs(R - y) / y && (Pc = !1), d.update()); ae && (0 != Ja || 0 != ub) && 0 > ra && (Ja *= .9, ub *= .9, .1 > Ja * Ja + ub * ub ? ub = Ja = 0 : (Ge(Ja, ub), d.update())); if (0 != Db) { var g = Cb / 8; switch (Db) { case 37: d.changePan(g * Sa(), !0); break; case 38: d.changeTilt(g * Sa(), !0); break; case 39: d.changePan(-g * Sa(), !0); break; case 40: d.changeTilt(-g * Sa(), !0); break; case 43: case 107: case 16: be || d.changeFovLog(-g, !0); break; case 17: case 18: case 109: case 45: case 91: be || d.changeFovLog(g, !0) } d.update() } if (!d.isLoaded && d.hasConfig) { var b = 0, c = d.checkLoaded.length; if (Qc) c = 50, ce < c && ce++, b = ce; else for (g = 0; g < c; g++) d.checkLoaded[g].complete && "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYBgeACDAAADIAAE3iTbkAAAAAElFTkSuQmCC" != d.checkLoaded[g].src && b++; b == c ? (pd = 1, d.isLoaded = !0, d.divSkin && d.divSkin.ggLoaded && d.divSkin.ggLoaded(), qd && vb && !uc && !d.ya && (sa = !0, Eb = 0)) : pd = b / (1 * c) } for (; 360 < D;) D -= 360; for (; -360 > D;) D += 360; if (uc) { N = rd - D; if (360 == hb - Qb) { for (; -180 > N;) N += 360; for (; 180 < N;) N -= 360 } ea = sd - w; Rc = td - ya; ca = de - y; var f = ee * Sa(), g = Math.sqrt(N * N + ea * ea + Rc * Rc + ca * ca); if (100 * g < f) { if (uc = !1, ca = Rc = ea = N = 0, D = rd, w = sd, ya = td, y = de, d.onMoveComplete) d.onMoveComplete() } else g = g > 5 * f ? f / g : .2, N *= g, ea *= g, ca *= g; D += N; w += ea; ya += Rc; y += ca; Sc = e.getTime(); d.update() } else if (sa) if (g = e.getTime() - Fb, He) { g /= 100; c = !1; if (d.xa != B.cliptitle) { for (b = 0; b < Rb.length; b++) if ("" == d.xa || "" != d.xa && Rb[b].cliptitle == d.xa) { c = !0; B = Rb[b]; d.xa = B.cliptitle; break } !c && 0 < Rb.length && (c = !0, B = Rb[0], d.xa = B.cliptitle) } else c = !0; if (c) if (d.Sa) if (g >= B.length) if (d.Sa = !1, d.xa = B.nextcliptitle, d.xa == B.cliptitle) { if (1 < ia.length) { if (fe) { b = 1E3; do f = ia[Math.floor(Math.random() * ia.length)]; while (b-- && f == Ha) } else f = d.pc(); d.openNext("{" + f + "}"); Fb = e.getTime(); d.Sa = !1; Tc = sa = !0 } } else d.ib && B.nextclipnodeid != Ha && (d.openNext("{" + B.nextclipnodeid + "}"), ud ? (sa = !1, Tc = !0) : sa = !0), Fb = e.getTime(); else { b = { lc: { value: 0, name: "pan" }, mc: { value: 1, name: "tilt" }, kc: { value: 2, name: "fov" } }; for (f in b) { for (var c = b[f], p = 0, p = Math.floor(g) ; !d.Bb(p, c.value) && 0 < p;) p--; var h = d.Bb(p, c.value), l = d.Wb(h); if (l) { var p = new xa(h.time, h.value), q = new xa(l.time, l.value), m = (g - h.time) / (l.time - h.time); if (0 != h.type || 0 != l.type && 3 != l.type) if (3 == h.type) p = h.value; else { var m = new xa, k = new xa, n = l.time - h.time; 0 == h.type ? k.K(h.time + .3 * n, h.value) : k.K(h.bezierouttime, h.bezieroutvalue); 0 == l.type || 3 == l.type ? m.K(l.time - .3 * n, l.value) : m.K(l.bezierintime, l.bezierinvalue); h = new xa; h.Tb(p, q, k, m, g); p = h.y } else h = new xa, h.wa(p, q, m), p = h.y } else p = h.value; switch (c.value) { case 0: c = D; D = p; N = D - c; break; case 1: c = w; w = p; ea = w - c; break; case 2: c = y, y = p, ca = y - c } } d.update() } else f = B.keyframes[0], g = B.keyframes[1], b = B.keyframes[2], d.getPan() != f.value || d.getTilt() != g.value || d.getFov() != b.value ? (d.moveTo(f.value, g.value, b.value, 1), sa = !0) : (d.Sa = !0, Fb = e.getTime()) } else if (0 < ge && d.ib && g >= 1E3 * ge) { if (1 < ia.length) { if (fe) { b = 1E3; do f = ia[Math.floor(Math.random() * ia.length)]; while (b-- && f == Ha) } else b = ia.indexOf(Ha), b++, b >= ia.length && (b = 0), f = ia[b]; Fb = e.getTime(); Eb = e.getTime(); vd = 0; d.openNext("{" + f + "}"); Tc = sa = !0 } } else f = e.getTime(), b = g = 1E3 / 60, 0 != Eb && (b = f - Eb), ea = wd * (0 - w) / 100, ca = wd * (xd - y) / 100, N = .95 * N + -Gb * Sa() * .05, g = b / g, D += N * g, w += ea * g, y += ca * g, Eb = f, Fb = e.getTime(), d.update(); else vb && 0 > ra && e.getTime() - Sc > 1E3 * vd && (qd && d.isLoaded || !qd) && (sa = !0, Fb = e.getTime(), ca = ea = N = Eb = 0), ae && 0 == Db && 0 > ra && (0 != N || 0 != ea || 0 != ca) && (N *= .9, ea *= .9, ca *= .9, D += N, w += ea, d.changeFovLog(ca), 1E-4 > N * N + ea * ea + ca * ca && (ca = ea = N = 0), d.update()); if (d.ya) if (f = e.getTime() - Ie, f /= 1E3 * Je, 1 <= f) { d.ya = !1; for (f = 0; f < Kc.length; f++) d.pb(Kc[f]); he = e.getTime(); d.Nb(); d.Ka = !0; 1 != Wa && 2 != Wa && 3 != Wa || yd || d.moveTo(zd, Ad, Bd, Uc) } else Ke(f); else d.Ka && (f = e.getTime() - he, f /= 1E3 * Le, 1 <= f ? (d.Ka = !1, Sc = e.getTime(), d.update(), 1 != Wa && 2 != Wa && 3 != Wa || !yd || d.moveTo(zd, Ad, Bd, Uc), d.setLockedMouse(Me), d.setLockedKeyboard(Ne), sa = Tc, Eb = 0, Tc = !1) : Ke(f)); if (0 < F.length) for (e = 0; e < F.length; e++) F[e].Fb && F[e].Zb != F[e].obj.currentTime && (F[e].Zb = F[e].obj.currentTime, !F[e].Qb && 0 < F[e].obj.videoHeight && (F[e].Qb = F[e].obj.videoWidth / F[e].obj.videoHeight)); if (z && Oe != z.currentTime) { Oe = z.currentTime; try { Vc && Cd && 0 < z.readyState && (Ic = !0, a.bindTexture(a.TEXTURE_2D, Vc), a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, !1), a.texImage2D(a.TEXTURE_2D, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, z), d.update()) } catch (v) { } } if (0 < t.mode) { if (2 == t.mode) for (e = 0; e < J.length; e++) f = J[e], "poly" == f.type && f.I != f.A && (f.I > f.A ? (f.A += t.fb, f.I < f.A && (f.A = f.I)) : (f.A -= t.fb, f.I > f.A && (f.A = f.I)), d.update()); 3 == t.mode && t.I != t.A && (t.I > t.A ? (t.A += t.fb, t.I < t.A && (t.A = t.I)) : (t.A -= t.fb, t.I > t.A && (t.A = t.I)), d.update()) } e = new Ga; e.Ab(D, w); for (f = q = k = 0; f < G.length + F.length; f++) if (g = f < G.length ? G[f] : F[f - G.length], g.obj) { b = g.pan - D; for (h = g.tilt - w; -180 > b;) b += 360; for (; 180 < b;) b -= 360; c = g.T; p = g.Ta; 0 == p && (p = .01); 0 > p && (p = y); g.S || (g.S = new Ga, g.S.Ab(g.pan, g.tilt)); (0 == g.mode || 1 == g.mode) && d.j && g.ea && (g.ea.gain.value = g.level * P * g.m); 2 == g.mode && d.j && (k = .5 * Math.cos(b * Math.PI / 180) + .5, g.F.gain.value = Math.sqrt(k) * g.m, g.G.gain.value = Math.sqrt(k) * g.m, g.B.gain.value = Math.sqrt(1 - k) * g.m, g.C.gain.value = Math.sqrt(1 - k) * g.m); 3 == g.mode && (0 > b ? b < -g.H ? b += g.H : b = 0 : b = b > g.H ? b - g.H : 0, l = g.level, h = Math.abs(h), h = h < g.Ja ? 0 : h - g.Ja, m = 1 - h / p, Math.abs(b) > p || 0 > m ? (k = l * c * P, d.j ? (g.F.gain.value = k * g.m, g.G.gain.value = k * g.m, g.B.gain.value = 0, g.C.gain.value = 0) : g.obj.volume = l * c * P) : (k = 1 - Math.abs(b / p), d.j ? (q = l * (c + (1 - c) * m * k) * P, k = l * c * P, 0 <= b ? (g.F.gain.value = q * g.m, g.G.gain.value = k * g.m) : (g.F.gain.value = k * g.m, g.G.gain.value = q * g.m), 2 * Math.abs(b) < p ? (k = 1 - Math.abs(2 * b) / p, q = l * (c + (1 - c) * m * k) * P, k = .5 * l * (1 - c) * m * (1 - k) * P, 0 <= b ? (g.G.gain.value = q * g.m, g.C.gain.value = k * g.m, g.B.gain.value = 0) : (g.F.gain.value = q * g.m, g.B.gain.value = k * g.m, g.C.gain.value = 0)) : (k = 1 - (Math.abs(2 * b) - p) / p, q = .5 * l * (1 - c) * m * k * P, 0 <= b ? (g.C.gain.value = q * g.m, g.B.gain.value = 0) : (g.B.gain.value = q * g.m, g.C.gain.value = 0))) : g.obj.volume = l * (c + (1 - c) * m * k) * P)); 4 == g.mode && null == g.channel && (Math.abs(b) < g.H && Math.abs(h) < g.Ja ? g.cb || (g.cb = !0, g.obj.play()) : g.cb = !1); 5 == g.mode && (q = 180 * Math.acos(e.lb(g.S)) / Math.PI, q < g.H ? d.j ? (g.F.gain.value = g.level * P * g.m, g.G.gain.value = g.level * P * g.m, g.B.gain.value = 0, g.C.gain.value = 0) : g.obj.volume = g.level * P : d.j ? q < g.H + p ? (0 > b ? b = b > -g.H ? 0 : b + g.H : b = b < g.H ? 0 : b - g.H, q = 1 - Math.max(q - g.H, 0) / p, k = Math.max(1 - Math.abs(b) * Math.cos(g.tilt * Math.PI / 180) / p, 0), 0 < b ? (g.F.gain.value = g.level * (q * (1 - g.T) + g.T) * g.m, g.G.gain.value = g.level * (q * k * (1 - g.T) + g.T) * g.m, g.B.gain.value = 0, g.C.gain.value = g.level * q * (1 - k) * g.m) : (g.F.gain.value = g.level * (q * k * (1 - g.T) + g.T) * g.m, g.G.gain.value = g.level * (q * (1 - g.T) + g.T) * g.m, g.B.gain.value = g.level * q * (1 - k) * g.m, g.C.gain.value = 0)) : (q = g.level * g.T, g.F.gain.value = q * g.m, g.G.gain.value = q * g.m, g.B.gain.value = 0, g.C.gain.value = 0) : (q -= g.H, q < p && 0 < p ? (k = 1 - Math.abs(q / p), g.obj.volume = g.level * (c + (1 - c) * k) * P) : g.obj.volume = c * P)); 6 == g.mode && (q = 180 * Math.acos(e.lb(g.S)) / Math.PI, Math.abs(q) < g.H ? g.cb || (g.cb = !0, g.obj.play()) : g.cb = !1) } d.dirty && (0 < d.gb ? d.gb-- : (d.dirty = !1, d.gb = 0), d.Ka || d.ya || d.updatePanorama()); ie ? setTimeout(lb, 1E3 / 60) : je(lb) } function Nb() { setTimeout(Nb, 100); 9 != md || ie || je(function () { Dd("restart recover timer") }); 10 < md && 1 < $d && (Dd("recover timer - disabling requestAnimationFrame"), ie = !0, lb()); md++ } function Sa() { return Math.min(1, 2 * Math.tan(Math.PI * y / 360)) } function Ob(e) { d.skinObj && d.skinObj.hotspotProxyClick && d.skinObj.hotspotProxyClick(e.id); "" != e.url && (d.openUrl(e.url, e.target), Pe(-1, -1)) } function Ta() { d.isFullscreen && (Mc() || d.exitFullscreen(), Mc() && (d.l.style.left = "0px", d.l.style.top = "0px")) } function sc() { Db = 0 } function hc(e) { Db && (Db = 0, e.preventDefault(), U()) } function ic(e) { Wc || (d.isFullscreen && e.preventDefault(), Db = e.keyCode, U()) } function tc(e) { V || (e.preventDefault(), U(), Xa && Xa.reset && Xa.reset()) } function jc(e) { V || (e.preventDefault(), 1 != e.scale && (Pc = !0, Ed *= e.scale, R = wb / Math.sqrt(Ed), R > ta && (R = ta), R < Na && (R = Na), d.update(), U())) } function Wb(e) { !V && Yb(e.target) && (e.preventDefault(), Pc = !0, R = wb / Math.sqrt(e.scale), R > ta && (R = ta), R < Na && (R = Na), d.update(), U()) } function Pb(e) { ke = !0; Ed = 1; V || (e.touches ? (d.Z = e.touches.target, Yb(e.target) && (e.preventDefault(), wb = y, U())) : (e.preventDefault(), wb = y, U())) } function Bb(e) { !Xa && window.MSGesture && ($a(), Xa = new MSGesture, Xa.target = d.control); Xa && Xa.addPointer(e.pointerId) } function kc() { V || (ra = -2) } function lc(e) { var a; if (!V) { 0 <= ra && U(); var b = (new Date).getTime(); a = -1; var c, f, p = !0; a = Math.abs(Qe - Xc) + Math.abs(Re - Yc); if (0 <= a && 20 > a) { e.preventDefault(); Yb(d.Z) && (c = le(d.mouse.x, d.mouse.y)) && (d.hotspot = c); if (d.Z) for (a = d.Z, f = !1; a && a != d.control;) a.onclick && !f && (a.onclick(), f = !0, p = !1), a = a.parentNode; a = Math.abs(Se - Xc) + Math.abs(Te - Yc); if (700 > b - d.Ya && 0 <= a && 20 > a) { e.preventDefault(); Yb(d.Z) && me && setTimeout(function () { d.toggleFullscreen() }, 1); if (d.Z) for (a = d.Z, f = !1; a && a != d.control;) a.ondblclick && !f && (a.ondblclick(), f = !0, p = !1), a = a.parentNode; d.Ya = 0 } else d.Ya = b; Se = Xc; Te = Yc } if (d.Z) for (e.preventDefault(), a = d.Z, f = !1; a && a != d.control;) { if (a.onmouseout) a.onmouseout(); a.onmouseup && !f && (a.onmouseup(), f = !0); a = a.parentNode } d.Z = null; ra = -11; c && p && Ob(c); d.hotspot = d.emptyHotspot } } function mc(e) { e || (e = window.event); var a = e.touches, b = Zc(); d.mouse.x = a[0].pageX - b.x; d.mouse.y = a[0].pageY - b.y; if (!V) { a[0] && (Xc = a[0].pageX, Yc = a[0].pageY); if (0 <= ra) { e.preventDefault(); for (b = 0; b < a.length; b++) if (a[b].identifier == ra) { Ue(a[b].pageX, a[b].pageY); break } U() } 2 == a.length && a[0] && a[1] && (ra = -6, ke || (Ve = Math.sqrt((a[0].pageX - a[1].pageX) * (a[0].pageX - a[1].pageX) + (a[0].pageY - a[1].pageY) * (a[0].pageY - a[1].pageY)), Pc = !0, R = wb * Math.sqrt(We / Ve), R > ta && (R = ta), R < Na && (R = Na), U(), e.preventDefault())) } } function If(e) { e || (e = window.event); var a = e.touches, b = Zc(); d.mouse.x = a[0].pageX - b.x; d.mouse.y = a[0].pageY - b.y; if (!V) { if (0 > ra && a[0] && (ne = (new Date).getTime(), Qe = a[0].pageX, Re = a[0].pageY, Xc = a[0].pageX, Yc = a[0].pageY, d.Z = a[0].target, Yb(e.target) && ((b = Xe(d.mouse.x, d.mouse.y)) && b.fa ? b.fa() : (Ye(a[0].pageX, a[0].pageY), ra = a[0].identifier), e.preventDefault(), U()), d.Z)) { var b = d.Z, c; for (c = !1; b && b != d.control;) { if (b.onmouseover) b.onmouseover(); b.onmousedown && !c && (b.onmousedown(), c = !0); b = b.parentNode } c && e.preventDefault() } 1 < a.length && (ra = -5); !ke && 2 == a.length && a[0] && a[1] && (We = Math.sqrt((a[0].pageX - a[1].pageX) * (a[0].pageX - a[1].pageX) + (a[0].pageY - a[1].pageY) * (a[0].pageY - a[1].pageY)), wb = y); Oc = Nc = 0 } } function Ze(e) { if (!oe && (e = e ? e : window.event, Yb(e.target))) { var a = e.detail ? -1 * e.detail : e.wheelDelta / 40; $e && (a = -a); e.axis && (-1 == Fd ? Fd = e.axis : Fd != e.axis && (a = 0)); var b = 0 < a ? 1 : -1; 0 != a && (d.changeFovLog(b * af, !0), d.update()); e.preventDefault(); U() } } function Jf(e) { e = e ? e : window.event; Fd = -1; if (!V && 0 <= ra) { U(); e.preventDefault(); ra = -3; Oc = Nc = 0; e = (new Date).getTime(); var a = -1, a = Math.abs(bf - Xb) + Math.abs(cf - mb); 400 > e - ne && 0 <= a && 20 > a && ((a = le(d.mouse.x, d.mouse.y)) && Ob(a), a = Math.abs(df - Xb) + Math.abs(ef - mb), 700 > e - d.Ya && 0 <= a && 20 > a ? (me && setTimeout(function () { d.toggleFullscreen() }, 10), d.Ya = 0) : d.Ya = e, df = Xb, ef = mb) } } function Kf(e) { e = e ? e : window.event; var a = Zc(); Mc() ? (d.mouse.x = e.screenX - Ba, d.mouse.y = e.screenY - ua) : (d.mouse.x = e.pageX - a.x, d.mouse.y = e.pageY - a.y); if (!V && (0 <= ra && (e.preventDefault(), (e.which || 0 == e.which || 1 == e.which) && Ue(e.pageX, e.pageY), U()), d.hotspot == d.emptyHotspot || "poly" == d.hotspot.type)) { var b = d.emptyHotspot; 0 < J.length && Yb(e.target) && (b = le(d.mouse.x, d.mouse.y)); d.hotspot != b && (d.hotspot != d.emptyHotspot && (0 < t.mode && (d.hotspot.I = 0), d.skinObj && d.skinObj.hotspotProxyOut && d.skinObj.hotspotProxyOut(d.hotspot.id)), b ? (d.hotspot = b, d.skinObj && d.skinObj.hotspotProxyOver && d.skinObj.hotspotProxyOver(d.hotspot.id), oa.style.cursor = "pointer", 0 < t.mode && (t.I = 1, d.hotspot.I = 1)) : (d.hotspot = d.emptyHotspot, oa.style.cursor = "auto", 0 < t.mode && (t.I = 0))); Pe(e.pageX - a.x, e.pageY - a.y) } } function Pe(e, a) { var b = t.vb; b.enabled && (d.hotspot != d.emptyHotspot && 0 <= e && 0 <= a && "" != d.hotspot.title ? (X.innerHTML = d.hotspot.title, X.style.color = M(b.wb, b.ub), b.background ? X.style.backgroundColor = M(b.U, b.ba) : X.style.backgroundColor = "transparent", X.style.border = "solid " + M(b.V, b.ca) + " " + b.nb + "px", X.style.borderRadius = b.mb + "px", X.style.textAlign = "center", 0 < b.width ? (X.style.left = e - b.width / 2 + Ba + "px", X.style.width = b.width + "px") : (X.style.width = "auto", X.style.left = e - X.offsetWidth / 2 + Ba + "px"), X.style.height = 0 < b.height ? b.height + "px" : "auto", X.style.top = a + 25 + +ua + "px", X.style.visibility = "inherit", X.style.overflow = "hidden") : (X.style.visibility = "hidden", X.innerHTML = "")) } function Lf(e) { var a = Zc(); Mc() ? (d.mouse.x = e.screenX - Ba, d.mouse.y = e.screenY - ua) : (d.mouse.x = e.pageX - a.x, d.mouse.y = e.pageY - a.y); if (Ia) Ia.onclick(); V || (e = e ? e : window.event, (e.which || 0 == e.which || 1 == e.which) && Yb(e.target) && ((a = Xe(d.mouse.x, d.mouse.y)) && a.fa ? a.fa() : (Ye(e.pageX, e.pageY), ra = 1, ne = (new Date).getTime()), e.preventDefault(), U()), Oc = Nc = 0) } function Mc() { return document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement && null != document.msFullscreenElement || document.fullScreen } function Xe(e, a) { var b = d.Ga(), c, f, p; for (c = 0; c < F.length + Ua.length; c++) { var h; h = c < F.length ? F[c] : Ua[c - F.length]; if (h.ua) return h } for (c = 0; c < F.length + Ua.length; c++) { h = c < F.length ? F[c] : Ua[c - F.length]; var l = [], q = new Ga, m, k, n; 0 < h.Ha && (k = Math.tan(h.Ha / 2 * Math.PI / 180), n = 0 < h.ma ? k * h.pa / h.ma : k, h.va && 1 != h.va && (n *= h.va)); for (m = 0; 4 > m; m++) { switch (m) { case 0: q.K(-k, -n, -1); break; case 1: q.K(k, -n, -1); break; case 2: q.K(k, n, -1); break; case 3: q.K(-k, n, -1) } q.D(-h.tilt * Math.PI / 180); q.L(h.pan * Math.PI / 180); q.L(-D * Math.PI / 180); q.D(w * Math.PI / 180); q.Y(ya * Math.PI / 180); l.push(q.clone()) } l = pe(l); if (0 < l.length) { for (m = 0; m < l.length; m++) q = l[m], .1 > q.z ? (p = -b / q.z, f = E / 2 + q.x * p, p = v / 2 + q.y * p) : p = f = 0, q.X = f, q.R = p; if (ff(l, e, a)) return h } } } function Yb(e) { return e == d.control || e && e.ggType && ("container" == e.ggType || "cloner" == e.ggType || "timer" == e.ggType) ? !0 : !1 } function U() { sa && (sa = !1, ca = ea = N = 0); uc && (uc = !1, ca = ea = N = 0); d.Sa = !1; Sc = (new Date).getTime() } function Ue(e, a) { qe = e; re = a; Nc = qe - Xb; Oc = re - mb; Va && (Xb = qe, mb = re, d.update()) } function Ge(e, a) { var b = d.getVFov(); D += e * b / v; w += a * b / v; Sb() } function Ye(e, a) { bf = e; cf = a; Xb = e; mb = a; nd = e; od = a; $d++ } function gf(e) { var g, b, c, d; se = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, se); var p = [-1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1]; for (g = 0; 12 > g; g++) 2 > g % 3 && (p[g] *= e); a.bufferData(a.ARRAY_BUFFER, new Float32Array(p), a.STATIC_DRAW); Gd = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, Gd); var h = [1, 0, 0, 0, 0, 1, 1, 1]; a.bufferData(a.ARRAY_BUFFER, new Float32Array(h), a.STATIC_DRAW); Hd = a.createBuffer(); a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, Hd); var l = [0, 1, 2, 0, 2, 3]; a.bufferData(a.ELEMENT_ARRAY_BUFFER, new Uint16Array(l), a.STATIC_DRAW); var p = [], l = [], h = [], k = new Ga; for (e = 0; 6 > e; e++) { c = e % 3; d = 3 > e ? 1 : 0; for (b = 0; 4 > b; b++) { k.x = -1; k.y = -1; k.z = 1; for (g = 0; g < b; g++) k.Mb(); h.push((0 > k.x ? .33 : 0) + .33 * c, (0 > k.y ? 0 : .5) + .5 * d); if (4 > e) for (g = 0; g < e; g++) k.hc(); else 5 == e ? k.gc() : k.fc(); p.push(k.x, k.y, k.z) } g = 4 * e; l.push(0 + g, 1 + g, 2 + g, 0 + g, 2 + g, 3 + g) } te = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, te); a.bufferData(a.ARRAY_BUFFER, new Float32Array(p), a.STATIC_DRAW); Id = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, Id); a.bufferData(a.ARRAY_BUFFER, new Float32Array(h), a.STATIC_DRAW); ue = a.createBuffer(); a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, ue); a.bufferData(a.ELEMENT_ARRAY_BUFFER, new Uint16Array(l), a.STATIC_DRAW); Ka = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, Ka); a.bufferData(a.ARRAY_BUFFER, new Float32Array([-1, -1, 0, 1, -1, 0, -1, 1, 0, 1, 1, 0]), a.STATIC_DRAW); Ka.oa = 3; Ka.Aa = 4; xb = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, xb); h = [0, 0, 1, 0, 0, 1, 1, 1]; a.bufferData(a.ARRAY_BUFFER, new Float32Array(h), a.STATIC_DRAW); Zb = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, Zb); a.bufferData(a.ARRAY_BUFFER, new Float32Array([-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, 1, 0]), a.STATIC_DRAW); Zb.oa = 3; Zb.Aa = 4; Bc = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, Bc); g = [0, 0, 0]; p = 2 * Math.PI / 6; e = Math.PI / 180 * 35; b = 1; for (c = e; c <= e + 2 * Math.PI; c += p) g.push(Math.sin(c)), g.push(-Math.cos(c)), g.push(0), b++; a.bufferData(a.ARRAY_BUFFER, new Float32Array(g), a.STATIC_DRAW); Bc.oa = 3; Bc.Aa = b } function hf() { var e, g; if (nb) for (; 0 < nb.length;) a.deleteTexture(nb.pop()); nb = []; for (var b = 0; 6 > b; b++) g = a.createTexture(), g.kb = null, g.jb = null, g.Eb = !1, a.bindTexture(a.TEXTURE_2D, g), a.texImage2D(a.TEXTURE_2D, 0, a.RGB, 1, 1, 0, a.RGB, a.UNSIGNED_BYTE, null), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), vc[b] && (e = new Image, e.crossOrigin = "anonymous", e.src = Ma(vc[b]), g.kb = e, e.addEventListener && e.addEventListener("load", ve(g), !1), d.checkLoaded.push(e)), nb.push(g); for (b = 0; 6 > b; b++) Jd[b] && (e = new Image, e.crossOrigin = "anonymous", e.src = Ma(Jd[b]), e.addEventListener ? e.addEventListener("load", ve(nb[b]), !1) : e.onload = ve(nb[b]), nb[b].jb = e, d.checkLoaded.push(e)); for (b = 0; b < F.length; b++) F[b].jc = a.createTexture(), a.bindTexture(a.TEXTURE_2D, F[b].jc), a.texImage2D(a.TEXTURE_2D, 0, a.RGB, 1, 1, 0, a.RGB, a.UNSIGNED_BYTE, null), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE); Vc = a.createTexture(); a.bindTexture(a.TEXTURE_2D, Vc); a.texImage2D(a.TEXTURE_2D, 0, a.RGB, 1, 1, 0, a.RGB, a.UNSIGNED_BYTE, null); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE); we = a.createTexture(); a.bindTexture(a.TEXTURE_2D, we); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE); e = document.createElement("canvas"); e.width = 100; e.height = 1; g = e.getContext("2d"); g.width = 100; g.height = 1; b = g.createLinearGradient(0, 0, 100, 0); b.addColorStop(0, M(16777215, 0)); b.addColorStop(.88, M(0, 0)); b.addColorStop(.9, M(16654848, 1)); b.addColorStop(.92, M(16776448, 1)); b.addColorStop(.94, M(4849466, 1)); b.addColorStop(.96, M(131071, 1)); b.addColorStop(.98, M(8190, 1)); b.addColorStop(1, M(0, 0)); g.fillStyle = b; g.fillRect(0, 0, 100, 1); a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, e); a.bindTexture(a.TEXTURE_2D, null) } function Kd(e, a, b, c) { var d = l.Gb - 1 - a, p = l.Jb, h = "x"; switch (e) { case 0: h = "f"; break; case 1: h = "r"; break; case 2: h = "b"; break; case 3: h = "l"; break; case 4: h = "u"; break; case 5: h = "d" } for (var k = 0; 3 > k; k++) p = ab(p, "c", e), p = ab(p, "s", h), p = ab(p, "r", a), p = ab(p, "l", d), p = ab(p, "x", b), p = ab(p, "y", c), p = ab(p, "v", c), p = ab(p, "h", b); return Ma(p) } function ab(e, a, b) { var c = (new RegExp("%0*" + a, "i")).exec(e.toString()); if (c) { var c = c.toString(), d = b.toString(); for (c.charAt(c.length - 1) != a && (d = (1 + b).toString()) ; d.length < c.length - 1;) d = "0" + d; e = e.replace(c, d) } return e } function Ma(e) { return e ? "{" == e.charAt(0) || "/" == e.charAt(0) || 0 < e.indexOf("://") || 0 == e.indexOf("javascript:") ? e : Hb + e : Hb } function ve(e) { return function () { try { if (e.bc) return; a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, !0); var g = !1; null != e.jb && e.jb.complete ? e.Eb || (a.bindTexture(a.TEXTURE_2D, e), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, e.jb), g = e.Eb = !0) : null != e.kb && e.kb.complete && (a.bindTexture(a.TEXTURE_2D, e), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, e.kb), g = !0); g && (a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), e.loaded = !0); a.bindTexture(a.TEXTURE_2D, null) } catch (b) { } d.update() } } function Yd() { var e = Math.round(d.Ga()), a; for (a = 0; a < F.length + Ua.length; a++) { var b; b = a < F.length ? F[a] : Ua[a - F.length]; Ib || jf(e); var c = ""; Ib && (c += "perspective(" + e + "px) "); var c = c + ("translate3d(0px,0px," + e + "px) "), c = c + ("rotateZ(" + ya.toFixed(10) + "deg) "), c = c + ("rotateX(" + w.toFixed(10) + "deg) "), c = c + ("rotateY(" + (-D).toFixed(10) + "deg) "), c = c + ("rotateY(" + b.pan.toFixed(10) + "deg) "), c = c + ("rotateX(" + (-b.tilt).toFixed(10) + "deg) "), f = 1E4, p = b.obj.videoWidth, h = b.obj.videoHeight; if (0 == p || 0 == h) p = 640, h = 480; 0 < b.ma && (p = b.ma); 0 < b.pa && (h = b.pa); 0 < p && 0 < h && (b.obj.width = p + "px", b.obj.$b = h + "px", b.obj.style.width = p + "px", b.obj.style.$b = h + "px"); 0 < b.Ha && (f = p / (2 * Math.tan(b.Ha / 2 * Math.PI / 180))); c += "translate3d(0px,0px," + (-f).toFixed(10) + "px) "; c += "rotateZ(" + b.Y.toFixed(10) + "deg) "; c += "rotateY(" + (-b.L).toFixed(10) + "deg) "; c += "rotateX(" + b.D.toFixed(10) + "deg) "; b.va && 1 != b.va && (c += "scaleY(" + b.va + ") "); c += "translate3d(" + -p / 2 + "px," + -h / 2 + "px,0px) "; b.obj.style[La + "Origin"] = "0% 0%"; b.ua && (c = "", 1 == b.sa && (f = Math.min(E / p, v / h), c += "scale(" + f + ") "), c += "translate3d(" + -p / 2 + "px," + -h / 2 + "px,0px) "); b.Yb != c && (b.Yb = c, b.obj.style[La] = c, b.obj.style.left = Ba + E / 2 + "px", b.obj.style.top = ua + v / 2 + "px", b.obj.style.visibility = "visible", b.hb && b.Xb == b.ua && (b.obj.style[tb] = "all 0s linear 0s"), b.Xb = b.ua) } } function kf() { for (var e = 0, a = Math.tan(d.getVFov() * Math.PI / 360), b = v / (2 * a), b = b * (1 + E / v * a / 2), b = b * Math.pow(2, l.Ib) ; l.i.length >= e + 2 && !l.i[e + 1].rb && l.i[e + 1].width > b;) e++; return e } function lf() { for (var e = 0; e < l.i.length; e++) { var a = l.i[e], b; for (b in a.s) a.s.hasOwnProperty(b) && (a.s[b].visible = !1) } } function mf() { var e; if (!(6 > d.O.J.length)) for (e = 0; 6 > e; e++) { var a; a = d.O.J[e]; var b; b = []; b.push(new Ga(-1, -1, -1, 0, 0)); b.push(new Ga(1, -1, -1, 1, 0)); b.push(new Ga(1, 1, -1, 1, 1)); b.push(new Ga(-1, 1, -1, 0, 1)); for (var c = 0; 4 > c; c++) 4 > e ? b[c].L(-Math.PI / 2 * e) : b[c].D(Math.PI / 2 * (4 == e ? -1 : 1)), Ca && (b[c].Y(Ca.Da * Math.PI / 180), b[c].D(-Ca.pitch * Math.PI / 180)), b[c].L(-D * Math.PI / 180), b[c].D(w * Math.PI / 180), b[c].Y(ya * Math.PI / 180); b = pe(b); a.ga = 0 < b.length; if (a.ga) { a = a.Ia; a.Ua = b[0].ra; a.ab = b[0].ra; a.Va = b[0].S; a.bb = b[0].S; for (c = 1; c < b.length; c++) a.Ua = Math.min(a.Ua, b[c].ra), a.ab = Math.max(a.ab, b[c].ra), a.Va = Math.min(a.Va, b[c].S), a.bb = Math.max(a.bb, b[c].S); a.Ra = a.ab - a.Ua; a.eb = a.bb - a.Va; a.scale = Math.max(a.Ra, a.eb) } else a.Ia.Ra = -1, a.Ia.eb = -1 } } function nf(e, a, b) { b.W = e.width / l.o * a.Ua; b.da = e.height / l.o * a.Va; b.ha = e.width / l.o * a.ab; b.ia = e.height / l.o * a.bb; b.W = Math.min(Math.max(0, Math.floor(b.W)), e.M - 1); b.da = Math.min(Math.max(0, Math.floor(b.da)), e.ja - 1); b.ha = Math.min(Math.max(0, Math.floor(b.ha)), e.M - 1); b.ia = Math.min(Math.max(0, Math.floor(b.ia)), e.ja - 1) } function Ld(e) { return function () { d.dirty = !0; d.ta = !0; ja && ja--; 0 == ja && d.divSkin && d.divSkin.ggLoadedLevels && d.divSkin.ggLoadedLevels(); e.f = null } } function Mf() { return function () { d.dirty = !0; d.ta = !0; ja && ja--; 0 == ja && d.divSkin && d.divSkin.ggLoadedLevels && d.divSkin.ggLoadedLevels() } } function Nf(e) { return function () { d.dirty = !0; d.ob = !0; d.ta = !0; e.loaded = !0; e.f && !e.g && C.appendChild(e.f); ja && ja--; 0 == ja && d.divSkin && d.divSkin.ggLoadedLevels && d.divSkin.ggLoadedLevels(); e.f && e.v && (e.v.drawImage(e.f, 0, 0), e.f = null) } } function of() { return function () { d.dirty = !0; d.ta = !0; ja && ja--; 0 == ja && d.divSkin && d.divSkin.ggLoadedLevels && d.divSkin.ggLoadedLevels() } } function Of(e) { return function () { d.dirty = !0; d.ob = !0; d.ta = !0; try { if (null != e && e.complete) { var g = { width: e.width, height: e.width, cache: !0, rb: !0, M: 1, ja: 1, s: [] }, b; for (b = 0; 6 > b; b++) { var c = { g: null, v: null, f: null, na: null }; c.g = document.createElement("canvas"); pa ? (c.g.width = g.width, c.g.height = g.height) : (c.g.width = l.o + 2 * l.P, c.g.height = l.o + 2 * l.P); c.v = c.g.getContext("2d"); c.g.Cb = c.v; c.g.style[La + "Origin"] = "0% 0%"; c.g.style.overflow = "hidden"; c.g.style.position = "absolute"; c.f = e; c.v && ($b ? c.v.drawImage(e, 0, b * g.height, g.width, g.height, 0, 0, g.width + 2, g.height + 2) : c.v.drawImage(e, 0, b * g.height, g.width, g.height, 0, 0, g.width, g.height)); pa && a && (a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, !0), c.na = a.createTexture(), a.bindTexture(a.TEXTURE_2D, c.na), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, c.g), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), a.bindTexture(a.TEXTURE_2D, null)); $b && (c.g.za = -1, C.insertBefore(c.g, C.firstChild)); g.s[b] = c } l.i.push(g) } } catch (f) { $a() } d.update() } } function Pf(e) { return function () { d.dirty = !0; d.ob = !0; d.ta = !0; e.loaded = !0; ja && ja--; 0 == ja && d.divSkin && d.divSkin.ggLoadedLevels && d.divSkin.ggLoadedLevels(); a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL, !0); if (null != e.f && e.f.complete) { e.na = a.createTexture(); try { a.bindTexture(a.TEXTURE_2D, e.na), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, e.f) } catch (g) { $a() } a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE); a.bindTexture(a.TEXTURE_2D, null) } d.update() } } function Sb() { var e, a; if (2 == ac) { a = y / 2; var b = E / v; e = b * a; var c = 50 * l.width / (.01 + l.height); y < Na && (y = Na); y > ta && (y = ta); 100 < y && (y = 100); y > 2 * c / b && (y = 2 * c / b); y > ka - Ya && (y = ka - Ya); y > hb - Qb && (y = hb - Qb); 50 < w + a && (w = 50 - a); -50 > w - a && (w = -50 + a); D + e > c && (D = c - e); D - e < -c && (D = -c + e); w + a > ka && (w = ka - a); w - a < Ya && (w = Ya + a) } else if (0 < xe && (e = yb, l.i && 0 < l.i.length && (e = l.i[0].height), Na = 360 * Math.atan2(v / 2, e / 2 * xe) / Math.PI), y < Na && (y = Na), y > ta && (y = ta), a = d.getVFov() / 2, e = 180 * Math.atan(E / v * Math.tan(a * Math.PI / 180)) / Math.PI, 2 * a > ka - Ya && (a = (ka - Ya) / 2), d.setVFov(2 * a), 90 > ka ? w + a > ka && (w = ka - a) : w > ka && (w = ka), -90 < Ya ? w - a < Ya && (w = Ya + a) : w < Ya && (w = Ya), 359.99 > hb - Qb) { b = 0; if (0 != w) { var f = v / 2, c = f * Math.tan(a * Math.PI / 180), f = f / Math.tan(Math.abs(w) * Math.PI / 180), f = f - c; 0 < f && (b = 180 * Math.atan(1 / (f / c)) / Math.PI, b = b * (hb - Qb) / 360) } D + (e + b) > hb && (D = hb - (e + b), sa && (Gb = -Gb, N = 0)); D - (e + b) < Qb && (D = Qb + (e + b), sa && (Gb = -Gb, N = 0)); 90 < w + a && (w = 90 - a); -90 > w - a && (w = -90 + a) } } function le(e, a) { var b = -1; if (0 <= t.mode) for (var c = 0; c < J.length; c++) { var d = J[c]; "poly" == d.type && d.Ba && 0 < d.Ba.length && ff(d.Ba, e, a) && (b = c, d.X = e, d.R = a) } return 0 <= b ? J[b] : !1 } function ff(e, a, b) { var c, d, p = !1; c = 0; for (d = e.length - 1; c < e.length; d = c++) { var h = e[c]; d = e[d]; h.R > b != d.R > b && a < (d.X - h.X) * (b - h.R) / (d.R - h.R) + h.X && (p = !p) } return p } function Ke(e) { if (d.ya) { a.useProgram(Q); a.bindBuffer(a.ARRAY_BUFFER, Ka); a.vertexAttribPointer(Q.u, Ka.oa, a.FLOAT, !1, 0, 0); a.bindBuffer(a.ARRAY_BUFFER, xb); a.vertexAttribPointer(Q.N, 2, a.FLOAT, !1, 0, 0); a.activeTexture(a.TEXTURE0); a.bindTexture(a.TEXTURE_2D, Tb); var g = 1 + (S - 1) * e, b = a.getUniformLocation(Q, "uAlpha"); a.uniform1f(b, 1); b = a.getUniformLocation(Q, "uZoomIn"); a.uniform1i(b, !0); var b = a.getUniformLocation(Q, "uZoomCenter"), c = .5 + ($c - .5) * Math.sqrt(e), f = .5 + (ad - .5) * Math.sqrt(e); 0 > c - .5 / g && (c = .5 / g); 0 > f - .5 / g && (f = .5 / g); 1 < c + .5 / g && (c = 1 - .5 / g); 1 < f + .5 / g && (f = 1 - .5 / g); a.uniform2f(b, c, f); c = a.getUniformLocation(Q, "uZoomFactor"); a.uniform1f(c, g); a.uniform1i(a.getUniformLocation(Q, "uSampler"), 0); a.drawArrays(a.TRIANGLE_STRIP, 0, Ka.Aa); a.useProgram(H) } else { d.updatePanorama(); a.blendFuncSeparate(a.SRC_ALPHA, a.ONE_MINUS_SRC_ALPHA, a.SRC_ALPHA, a.ONE); a.enable(a.BLEND); a.disable(a.DEPTH_TEST); c = .5 + ($c - .5); f = .5 + (ad - .5); 0 > c - .5 / S && (c = .5 / S); 0 > f - .5 / S && (f = .5 / S); 1 < c + .5 / S && (c = 1 - .5 / S); 1 < f + .5 / S && (f = 1 - .5 / S); if ("crossdissolve" == da) a.useProgram(Q), a.bindBuffer(a.ARRAY_BUFFER, Ka), a.vertexAttribPointer(Q.u, Ka.oa, a.FLOAT, !1, 0, 0), a.bindBuffer(a.ARRAY_BUFFER, xb), a.vertexAttribPointer(Q.N, 2, a.FLOAT, !1, 0, 0), a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, Tb), b = a.getUniformLocation(Q, "uAlpha"), a.uniform1f(b, 1 - e), b = a.getUniformLocation(Q, "uZoomIn"), a.uniform1i(b, 1 == qa || 2 == qa), b = a.getUniformLocation(Q, "uZoomCenter"), a.uniform2f(b, c, f), c = a.getUniformLocation(Q, "uZoomFactor"), a.uniform1f(c, S), a.uniform1i(a.getUniformLocation(Q, "uSampler"), 0); else if ("diptocolor" == da) a.useProgram(la), a.bindBuffer(a.ARRAY_BUFFER, Ka), a.vertexAttribPointer(la.u, Ka.oa, a.FLOAT, !1, 0, 0), a.bindBuffer(a.ARRAY_BUFFER, xb), a.vertexAttribPointer(la.N, 2, a.FLOAT, !1, 0, 0), a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, Tb), g = a.getUniformLocation(la, "uColorPercent"), b = Math.min(2 * e, 1), a.uniform1f(g, b), b = a.getUniformLocation(la, "uAlpha"), e = Math.max(2 * (e - .5), 0), a.uniform1f(b, 1 - e), a.uniform3f(a.getUniformLocation(la, "uDipColor"), (Md >> 16 & 255) / 255, (Md >> 8 & 255) / 255, (Md & 255) / 255), b = a.getUniformLocation(la, "uZoomIn"), a.uniform1i(b, 1 == qa || 2 == qa), b = a.getUniformLocation(la, "uZoomCenter"), a.uniform2f(b, c, f), c = a.getUniformLocation(la, "uZoomFactor"), a.uniform1f(c, S), a.uniform1i(a.getUniformLocation(la, "uSampler"), 0); else if ("irisround" == da || "irisrectangular" == da) { a.useProgram(aa); a.bindBuffer(a.ARRAY_BUFFER, Ka); a.vertexAttribPointer(aa.u, Ka.oa, a.FLOAT, !1, 0, 0); a.bindBuffer(a.ARRAY_BUFFER, xb); a.vertexAttribPointer(aa.N, 2, a.FLOAT, !1, 0, 0); a.activeTexture(a.TEXTURE0); a.bindTexture(a.TEXTURE_2D, Tb); 1 == qa || 2 == qa ? b = g = .5 : (g = $c, b = ad); var p = g * a.aa, h = b * a.$, p = Math.max(p, a.aa - p), h = Math.max(h, a.$ - h); "irisround" == da ? a.uniform1f(a.getUniformLocation(aa, "uRadius"), Math.sqrt(p * p + h * h) * e) : (p > h ? h = p / (a.aa / a.$) : p = a.aa / a.$ * h, a.uniform2f(a.getUniformLocation(aa, "uRectDim"), p * e, h * e)); a.uniform1i(a.getUniformLocation(aa, "uRound"), "irisround" == da); a.uniform2f(a.getUniformLocation(aa, "uIrisCenter"), g * a.aa, b * a.$); b = a.getUniformLocation(aa, "uZoomIn"); a.uniform1i(b, 1 == qa || 2 == qa); b = a.getUniformLocation(aa, "uZoomCenter"); a.uniform2f(b, c, f); c = a.getUniformLocation(aa, "uZoomFactor"); a.uniform1f(c, S); a.uniform1i(a.getUniformLocation(aa, "uSampler"), 0) } else if ("wipeleftright" == da || "wiperightleft" == da || "wipetopbottom" == da || "wipebottomtop" == da || "wiperandom" == da) a.useProgram(ma), a.bindBuffer(a.ARRAY_BUFFER, Ka), a.vertexAttribPointer(ma.u, Ka.oa, a.FLOAT, !1, 0, 0), a.bindBuffer(a.ARRAY_BUFFER, xb), a.vertexAttribPointer(ma.N, 2, a.FLOAT, !1, 0, 0), a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, Tb), a.uniform1f(a.getUniformLocation(ma, "uPercent"), 3 > ye ? e * a.aa : e * a.$), a.uniform1i(a.getUniformLocation(ma, "uDirection"), ye), a.uniform2f(a.getUniformLocation(ma, "uCanvasDimensions"), a.aa, a.$), b = a.getUniformLocation(ma, "uZoomIn"), a.uniform1i(b, 1 == qa || 2 == qa), b = a.getUniformLocation(ma, "uZoomCenter"), a.uniform2f(b, c, f), c = a.getUniformLocation(ma, "uZoomFactor"), a.uniform1f(c, S), a.uniform1i(a.getUniformLocation(ma, "uSampler"), 0); a.drawArrays(a.TRIANGLE_STRIP, 0, Ka.Aa); a.useProgram(H); a.disable(a.BLEND); a.enable(a.DEPTH_TEST) } } function M(e, a) { e = Number(e); isNaN(a) && (a = 0); 0 > a && (a = 0); 1 < a && (a = 1); return "rgba(" + (e >> 16 & 255) + "," + (e >> 8 & 255) + "," + (e & 255) + "," + a + ")" } function pf() { var e, a = new Ga(0, 0, -100), b = d.Ga(), c, f, h; f = 100 / y; h = l.width / l.height; c = v * f * h; f *= v; for (var k = 0; k < J.length; k++) { var n = J[k], q, m; "point" == n.type && (m = !1, 2 == ac ? (e = (D - n.pan) / 100 / h * c, q = (w - n.tilt) / 100 * f, Math.abs(e) < E / 2 + 500 && Math.abs(q) < v / 2 + 500 && (m = !0)) : (a.K(0, 0, -100), a.D(-n.tilt * Math.PI / 180), a.L(n.pan * Math.PI / 180), a.L(-D * Math.PI / 180), a.D(w * Math.PI / 180), a.Y(ya * Math.PI / 180), .01 > a.z ? (q = -b / a.z, e = a.x * q, q *= a.y, Math.abs(e) < E / 2 + 500 && Math.abs(q) < v / 2 + 500 && (m = !0)) : q = e = 0), n.X = e + E / 2, n.R = q + v / 2, n.obj && n.obj.__div && ("none" != n.obj.__div.style[tb] && (n.obj.__div.style[tb] = "none"), n.obj.ggUse3d ? (Ib || jf(b), n.obj.__div.style.width = "1px", n.obj.__div.style.height = "1px", e = "", Ib && (e += "perspective(" + b + "px) "), e += "translate3d(0px,0px," + b + "px) ", e += "rotateZ(" + ya.toFixed(10) + "deg) ", e += "rotateX(" + w.toFixed(10) + "deg) ", e += "rotateY(" + (-D).toFixed(10) + "deg) ", e += "rotateY(" + n.pan.toFixed(10) + "deg) ", e += "rotateX(" + (-n.tilt).toFixed(10) + "deg) ", e += "translate3d(0px,0px," + (-1 * n.obj.gg3dDistance).toFixed(10) + "px) ", n.obj.__div.style[La + "Origin"] = "0% 0%", n.obj.__div.style[La] = e, n.obj.__div.style.left = Ba + E / 2 + "px", n.obj.__div.style.top = ua + v / 2 + "px") : !m || d.Ka || d.ya ? (n.obj.__div.style.left = "-1000px", n.obj.__div.style.top = "-1000px") : (n.obj.__div.style.left = Ba + e + E / 2 + "px", n.obj.__div.style.top = ua + q + v / 2 + "px"))); if ("poly" == n.type) { var t = []; if (2 == ac) for (n.Ba = [], m = 0; m < n.Ea.length; m++) q = n.Ea[m], e = (D - q.pan) / 100 / h * c, q = (w - q.tilt) / 100 * f, e += Ba + E / 2, q += ua + v / 2, n.Ba.push({ X: e, R: q }); else { for (m = 0; m < n.Ea.length; m++) q = n.Ea[m], a.K(0, 0, -100), a.D(-q.tilt * Math.PI / 180), a.L(q.pan * Math.PI / 180), a.L(-D * Math.PI / 180), a.D(w * Math.PI / 180), a.Y(ya * Math.PI / 180), t.push(a.clone()); t = pe(t); if (0 < t.length) for (m = 0; m < t.length; m++) a = t[m], .1 > a.z ? (q = -b / a.z, e = E / 2 + a.x * q, q = v / 2 + a.y * q) : q = e = 0, a.X = e, a.R = q; n.Ba = t } } } } function jf(e) { Ib || d.ac == e || (d.ac = e, oa.style[pc] = e + "px", oa.style[pc + "Origin"] = Ba + E / 2 + "px " + (ua + v / 2) + "px ", C.style[pc] = e + "px", C.style[pc + "Origin"] = Ba + E / 2 + "px " + (ua + v / 2) + "px ") } function pe(e) { e = bd(e, qf); e = bd(e, rf); e = bd(e, sf); e = bd(e, tf); return e = bd(e, uf) } function bd(e, a) { if (0 == e.length) return e; var b, c, d, h, l, k, n, m; m = []; b = a.lb(e[0]) - 0; for (h = 0; h < e.length; h++) { k = h; n = h + 1; n == e.length && (n = 0); c = a.lb(e[n]) - 0; if (0 <= b && 0 <= c) m.push(e[k]); else if (0 <= b || 0 <= c) d = c / (c - b), 0 > d && (d = 0), 1 < d && (d = 1), l = new Ga, l.wa(e[k], e[n], d), 0 > b || m.push(e[k]), m.push(l); b = c } return m } function Zc() { var e = { x: 0, y: 0 }, a = C; if (a.offsetParent) { do e.x += a.offsetLeft, e.y += a.offsetTop; while (a = a.offsetParent) } return e } function Ac() { d.setViewerSize(d.Fa.offsetWidth, d.Fa.offsetHeight) } function Qf() { oc = !0 } function Dd(a) { var d = document.getElementById("debug"); d && (d.innerHTML = a + "
"); window.console && window.console.log(a) } function Rf(a, d) { var b = this; b.Kb = a; b.hotspot = d; b.__div = document.createElement("div"); b.f = document.createElement("img"); var c; c = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA5xJREFUeNqclmlIVFEUx997TjrplFQW2WKBBSYtRFlpWU"; c += "ILSSsRZRQIBdGHCFqIoKIvQRsUFRJC9LEgaSFbMMpcWi1pLzOLsjItKms0U5t5/c/wH7nc5"; c += "o2jF374xrv87z33nHOPaRsRtbFgDpgJxoD+wATfwDNQDK6CyrCr5OcbhgiGIRsUAZt4QTWo"; c += "IFXgp9JfAhY7rgdBl8NeBoLDYBloA+dBOagFTcDHcVEgDgwBGWA+OAcugvXgvb5wKMGJoAA"; c += "Mp9BpUA96EBf/Btsf8BI8AWfAErAcpHHDZeriliY2AVwDg8AucAQ0Ag+I4XhTm2Oxz8PT46"; c += "KMbTx5EZjuJDgAnAVusJUm9DhYwalFcc59sIXXIaceFkowDySBPTRPL20xm+b7zYXa+N3CP"; c += "rWJ6GuwGySA40HLBHc/GywFhbS5R1lEBrZy7FQwiSaX9pmnqeAYt+KUcew7BVZw/QKTq0oc"; c += "pYPVvDOXItZCk2xgDIZqL8BR8Ab0VDbr4yZOgLeIwzQx6WiQxcCt1+6sld66L4yYtFSwF4y"; c += "g2dU7/cEwGW9YVkAwmycp1dzdpvgm0DcCh4kHmxWzBls0uBX4qqmZJ4KzePm1IeJLgjmlC1"; c += "6aDKZpp5Q168B3o6wsSwTHgU+MIUs74RSj6y1d+212HKimJlUE+tFRfJpYtOKNXWmJTASqW"; c += "f2Bu/R6+4TKHOrOzG4IhptjWgHbGkZvepQ6SQK7oRuCXzjX1DJavBEX1ygfT8FgBqpfm1zR"; c += "DcEKbR2bsZlkJCdXieB1ZhZ5YtqVgXIPN+m9kbY6hpdb+d9fPncJRmZmqQheZkemJmgxyxy"; c += "kl3XWJEkcAl7N21s7PDcl5ZJ0PAa3wVwmWtVbZafPwQ7wLozYB7ATPNJO56d/LAikP9u+66"; c += "KNJS1d4IOZp7wU0hfLukUyzgwm70T2N/DOxIy/eFdqawa5DL2NEGwP5k15Ja4woz9glvcom"; c += "d9NzyvkFcQo5gomaLfm5c0svnKZ2k7q7+FauvR2MJKZR3+sY5WgtvkdG6JyELGhNHMTXyGf"; c += "LviRJ5Tcd4Dlhle7086Sgp8CqVxDkn4OqHaqacr5ekjy3Q/W0FRNNGmoMtamdzdxsytZC0l"; c += "qXKhEgWPVVgImg2NgFT1MHOoOk3yLEtgWN5TEOYvoIFI1rGM19//2wpAD7imF7lfwENwAxa"; c += "ASNCj90pcLLKdC2Iyw1M9gnEplMEp5kOU1f8WwKGJm8oUr9f8JMAAVMDM6HSDa9QAAAABJR"; c += "U5ErkJggg%3D%3D"; b.f.setAttribute("src", c); b.f.setAttribute("style", "position: absolute;top: -14px;left: -14px; " + va + "user-select: none;"); b.f.ondragstart = function () { return !1 }; b.__div.appendChild(b.f); c = "position:absolute;" + (va + "user-select: none;"); c += va + "touch-callout: none;"; c += va + "tap-highlight-color: rgba(0,0,0,0);"; cd && !pa && (c += va + "transform: translateZ(9999999px);"); b.__div.setAttribute("style", c); b.__div.onclick = function () { b.Kb.hotspot = d; b.Kb.openUrl(d.url, d.target) }; var f = t.vb; f.enabled && (b.text = document.createElement("div"), c = "position:absolute;" + ("left: -" + d.w / 2 + "px;"), c += "top:\t 20px;", c += "width: " + d.w + "px;", c = 0 == d.h ? c + "height: auto;" : c + ("height: " + d.h + "px;"), d.wordwrap ? (c += "white-space: pre-wrap;", c += "width: " + d.w + "px;") : (c = 0 == d.h ? c + "width: auto;" : c + ("width: " + d.w + "px;"), c += "white-space: nowrap;"), c += va + "transform-origin: 50% 50%;", c += "visibility: hidden;", c += "border: 1px solid #000000;", c += "background-color: #ffffff;", c += "text-align: center;", c += "overflow: hidden;", c += "padding: 0px 1px 0px 1px;", b.text.setAttribute("style", c), b.text.style.color = M(f.wb, f.ub), f.background ? b.text.style.backgroundColor = M(f.U, f.ba) : b.text.style.backgroundColor = "transparent", b.text.style.border = "solid " + M(f.V, f.ca) + " " + f.nb + "px", b.text.style.borderRadius = f.mb + "px", b.text.style.textAlign = "center", b.text.style.width = 0 < f.width ? f.width + "px" : "auto", b.text.style.height = 0 < f.height ? f.height + "px" : "auto", b.text.style.overflow = "hidden", b.text.innerHTML = d.title, b.__div.onmouseover = function () { 0 == d.h && (b.text.style.left = -b.text.offsetWidth / 2 + "px"); b.text.style.visibility = "inherit" }, b.__div.onmouseout = function () { b.text.style.visibility = "hidden" }, b.__div.appendChild(b.text)) } var d = this; d.transitionsDisabled = !1; var D = 0, ze = 0, Qb = 0, hb = 360, N = 0, Ae = 0, w = 0, Be = 0, Ya = -90, ka = 90, ea = 0, ya = 0, Rc = 0, y = 90, xd = 90, Na = 1, xe = 0, ta = 170, wb = 0, ca = 0, Ce = 0, We = 0, Ve = 0, Ca = { Da: 0, pitch: 0 }, E = 10, v = 10, ac = 0, bf = 0, cf = 0, Xb = 0, mb = 0, df = 0, ef = 0, qe = 0, re = 0, Nc = 0, Oc = 0, ra = -1, ne = 0, Qe = 0, Re = 0, Xc = 0, Yc = 0, Se = 0, Te = 0, ae = !0, nd = 0, od = 0, Ja = 0, ub = 0, Pc = !1, R = 0, dd = [], Nd = 4, Ic = !1, Cd = !1, ed = "loop", z = null, Vc = null, te = null, Id = null, ue = null, Oe = 0, Db = 0, C = null, Oa = null, zb = null, oa = d.l = null, Da = null, Jb = null; d.control = null; d.checkLoaded = []; d.isFullscreen = !1; d.dirty = !1; d.gb = 1; d.divSkin = null; d.isLoaded = !1; d.hasConfig = !1; d.Sa = !1; d.Ka = !1; d.ya = !1; d.Qa = !1; d.rc = !1; d.startNode = ""; d.xa = ""; d.onMoveComplete = null; var pd = 0, Jd = [], vc = [], yb = 1, fd = 1, gd = 1024, Od = !1, vf = 0, De = 0, vb = !1, vd = 5, sa = !1, qd = !1, Gb = .4, wd = 0, ge = 0, fe = !0, He = !1, Fb = 0, Eb = 0, uc = !1, ee = .1, rd = 0, sd = 0, td = 0, de = 70, ud = !1, Le = 1, Md = 0, da = "crossdissolve", qa = 0, Wa = 0, Pd = 5, Uc = 1, yd = !1, he = 0, zd = 0, Ad = 0, Bd = 70, Ie = 0, Je = 1, S = 1, $c = .5, ad = .5, Ne = !1, Me = !1, Tc = !1, ye = 1, nc = !1, bb = 2, wf = !1, xf, yf, Sc, B; d.skinObj = null; d.userdata = {}; d.userdata.title = ""; d.userdata.description = ""; d.userdata.author = ""; d.userdata.datetime = ""; d.userdata.copyright = ""; d.userdata.source = ""; d.userdata.information = ""; d.userdata.comment = ""; d.userdata.tags = []; var J = []; d.emptyHotspot = { pan: 0, tilt: 0, title: "", description: "", url: "", target: "", id: "", skinid: "", w: 100, h: 20, wordwrap: !1, obj: null, type: "empty" }; var G = [], Kc = [], F = [], Ua = [], hd = [], qc = [], ia = [], Rb = [], P = 1, id = {}; d.addListener = function (a, d) { (id[a] = id[a] || []).push(d) }; d.Ob = function (a, d) { var b = id[a]; if (b) for (var c = 0, f = b.length; c < f; c++) b[c].apply(null, d) }; d.removeEventListener = function (a, d) { var b = id[a]; if (b) for (var c = 0, f = b.length; c < f; c++) if (b[c] == d) { 1 == f ? delete id[a] : b.splice(c, 1); break } }; try { d.j = new (window.AudioContext || window.webkitAudioContext) } catch (Tf) { d.j = null } var l = { i: [], Pa: "0x000000", Lb: !1, Ib: .4, o: 512, P: 1, Gb: 0, Jb: "", width: 0, height: 0 }, Ba = 0, ua = 0, zf = 0, Af = 0, Wc = !1, be = !1, V = !1, oe = !1, Va = !0, $e = !1, af = 1, me = !0, ld = !0, kd = !1, Cb = 8, Lc = [], t = { mode: 1, Za: -1, A: 0, I: 0, fb: .05, V: 255, ca: 1, U: 255, ba: .3, vb: { enabled: !0, width: 180, height: 20, wb: 0, ub: 1, background: !0, U: 16777215, ba: 1, V: 0, ca: 1, mb: 3, nb: 1, wordwrap: !0 } }; d.hotspot = d.emptyHotspot; var X = null; d.ta = !0; d.mouse = { x: 0, y: 0 }; var pa = !1, $b = !1, Qc = !1, Qd = !0, Bf = !1, Rd = !0, ke = !1, ja = 0, Sd = 5, Cf = 200, Hb = "", va = "", tb = "transition", La = "transform", pc = "perspective", a, qf = new Ga, rf = new Ga, sf = new Ga, tf = new Ga, uf = new Ga; d.ib = !1; var Ha = "", Xd = [], jd; jd = []; var $a; $a = function () { }; var Sf = navigator.userAgent.match(/(MSIE)/g) ? !0 : !1, cd = navigator.userAgent.match(/(Safari)/g) ? !0 : !1; navigator.userAgent.match(/(Chrome)/g) && (cd = !1); var Df = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? !0 : !1, Ef = navigator.userAgent.match(/(android)/i) ? !0 : !1, ie = !1; if (Df || Ef) Sd = 2; cd && (d.j = null); var je; (function () { je = function () { var a = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame; return a ? a : function (a) { window.setTimeout(a, 10) } }() })(); d.detectBrowser = function () { var a = ["Webkit", "Moz", "O", "ms", "Ms"], g; va = ""; tb = "transition"; La = "transform"; pc = "perspective"; for (g = 0; g < a.length; g++) "undefined" !== typeof document.documentElement.style[a[g] + "Transform"] && (va = "-" + a[g].toLowerCase() + "-", tb = a[g] + "Transition", La = a[g] + "Transform", pc = a[g] + "Perspective"); Bf = Wd(); pa = Fe(); $b = Wd(); pa && ($b = !1); Ib = !0; Jc = !1; (Df || Ef) && d.setMaxTileCount(); Dd("Pano2VR player - Prefix:" + va + ", " + (Bf ? "CSS 3D available" : "CSS 3D not available") + ", " + (pa ? "WebGL available" : "WebGL not available")) }; d.setMaxTileCount = function () { Cf = 80 }; d.O = new Hf; d.setElementIdPrefix = function (a) { d.Na = a }; d.getPercentLoaded = function () { return pd }; d.setBasePath = function (a) { Hb = a }; d.Ga = function () { return 1 * v / (2 * Math.tan(Math.PI / 180 * (d.getVFov() / 2))) }; d.setViewerSize = function (e, g) { d.isFullscreen && (e = window.innerWidth, g = window.innerHeight); var b = e - Ba - zf, c = g - ua - Af; if (!(10 > b || 10 > c)) { var f = window.devicePixelRatio || 1; Od && (f = 1); C.style.width = b + "px"; C.style.height = c + "px"; C.style.left = Ba + "px"; C.style.top = ua + "px"; if (pa) try { Oa && (Oa.style.position = "absolute", Oa.style.display = "inline", Oa.style.width = b + "px", Oa.style.height = c + "px", Oa.width = b * f, Oa.height = c * f), a && (a.aa = b * f, a.$ = c * f, a.viewport(0, 0, a.drawingBufferWidth, a.drawingBufferHeight)) } catch (h) { alert(h) } zb && (zb.style.width = e + "px", zb.style.height = g + "px", zb.width = e, zb.height = g); oa && (oa.style.width = e + "px", oa.style.height = g + "px", Da.style.width = e + "px", Da.style.height = g + "px", Da.width = e, Da.height = g, Da.style.left = Ba + "px", Da.style.top = ua + "px", d.divSkin && d.divSkin != oa && (d.divSkin.style.width = e + "px", d.divSkin.style.height = g + "px")); Jb.style.width = e + "px"; Jb.style.height = g + "px"; Jb.width = e; Jb.height = g; Jb.style.left = Ba + "px"; Jb.style.top = ua + "px"; d.hasConfig && d.updatePanorama(); b = parseInt(C.offsetWidth); c = parseInt(C.offsetHeight); if (E != b || v != c) E = b, v = c; d.divSkin && d.divSkin.ggUpdateSize && d.divSkin.ggUpdateSize(e, g) } }; var oc = !1; d.getViewerSize = function () { var a = {}; a.width = E; a.height = v; return a }; d.setMargins = function (a, d, b, c) { Ba = a; ua = d; zf = b; Af = c; oc = !0 }; d.changeViewMode = function (a) { 0 == a && (Va = !1); 1 == a && (Va = !0); 2 == a && (Va = Va ? !1 : !0) }; d.viewMode = function () { return 1 == Va ? 1 : 0 }; d.changePolygonMode = function (a, g) { t.mode = 1 == g && 0 < t.mode ? 0 : Math.round(a); d.update() }; d.polygonMode = function () { return t.mode }; d.changeViewState = function () { }; d.viewState = function () { return 0 }; d.getCurrentPointHotspots = function () { for (var a = [], d = 0; d < J.length; d++) { var b = J[d]; "point" == b.type && b.obj && b.obj.__div && a.push(b.obj.__div) } return a }; var K, I, ob = [], pb = [], qb = []; (function () { var a = [], d = [], b = [], c = { b: 14, alpha: .2, color: 11390415, a: .27 }; a.push(c); c = { b: 20, alpha: .25, color: 11390415, a: .4 }; a.push(c); c = { b: 10, alpha: .2, color: 12442332, a: .6 }; a.push(c); c = { b: 15, alpha: .2, color: 11390415, a: .8 }; a.push(c); c = { b: 10, alpha: .2, color: 12442332, a: 1.5 }; a.push(c); c = { b: 15, alpha: .2, color: 11390415, a: 1.8 }; a.push(c); c = { b: 8, alpha: .2, color: 12575203, c: .8, a: .7 }; d.push(c); c = { b: 7, alpha: .4, color: 12575203, c: .5, a: 1.6 }; d.push(c); c = { b: 5, alpha: .4, color: 12575203, c: .6, a: .9 }; d.push(c); c = { b: 8, alpha: .3, color: 12575203, c: .4, a: 1.1 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 30, alpha: .3, color: 11390415, a: .5 }; a.push(c); c = { b: 10, alpha: .3, color: 11390415, a: 1 }; a.push(c); c = { b: 20, alpha: .3, color: 11390415, a: 1.3 }; a.push(c); c = { b: 10, alpha: .3, color: 11390415, a: 1.5 }; a.push(c); c = { b: 15, alpha: .3, color: 11390415, a: 1.8 }; a.push(c); c = { b: 10, alpha: .3, color: 15506856, c: .8, a: .7 }; d.push(c); c = { b: 20, alpha: .5, color: 15506856, c: .5, a: 1.6 }; d.push(c); c = { b: 5, alpha: .5, color: 15506856, c: .6, a: .9 }; d.push(c); c = { b: 60, alpha: .4, color: 15506856, c: .2, a: 1.1 }; d.push(c); b.push({ b: 220, alpha: .035, a: 2 }); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 30, alpha: .5, color: 15465727, a: .5 }; a.push(c); c = { b: 40, alpha: .28, color: 15726842, a: .8 }; a.push(c); c = { b: 25, alpha: .32, color: 15726842, a: 1.1 }; a.push(c); c = { b: 15, alpha: .25, color: 15726842, a: 1.35 }; a.push(c); c = { b: 10, alpha: .28, color: 15465727, a: 1.65 }; a.push(c); c = { b: 10, alpha: .45, color: 15465727, c: .8, a: .7 }; d.push(c); c = { b: 7, alpha: .5, color: 15465727, c: .4, a: .9 }; d.push(c); c = { b: 40, alpha: .4, color: 15465727, c: .3, a: .38 }; d.push(c); c = { b: 50, alpha: .4, color: 15465727, c: .5, a: 1.25 }; d.push(c); c = { b: 18, alpha: .2, color: 15465727, c: .5, a: 1.25 }; d.push(c); c = { b: 10, alpha: .34, color: 15726842, c: .8, a: 1.5 }; d.push(c); c = { b: 38, alpha: .37, color: 15465727, c: .3, a: -.5 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 16, alpha: .5, color: 16363159, a: .1 }; a.push(c); c = { b: 26, alpha: .3, color: 16091819, a: .32 }; a.push(c); c = { b: 29, alpha: .2, color: 16091819, a: 1.32 }; a.push(c); c = { b: 20, alpha: .18, color: 16363159, a: 1.53 }; a.push(c); c = { b: 27, alpha: .13, color: 16425092, a: 1.6 }; a.push(c); c = { b: 20, alpha: .1, color: 16091819, a: 1.75 }; a.push(c); c = { b: 12, alpha: .45, color: 16312238, c: .45, a: .2 }; d.push(c); c = { b: 8, alpha: .25, color: 16434209, c: .7, a: .33 }; d.push(c); c = { b: 9, alpha: .25, color: 16091819, c: .4, a: .7 }; d.push(c); c = { b: 7, alpha: .2, color: 16091819, c: .4, a: .85 }; d.push(c); c = { b: 60, alpha: .23, color: 16091819, c: .55, a: 1.05 }; d.push(c); c = { b: 37, alpha: .1, color: 16091819, c: .55, a: 1.22 }; d.push(c); c = { b: 10, alpha: .25, color: 16363159, c: .65, a: 1.38 }; d.push(c); c = { b: 7, alpha: .2, color: 16434209, c: .5, a: 1.45 }; d.push(c); c = { b: 3, alpha: .2, color: 16416033, c: .5, a: 1.78 }; d.push(c); c = { b: 6, alpha: .18, color: 16434209, c: .45, a: 1.9 }; d.push(c); c = { b: 4, alpha: .14, color: 16766514, c: .45, a: 2.04 }; d.push(c); c = { b: 30, alpha: .14, color: 16766514, c: .8, a: .04 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 9, alpha: .3, color: 14346999, c: .3, a: .3 }; d.push(c); c = { b: 5, alpha: .5, color: 14148072, c: .8, a: .6 }; d.push(c); c = { b: 3, alpha: .37, color: 14346999, c: .66, a: .8 }; d.push(c); c = { b: 45, alpha: .2, color: 14346999, c: .36, a: 1.2 }; d.push(c); c = { b: 13, alpha: .2, color: 14346999, c: .36, a: 1.23 }; d.push(c); c = { b: 11, alpha: .2, color: 14148072, c: .36, a: 1.28 }; d.push(c); c = { b: 27, alpha: .16, color: 14346999, c: .36, a: 1.55 }; d.push(c); c = { b: 6, alpha: .36, color: 14148072, c: .8, a: 1.7 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 24, alpha: .2, color: 15186464, a: .2 }; a.push(c); c = { b: 7, alpha: .26, color: 15186464, a: .35 }; a.push(c); c = { b: 23, alpha: .18, color: 15186464, a: .65 }; a.push(c); c = { b: 13, alpha: .2, color: 15186464, a: .8 }; a.push(c); c = { b: 11, alpha: .15, color: 15186464, a: 1.4 }; a.push(c); c = { b: 15, alpha: .11, color: 15451904, a: 1.6 }; a.push(c); c = { b: 6, alpha: .45, color: 15579138, c: .45, a: .22 }; d.push(c); c = { b: 3, alpha: .3, color: 15451904, c: .25, a: .4 }; d.push(c); c = { b: 4, alpha: .2, color: 15451904, c: .25, a: .45 }; d.push(c); c = { b: 65, alpha: .17, color: 15186464, c: .25, a: .5 }; d.push(c); c = { b: 5, alpha: .45, color: 15579138, c: .45, a: .88 }; d.push(c); c = { b: 140, alpha: .18, color: 15579138, c: .32, a: .95 }; d.push(c); c = { b: 12, alpha: .22, color: 15579138, c: .32, a: 1.1 }; d.push(c); c = { b: 8, alpha: .32, color: 15451904, c: .72, a: 1.2 }; d.push(c); c = { b: 55, alpha: .2, color: 15451904, c: .45, a: 1.33 }; d.push(c); c = { b: 4, alpha: .3, color: 15451904, c: .25, a: 1.42 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 16, alpha: .4, color: 10933495, a: .32 }; a.push(c); c = { b: 14, alpha: .3, color: 11007484, a: .36 }; a.push(c); c = { b: 10, alpha: .3, color: 4037331, a: .58 }; a.push(c); c = { b: 14, alpha: .22, color: 8835068, a: .68 }; a.push(c); c = { b: 10, alpha: .27, color: 11007484, a: .82 }; a.push(c); c = { b: 11, alpha: .27, color: 10867450, a: 1 }; a.push(c); c = { b: 9, alpha: .2, color: 6158332, a: 1.05 }; a.push(c); c = { b: 10, alpha: .17, color: 10867450, a: 1.78 }; a.push(c); c = { b: 10, alpha: .3, color: 4037331, a: -.23 }; a.push(c); c = { b: 8, alpha: .45, color: 8835068, c: .45, a: .175 }; d.push(c); c = { b: 7, alpha: .4, color: 12574715, c: .55, a: .46 }; d.push(c); c = { b: 3, alpha: .3, color: 10867450, c: .35, a: .5 }; d.push(c); c = { b: 60, alpha: .37, color: 4031699, c: .75, a: .75 }; d.push(c); c = { b: 3, alpha: .25, color: 4031699, c: .25, a: .75 }; d.push(c); c = { b: 3, alpha: .2, color: 6158332, c: .25, a: .9 }; d.push(c); c = { b: 7, alpha: .45, color: 8835068, c: .45, a: 1.3 }; d.push(c); c = { b: 32, alpha: .22, color: 8835068, c: .75, a: 1.62 }; d.push(c); c = { b: 9, alpha: .45, color: 4031699, c: .65, a: 1.6 }; d.push(c); c = { b: 8, alpha: .25, color: 4031699, c: .65, a: 1.83 }; d.push(c); c = { b: 7, alpha: .4, color: 12574715, c: .55, a: -.18 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 16, alpha: .4, color: 16389120, a: .32 }; a.push(c); c = { b: 26, alpha: .22, color: 16389120, a: .4 }; a.push(c); c = { b: 26, alpha: .25, color: 16389120, a: .65 }; a.push(c); c = { b: 18, alpha: .3, color: 16389120, a: 1.23 }; a.push(c); c = { b: 14, alpha: .26, color: 16389120, a: 1.33 }; a.push(c); c = { b: 17, alpha: .18, color: 16389120, a: 1.7 }; a.push(c); c = { b: 30, alpha: .16, color: 16389120, a: 2.15 }; a.push(c); c = { b: 100, alpha: .25, color: 16389120, c: .22, a: 1.45 }; d.push(c); c = { b: 7, alpha: .5, color: 15628151, c: .3, a: 1.5 }; d.push(c); c = { b: 3, alpha: .5, color: 15628151, c: .3, a: 1.52 }; d.push(c); c = { b: 4, alpha: .5, color: 16389120, c: .3, a: 1.745 }; d.push(c); c = { b: 9, alpha: .22, color: 16389120, c: .3, a: 1.8 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 16, alpha: .4, color: 10933495, a: .32 }; a.push(c); c = { b: 14, alpha: .3, color: 11007484, a: .36 }; a.push(c); c = { b: 10, alpha: .3, color: 4037331, a: .58 }; a.push(c); c = { b: 14, alpha: .22, color: 8835068, a: .68 }; a.push(c); c = { b: 10, alpha: .27, color: 11007484, a: .82 }; a.push(c); c = { b: 11, alpha: .27, color: 10867450, a: 1 }; a.push(c); c = { b: 9, alpha: .2, color: 6158332, a: 1.05 }; a.push(c); c = { b: 10, alpha: .17, color: 10867450, a: 1.78 }; a.push(c); c = { b: 10, alpha: .3, color: 4037331, a: -.23 }; a.push(c); c = { b: 8, alpha: .45, color: 8835068, c: .45, a: .175 }; d.push(c); c = { b: 7, alpha: .4, color: 12574715, c: .55, a: .46 }; d.push(c); c = { b: 3, alpha: .3, color: 10867450, c: .35, a: .5 }; d.push(c); c = { b: 60, alpha: .37, color: 4031699, c: .75, a: .75 }; d.push(c); c = { b: 3, alpha: .25, color: 4031699, c: .25, a: .75 }; d.push(c); c = { b: 3, alpha: .2, color: 6158332, c: .25, a: .9 }; d.push(c); c = { b: 7, alpha: .45, color: 8835068, c: .45, a: 1.3 }; d.push(c); c = { b: 32, alpha: .22, color: 8835068, c: .75, a: 1.62 }; d.push(c); c = { b: 9, alpha: .45, color: 4031699, c: .65, a: 1.6 }; d.push(c); c = { b: 8, alpha: .25, color: 4031699, c: .65, a: 1.83 }; d.push(c); c = { b: 7, alpha: .4, color: 12574715, c: .55, a: -.18 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 16, alpha: .4, color: 16389120, a: .32 }; a.push(c); c = { b: 26, alpha: .22, color: 16389120, a: .4 }; a.push(c); c = { b: 26, alpha: .25, color: 16389120, a: .65 }; a.push(c); c = { b: 18, alpha: .3, color: 16389120, a: 1.23 }; a.push(c); c = { b: 14, alpha: .26, color: 16389120, a: 1.33 }; a.push(c); c = { b: 17, alpha: .18, color: 16389120, a: 1.7 }; a.push(c); c = { b: 30, alpha: .16, color: 16389120, a: 2.15 }; a.push(c); c = { b: 100, alpha: .25, color: 16389120, c: .22, a: 1.45 }; d.push(c); c = { b: 7, alpha: .5, color: 15628151, c: .3, a: 1.5 }; d.push(c); c = { b: 3, alpha: .5, color: 15628151, c: .3, a: 1.52 }; d.push(c); c = { b: 4, alpha: .5, color: 16389120, c: .3, a: 1.745 }; d.push(c); c = { b: 9, alpha: .22, color: 16389120, c: .3, a: 1.8 }; d.push(c); ob.push(a); pb.push(d); qb.push(b); a = []; d = []; b = []; c = { b: 24, alpha: .2, color: 15186464, a: .2 }; a.push(c); c = { b: 7, alpha: .26, color: 15186464, a: .35 }; a.push(c); c = { b: 23, alpha: .18, color: 15186464, a: .65 }; a.push(c); c = { b: 13, alpha: .2, color: 15186464, a: .8 }; a.push(c); c = { b: 11, alpha: .15, color: 15186464, a: 1.4 }; a.push(c); c = { b: 15, alpha: .11, color: 15451904, a: 1.6 }; a.push(c); c = { b: 6, alpha: .45, color: 15579138, c: .45, a: .22 }; d.push(c); c = { b: 3, alpha: .3, color: 15451904, c: .25, a: .4 }; d.push(c); c = { b: 4, alpha: .2, color: 15451904, c: .25, a: .45 }; d.push(c); c = { b: 65, alpha: .17, color: 15186464, c: .25, a: .5 }; d.push(c); c = { b: 5, alpha: .45, color: 15579138, c: .45, a: .88 }; d.push(c); c = { b: 140, alpha: .18, color: 15579138, c: .32, a: .95 }; d.push(c); c = { b: 12, alpha: .22, color: 15579138, c: .32, a: 1.1 }; d.push(c); c = { b: 8, alpha: .32, color: 15451904, c: .72, a: 1.2 }; d.push(c); c = { b: 55, alpha: .2, color: 15451904, c: .45, a: 1.33 }; d.push(c); c = { b: 4, alpha: .3, color: 15451904, c: .25, a: 1.42 }; d.push(c); ob.push(a); pb.push(d); qb.push(b) })(); d.getVFov = function () { var a; switch (Ce) { case 0: a = y / 2; break; case 1: a = 180 * Math.atan(v / E * Math.tan(y / 2 * Math.PI / 180)) / Math.PI; break; case 2: a = 180 * Math.atan(v / Math.sqrt(E * E + v * v) * Math.tan(y / 2 * Math.PI / 180)) / Math.PI; break; case 3: a = 4 * v / 3 > E ? y / 2 : 180 * Math.atan(4 * v / (3 * E) * Math.tan(y / 2 * Math.PI / 180)) / Math.PI } return 2 * a }; d.setVFov = function (a) { a = a / 2; var d; switch (Ce) { case 0: y = 2 * a; break; case 1: a = 180 * Math.atan(E / v * Math.tan(a * Math.PI / 180)) / Math.PI; y = 2 * a; break; case 2: d = Math.sqrt(E * E + v * v); a = 180 * Math.atan(d / v * Math.tan(a * Math.PI / 180)) / Math.PI; y = 2 * a; break; case 3: 4 * v / 3 > E || (a = 180 * Math.atan(3 * E / (4 * v) * Math.tan(a * Math.PI / 180)) / Math.PI), y = 2 * a } }; d.update = function (a) { d.dirty = !0; a && (d.gb = a) }; var Ee = 0; d.updatePanorama = function () { var e = Date.now(); if (2 == ac) { Sb(); Sb(); pf(); Da.style.visibility = "inherit"; K || (K = Da.getContext("2d")); if (K.width != E || K.height != v) K.width = E, K.height = v; K.clear ? K.clear() : K.clearRect(0, 0, Da.width, Da.height); Sb(); var g, b, c; b = 100 / y; c = l.width / l.height; h = v * b * c; k = v * b; g = (D / 100 / c - .5) * h + E / 2; var f, h, k; f = (w / 100 - .5) * k + v / 2; for (var n, q, m, x, r, F = 0; l.i.length >= F + 2 && l.i[F + 1].width > h;) F++; var z, G; G = []; for (z = l.i.length - 1; z >= F;) { var u = l.i[z], B; if (u.cache) B = { W: 0, da: 0 }, B.ha = u.M - 1, B.ia = u.ja - 1; else { B = {}; var L = -f / k * (u.height / l.o), N = (-g + E) / h * (u.width / l.o), O = (-f + v) / k * (u.height / l.o); B.W = Math.min(Math.max(0, Math.floor(-g / h * (u.width / l.o))), u.M - 1); B.da = Math.min(Math.max(0, Math.floor(L)), u.ja - 1); B.ha = Math.min(Math.max(0, Math.floor(N)), u.M - 1); B.ia = Math.min(Math.max(0, Math.floor(O)), u.ja - 1) } G[z] = B; var P = !0; for (q = B.da; q <= B.ia; q++) for (n = B.W; n <= B.ha; n++) x = n + q * u.M, (r = u.s[x]) || (r = u.s[x] = {}), ja < Sd && !r.f && (De++, r.f = new Image, r.f.onload = Mf(), r.f.onerror = Ld(r), r.f.onabort = Ld(r), r.f.setAttribute("src", Kd(0, z, n, q)), u.cache && d.checkLoaded.push(r.f), 0 == ja && d.divSkin && d.divSkin.ggReLoadedLevels && d.divSkin.ggReLoadedLevels(), ja++, d.dirty = !0), r.f && r.f.complete || (P = !1), r.visible = !0; B.Hb = P; z-- } for (z = l.i.length - 1; z >= F;) { u = l.i[z]; if (G[z] && 0 <= G[z].W) for (B = G[z], q = B.da; q <= B.ia; q++) for (n = B.W; n <= B.ha; n++) x = n + q * u.M, (r = u.s[x]) || (r = u.s[x] = {}), r.f && r.f.complete && K.drawImage(r.f, g + (-l.P + l.o * n) * h / u.width, f + (-l.P + l.o * q) * k / u.height, r.f.width * h / u.width, r.f.height * k / u.height), r.visible = !0; z-- } for (var Q = 0; Q < l.i.length; Q++) if (u = l.i[Q], !u.cache) for (var U in u.s) u.s.hasOwnProperty(U) && (r = u.s[U], r.visible || (r.f = null, delete u.s[U])); if (0 < t.mode) { var X, aa = 1; 3 == t.mode && (aa = t.A); for (m = 0; m < J.length; m++) { var T = J[m]; if ("poly" == T.type) { var ea = T.Ba; 2 == t.mode && (aa = T.A); if (0 < ea.length) { K.fillStyle = M(T.U, T.ba * aa); K.strokeStyle = M(T.V, T.ca * aa); K.beginPath(); for (X = 0; X < ea.length; X++) { var ca = ea[X]; 0 == X ? K.moveTo(ca.X, ca.R) : K.lineTo(ca.X, ca.R) } K.closePath(); K.stroke(); K.fill() } } } } d.ta = !1 } else if (0 == ac) { var ia = d.Ga(), la = Math.atan2(E / 2 + 1, ia), ma = Math.atan2(v / 2 + 1, ia), oa = Math.sin(la), qa = Math.sin(ma), sa = Math.cos(la), va = Math.cos(ma); qf.K(0, 0, -1); rf.K(sa, 0, -oa); sf.K(-sa, 0, -oa); tf.K(0, va, -qa); uf.K(0, -va, -qa); pf(); if (pa) { if (Ic) { Sb(); var ra; if (E != C.offsetWidth || v != C.offsetHeight) E = parseInt(C.offsetWidth), v = parseInt(C.offsetHeight); Rd && (d.initWebGL(), Ac()); if (a) for (a.clear(a.COLOR_BUFFER_BIT | a.DEPTH_BUFFER_BIT), Hc(Kb), Vd(d.getVFov(), a.aa / a.$, Kb), a.uniformMatrix4fv(H.Oa, !1, Kb), a.bindTexture(a.TEXTURE_2D, Vc), ra = 0; 1 > ra; ra++) Hc(fa), Ud(fa, -ya * Math.PI / 180, [0, 0, 1]), Ud(fa, -w * Math.PI / 180, [1, 0, 0]), Ud(fa, (180 - D) * Math.PI / 180, [0, 1, 0]), Ca && (Ud(fa, -Ca.pitch * Math.PI / 180, [1, 0, 0]), Ud(fa, Ca.Da * Math.PI / 180, [0, 0, 1])), a.bindBuffer(a.ARRAY_BUFFER, te), a.vertexAttribPointer(H.u, 3, a.FLOAT, !1, 0, 0), a.bindBuffer(a.ARRAY_BUFFER, Id), a.vertexAttribPointer(H.N, 2, a.FLOAT, !1, 0, 0), a.activeTexture(a.TEXTURE0), a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, ue), a.uniform1i(H.tb, 0), a.uniformMatrix4fv(H.qb, !1, fa), a.uniformMatrix4fv(H.Oa, !1, Kb), a.drawElements(a.TRIANGLES, 36, a.UNSIGNED_SHORT, 0) } else if (0 < l.i.length) { Sb(); var R, S, da; Rd && (d.initWebGL(), Ac()); if (a) { a.clear(a.COLOR_BUFFER_BIT | a.DEPTH_BUFFER_BIT); a.enable(a.DEPTH_TEST); Hc(Kb); Vd(d.getVFov(), a.aa / a.$, Kb); a.uniformMatrix4fv(H.Oa, !1, Kb); mf(); lf(); var Ia = kf(), Pa; for (Pa = l.i.length - 1; Pa >= Ia;) { var ba = l.i[Pa], Ba = 1; Pa == l.i.length - 1 && 0 == l.P && (Ba = l.o / (l.o - .5)); for (var V = 0; 6 > V; V++) { var cb; cb = d.O.J[V]; var ua = cb.Ia; if (cb.ga && 0 < ua.Ra && 0 < ua.eb && 0 < ua.scale || ba.cache) { cb.dirty = !1; var Za; cb.La[Pa] || (cb.La[Pa] = { W: 0, da: 0, ha: 0, ia: 0 }); Za = cb.La[Pa]; ba.cache ? (Za.W = 0, Za.da = 0, Za.ha = ba.M - 1, Za.ia = ba.ja - 1) : nf(ba, ua, Za); var Oa = !0; for (S = Za.da; S <= Za.ia; S++) for (R = Za.W; R <= Za.ha; R++) { var Aa = R + S * ba.M + V * ba.M * ba.ja, Y = ba.s[Aa]; Y || (Y = ba.s[Aa] = {}); ja < Sd && !Y.f && (De++, Y.f = new Image, Y.f.onload = Pf(Y), Y.f.onerror = of(), Y.f.onabort = of(), Y.f.setAttribute("src", Kd(V, Pa, R, S)), ba.cache && d.checkLoaded.push(Y.f), 0 == ja && d.divSkin && d.divSkin.ggReLoadedLevels && d.divSkin.ggReLoadedLevels(), ja++, d.dirty = !0); if (Y.na) { if (!Y.Xa) { var Ha; Ha = .5 * Pa + 1; Y.Xa = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, Y.Xa); var db = [-1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1]; db[3] = R * l.o - l.P; db[0] = Math.min((R + 1) * l.o, ba.width) + l.P; db[7] = S * l.o - l.P; db[1] = Math.min((S + 1) * l.o, ba.height) + l.P; db[4] = db[1]; db[6] = db[3]; db[9] = db[0]; db[10] = db[7]; for (da = 0; 12 > da; da++) db[da] = 0 == da % 3 ? Ba * Ha * (-2 * db[da] / ba.width + 1) : 1 == da % 3 ? Ba * Ha * (-2 * db[da] / ba.height + 1) : Ha; a.bufferData(a.ARRAY_BUFFER, new Float32Array(db), a.STATIC_DRAW) } } else Oa = !1; Y.visible = cb.ga } Za.Hb = Oa } } Pa-- } for (V = 0; 6 > V; V++) if (cb = d.O.J[V], cb.ga) for (ua = cb.Ia, Hc(fa), Ud(fa, -ya * Math.PI / 180, [0, 0, 1]), Ud(fa, -w * Math.PI / 180, [1, 0, 0]), Ud(fa, (180 - D) * Math.PI / 180, [0, 1, 0]), Ca && (Ud(fa, -Ca.pitch * Math.PI / 180, [1, 0, 0]), Ud(fa, Ca.Da * Math.PI / 180, [0, 0, 1])), 4 > V ? Ud(fa, -Math.PI / 2 * V, [0, 1, 0]) : Ud(fa, Math.PI / 2 * (5 == V ? 1 : -1), [1, 0, 0]), a.uniform1i(H.tb, 0), a.uniformMatrix4fv(H.Oa, !1, Kb), a.uniformMatrix4fv(H.qb, !1, fa), a.bindBuffer(a.ARRAY_BUFFER, Gd), a.vertexAttribPointer(H.N, 2, a.FLOAT, !1, 0, 0), a.activeTexture(a.TEXTURE0), a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, Hd), Pa = Ia; Pa <= l.i.length - 1;) { ba = l.i[Pa]; if (cb.ga && 0 < ua.Ra && cb.La[Pa] && 0 <= cb.La[Pa].W) { Za = cb.La[Pa]; for (S = Za.da; S <= Za.ia; S++) for (R = Za.W; R <= Za.ha; R++) Aa = R + S * ba.M + V * ba.M * ba.ja, (Y = ba.s[Aa]) || (Y = ba.s[Aa] = {}), Y.na && (a.uniform1f(H.Pb, 1E-4 * (R % 2 + S % 2 * 2)), a.bindBuffer(a.ARRAY_BUFFER, Y.Xa), a.vertexAttribPointer(H.u, 3, a.FLOAT, !1, 0, 0), a.bindTexture(a.TEXTURE_2D, Y.na), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), a.drawElements(a.TRIANGLES, 6, a.UNSIGNED_SHORT, 0)), Y.visible = cb.ga; Za.Hb && (Pa = l.i.length) } Pa++ } for (var Na = 0; Na < l.i.length; Na++) if (ba = l.i[Na], !ba.cache) for (var Ua in ba.s) ba.s.hasOwnProperty(Ua) && (Y = ba.s[Ua], Y.visible || (Y.na && a.deleteTexture(Y.na), Y.f = null, Y.Xa && a.deleteBuffer(Y.Xa), delete ba.s[Ua])); d.ta = !1 } } else { var ta; Sb(); if (E != C.offsetWidth || v != C.offsetHeight) E = parseInt(C.offsetWidth), v = parseInt(C.offsetHeight); Rd && (d.initWebGL(), Ac()); if (a) for (a.clear(a.COLOR_BUFFER_BIT | a.DEPTH_BUFFER_BIT), Hc(Kb), Vd(d.getVFov(), a.aa / a.$, Kb), a.uniformMatrix4fv(H.Oa, !1, Kb), ta = 0; 6 > ta; ta++) Hc(fa), Ud(fa, -ya * Math.PI / 180, [0, 0, 1]), Ud(fa, -w * Math.PI / 180, [1, 0, 0]), Ud(fa, (180 - D) * Math.PI / 180, [0, 1, 0]), Ca && (Ud(fa, -Ca.pitch * Math.PI / 180, [1, 0, 0]), Ud(fa, Ca.Da * Math.PI / 180, [0, 0, 1])), 4 > ta ? Ud(fa, -Math.PI / 2 * ta, [0, 1, 0]) : Ud(fa, Math.PI / 2 * (5 == ta ? 1 : -1), [1, 0, 0]), a.bindBuffer(a.ARRAY_BUFFER, se), a.vertexAttribPointer(H.u, 3, a.FLOAT, !1, 0, 0), a.bindBuffer(a.ARRAY_BUFFER, Gd), a.vertexAttribPointer(H.N, 2, a.FLOAT, !1, 0, 0), 6 <= nb.length && nb[ta].loaded && (a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, nb[ta]), a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, Hd), a.uniform1i(H.tb, 0), a.uniformMatrix4fv(H.qb, !1, fa), a.uniformMatrix4fv(H.Oa, !1, Kb), a.drawElements(a.TRIANGLES, 6, a.UNSIGNED_SHORT, 0)) //alert("sds"); var canvas = document.getElementById("ssCanvas"); if (canvas != null) // probably have some variable to turn this on/off from our "snapShotPage". No need to do this unnecessarily { var width = E; var height = v; var data = new Uint8Array(width * height * 4); a.readPixels(0, 0, width, height, a.RGBA, a.UNSIGNED_BYTE, data); // Create a 2D canvas to store the result var canvas = document.getElementById("ssCanvas"); canvas.width = width; canvas.height = height; var context = canvas.getContext('2d'); // Copy the pixels to a 2D canvas var imageData = context.createImageData(width, height); imageData.data.set(data); context.putImageData(imageData, 0, 0); } } var Sa, Ma; Da.style.visibility = "hidden"; t.Za != t.mode && (t.Za = t.mode); if (0 < t.mode && !d.Qa) { var Wa = 1; 3 == t.mode && (Wa = t.A); for (Sa = 0; Sa < J.length; Sa++) { var ka = J[Sa]; if ("poly" == ka.type) { var Ya = ka.Ba; 2 == t.mode && (Wa = ka.A); if (0 < Ya.length) { var Ja = []; for (Ma = 0; Ma < Ya.length; Ma++) Ja.push(Ya[Ma].X), Ja.push(Ya[Ma].R), Ja.push(0); a.useProgram(Ab); a.enable(a.BLEND); a.blendFuncSeparate(a.SRC_ALPHA, a.ONE_MINUS_SRC_ALPHA, a.SRC_ALPHA, a.ONE); a.disable(a.DEPTH_TEST); var ub = a.createBuffer(); a.bindBuffer(a.ARRAY_BUFFER, ub); a.bufferData(a.ARRAY_BUFFER, new Float32Array(Ja), a.STATIC_DRAW); a.uniform2f(a.getUniformLocation(Ab, "uCanvasDimensions"), E, v); var tb = a.getUniformLocation(Ab, "uColor"); a.uniform3f(tb, (ka.V >> 16 & 255) / 255, (ka.V >> 8 & 255) / 255, (ka.V & 255) / 255); var Eb = a.getUniformLocation(Ab, "uAlpha"); a.uniform1f(Eb, ka.ca * Wa); a.vertexAttribPointer(Ab.u, 3, a.FLOAT, !1, 0, 0); a.drawArrays(a.LINE_LOOP, 0, Ja.length / 3); a.uniform3f(tb, (ka.U >> 16 & 255) / 255, (ka.U >> 8 & 255) / 255, (ka.U & 255) / 255); a.uniform1f(Eb, ka.ba * Wa); a.enable(a.STENCIL_TEST); a.clearStencil(0); a.clear(a.STENCIL_BUFFER_BIT); a.colorMask(!1, !1, !1, !1); a.stencilFunc(a.ALWAYS, 1, 1); a.stencilOp(a.INCR, a.INCR, a.INCR); a.drawArrays(a.TRIANGLE_FAN, 0, Ja.length / 3); a.colorMask(!0, !0, !0, !0); a.stencilFunc(a.EQUAL, 1, 1); a.stencilOp(a.ZERO, a.ZERO, a.ZERO); a.drawArrays(a.TRIANGLE_FAN, 0, Ja.length / 3); a.useProgram(H); a.disable(a.BLEND); a.enable(a.DEPTH_TEST); a.disable(a.STENCIL_TEST); a.useProgram(H) } } } } } else { if ($b) if (0 < l.i.length) { Sb(); var Fb = !1, lb = !1, eb, Ta, Va, lb = !1; Ff++; if (E != C.offsetWidth || v != C.offsetHeight) E = parseInt(C.offsetWidth), v = parseInt(C.offsetHeight), C.style[La + "OriginX"] = E / 2 + "px", C.style[La + "OriginY"] = v / 2 + "px", Fb = !0; var hb = Math.round(d.Ga()); if (d.$a != hb || Fb) d.$a = hb, Ib || (C.style[pc] = hb + "px", C.style[pc + "Origin"] = "50% 50%"); if (0 < l.i.length) { mf(); lf(); var Qb = 0, W; W = ""; for (eb = 0; 6 > eb; eb++) { var Xa; Xa = d.O.J[eb]; Xa.ga && (Qb = Math.max(Qb, Xa.Ia.scale), W = W + eb + ",") } var Yb = kf(), Lb; for (Lb = l.i.length - 1; Lb >= Yb;) { var za = l.i[Lb], ab = 1; Lb == l.i.length - 1 && 0 == l.P && (ab = l.o / (l.o - 2)); for (eb = 0; 6 > eb; eb++) { Xa = d.O.J[eb]; var yb = Xa.Ia; if (Xa.ga && 0 < yb.Ra && 0 < yb.eb && 0 < yb.scale || za.cache) { Xa.dirty = !1; var bc; bc = {}; za.cache ? (bc.W = 0, bc.da = 0, bc.ha = za.M - 1, bc.ia = za.ja - 1) : nf(za, yb, bc); for (Va = bc.da; Va <= bc.ia; Va++) for (Ta = bc.W; Ta <= bc.ha; Ta++) { var Tb = Ta + Va * za.M + eb * za.M * za.ja, A = za.s[Tb]; A || (A = za.s[Tb] = {}); if (!A.g && ja < Sd) { if (0 < jd.length) { A.g = jd.shift(); var fb; for (fb = C.firstChild; fb && fb.za && (-1 == fb.za || fb.za >= Lb) ;) fb = fb.nextSibling; C.insertBefore(A.g, fb); A.v = A.g.Cb } else if (vf < Cf) { vf++; A.g = document.createElement("canvas"); A.g.width = l.o + 2 * l.P; A.g.height = l.o + 2 * l.P; A.v = A.g.getContext("2d"); A.g.Cb = A.v; A.g.style[La + "Origin"] = "0% 0%"; A.g.style.overflow = "hidden"; A.g.style.position = "absolute"; for (fb = C.firstChild; fb && fb.za && (-1 == fb.za || fb.za >= Lb) ;) fb = fb.nextSibling; C.insertBefore(A.g, fb) } A.g && (De++, A.f = new Image, A.f.style[La + "Origin"] = "0% 0%", A.f.style.position = "absolute", A.f.style.overflow = "hidden", A.g.za = Lb, lb && (A.g.id = "tile" + eb + "_" + Lb + "___" + Va + "_" + Ta), A.f.onload = Nf(A), A.f.onerror = Ld(A), A.f.onabort = Ld(A), A.f.setAttribute("src", Kd(eb, Lb, Ta, Va)), za.cache && d.checkLoaded.push(A.f), 0 == ja && d.divSkin && d.divSkin.ggReLoadedLevels && d.divSkin.ggReLoadedLevels(), ja++, d.dirty = !0) } if (A.g) { W = ""; Ib ? (W += "translate3d(" + E / 2 + "px," + v / 2 + "px,0px) ", W += " perspective(" + hb + "px) ", W += "translate3d(0px,0px," + hb + "px) ") : W += "translate3d(" + E / 2 + "px," + v / 2 + "px," + hb + "px) "; W += "rotateZ(" + Number(ya).toFixed(10) + "deg) rotateX(" + Number(w).toFixed(10) + "deg) rotateY(" + Number(-D).toFixed(10) + "deg) "; Ca && (W += "rotateX(" + Number(-Ca.pitch).toFixed(10) + "deg) rotateZ(" + Number(Ca.Da).toFixed(10) + "deg) "); W = 4 > eb ? W + ("rotateY(" + -90 * eb + "deg)") : W + ("rotateX(" + (4 == eb ? -90 : 90) + "deg)"); var bb = 1; Jc ? (bb = gd / l.o * (l.o / za.width) * (2 * Lb + 1), bb = cd ? 2 / Math.tan(y * Math.PI / 360) * bb : 2 * bb, W += " scale(" + bb * ab * ab + ")") : bb = 1 / (ab * ab); W += " translate3d(" + (1 / ab * Ta * l.o - l.P - za.width / 2) + "px," + (1 / ab * Va * l.o - l.P - za.width / 2) + "px," + -za.width * bb / 2 + "px)"; lb && (A.g.id = "rtile_" + Ff + "_" + eb + "_" + Lb + "___" + Va + "_" + Ta); Xa.ga && (A.visible = !0, A.g ? A.g.style[La] = W : A.f && (A.f.style[La] = W)) } } } } Lb-- } for (var Pb = 0; Pb < l.i.length; Pb++) { var za = l.i[Pb], Bb; for (Bb in za.s) za.s.hasOwnProperty(Bb) && (A = za.s[Bb], !A.visible && A.g && (za.cache ? (W = "translate3d(-10px,-10px,0px) scale(0.001,0.001)", A.g ? (A.g.style[La] = W, lb && (A.g.id = "cache")) : A.f && (A.f.style[La] = "")) : (A.v && (A.v.clear ? A.v.clear() : A.v.clearRect(0, 0, A.v.canvas.width, A.v.canvas.height)), jd.push(A.g), A.g ? (lb && (A.g.id = "unused"), W = "translate3d(-10px,-10px,0px) scale(0.001,0.001)", A.g.style[La] = W, A.g.za = -1) : A.loaded && C.removeChild(A.f), A.g = null, A.f = null, A.v = null, delete za.s[Bb]))) } d.ta = !1 } } else { Sb(); var Xb = !1; if (E != C.offsetWidth || v != C.offsetHeight) E = parseInt(C.offsetWidth), v = parseInt(C.offsetHeight), C.style[La + "OriginX"] = E / 2 + "px", C.style[La + "OriginY"] = v / 2 + "px", Xb = !0; var mb = Math.round(d.Ga()); d.$a == mb && !Xb || Ib || (d.$a = mb, C.style[pc] = mb + "px"); var Db; d.O.Ub(D, w, ya, Ca); for (Db = 0; 6 > Db; Db++) { var vb, ib; if (vb = d.O.J[Db]) ib = "", Ib ? (ib += "translate3d(" + E / 2 + "px," + v / 2 + "px,0px) ", ib += "perspective(" + mb + "px) ", ib += "translate3d(0px,0px," + mb + "px) ") : ib += "translate3d(" + E / 2 + "px," + v / 2 + "px," + mb + "px) ", ib += "rotateZ(" + Number(ya).toFixed(10) + "deg) rotateX(" + Number(w).toFixed(10) + "deg)\trotateY(" + Number(-D).toFixed(10) + "deg) ", vb.Db && (ib += vb.Db, vb.ga || (ib = "translate3d(-10px,-10px,0px) scale(0.001,0.001)"), vb.g.style[La] = ib) } } else if (Qc) { Sb(); var Qa; zb && (Qa = zb.getContext("2d")); if (E != C.offsetWidth || v != C.offsetHeight) E = parseInt(C.offsetWidth), v = parseInt(C.offsetHeight); if (Qa) { var wc = Qa.canvas.width / 2, xc = Qa.canvas.height / 2, Rb = Qa.createRadialGradient(wc, xc, 5, wc, xc, Math.max(wc, xc)); Rb.addColorStop(0, "#333"); Rb.addColorStop(1, "#fff"); Qa.rect(0, 0, Qa.canvas.width, Qa.canvas.height); Qa.fillStyle = Rb; Qa.fill(); Qa.fillStyle = "#f00"; Qa.font = "20px Helvetica"; Qa.textAlign = "center"; Qa.fillText("Pan: " + D.toFixed(1), wc, xc - 60); Qa.fillText("Tilt: " + w.toFixed(1), wc, xc - 30); Qa.fillText("Fov: " + y.toFixed(1), wc, xc + 0); Qa.fillText("Node: " + d.getCurrentNode(), wc, xc + 30); Qa.fillText("Title: " + d.userdata.title, wc, xc + 60) } } var Gb, xb; if (Da && (t.Za != t.mode && (t.Za = t.mode, Da.style.visibility = 0 < t.mode ? "inherit" : "hidden"), 0 < t.mode)) { K || (K = Da.getContext("2d")); if (K.width != E || K.height != v) K.width = E, K.height = v; K.clear ? K.clear() : K.clearRect(0, 0, Da.width, Da.height); var Hb = 1; 3 == t.mode && (Hb = t.A); for (Gb = 0; Gb < J.length; Gb++) { var Cc = J[Gb]; if ("poly" == Cc.type) { var Vb = Cc.Ba; 2 == t.mode && (Hb = Cc.A); K.fillStyle = M(Cc.U, Cc.ba * Hb); K.strokeStyle = M(Cc.V, Cc.ca * Hb); if (0 < Vb.length) { K.beginPath(); for (xb = 0; xb < Vb.length; xb++) { var Nb = Vb[xb]; 0 == xb ? K.moveTo(Nb.X, Nb.R) : K.lineTo(Nb.X, Nb.R) } K.closePath(); K.stroke(); K.fill() } } } } } Yd(); var yc, Ob, Mb, cc = new Ga(0, 0, -100), tc = d.Ga(), na, ga; if (pa) na = a.aa, ga = a.$, d.Qa && (na = rb.width, ga = rb.height); else { I || (I = Jb.getContext("2d")); if (I.width != E || I.height != v) I.width = E, I.height = v; I.clear ? I.clear() : I.clearRect(0, 0, Jb.width, Jb.height); na = I.width; ga = I.height } var jc = Math.sqrt(na * na + ga * ga), Wb = jc / 800; for (Ob = 0; Ob < hd.length; Ob++) { var zc = hd[Ob]; cc.K(0, 0, -100); cc.D(-zc.tilt * Math.PI / 180); cc.L(zc.pan * Math.PI / 180); cc.L(-D * Math.PI / 180); cc.D(w * Math.PI / 180); cc.Y(ya * Math.PI / 180); var kc = !1; if (-.01 > cc.z) { var Ea, Fa, lc = -tc / cc.z; Ea = cc.x * lc; Fa = cc.y * lc; Math.abs(Ea) < na / 2 + 100 && Math.abs(Fa) < ga / 2 + 100 && (kc = !0, Ea += na / 2, Fa += ga / 2) } if (kc) { pa && (a.blendFunc(a.SRC_ALPHA, a.DST_ALPHA), a.enable(a.BLEND), a.disable(a.DEPTH_TEST)); var mc = na / 2, oc = ga / 2, Cb = Math.sqrt((mc - Ea) * (mc - Ea) + (oc - Fa) * (oc - Fa)), Dc = jc / 2, uc = na > ga ? na : ga, wb = zc.xb / 100 * ((Dc - Cb) / Dc); 0 > wb && (wb = 0); if (pa) { a.useProgram(sb); a.bindBuffer(a.ARRAY_BUFFER, Ka); a.vertexAttribPointer(sb.u, Ka.oa, a.FLOAT, !1, 0, 0); var Ec = a.getUniformLocation(sb, "uCanvasDimensions"); a.uniform2f(Ec, a.drawingBufferWidth, a.drawingBufferHeight); a.uniform2f(a.getUniformLocation(sb, "uFlareCenterPosition"), a.drawingBufferWidth / na * Ea, ga - a.drawingBufferHeight / ga * Fa); a.uniform1f(a.getUniformLocation(sb, "uBlindingValue"), wb); var Fc = a.getUniformLocation(sb, "uAspectRatio"); a.uniform1f(Fc, d.Qa ? a.drawingBufferWidth / a.drawingBufferHeight : a.drawingBufferWidth / a.drawingBufferHeight / (na / ga)); a.drawArrays(a.TRIANGLE_STRIP, 0, Ka.Aa) } else { var ha = I.createRadialGradient(Ea, Fa, 1, Ea, Fa, uc); ha.addColorStop(0, "rgba(255, 255, 255, " + wb + ")"); ha.addColorStop(.5, "rgba(255, 255, 255, " + .8 * wb + ")"); ha.addColorStop(1, "rgba(255, 255, 255, " + .6 * wb + ")"); I.fillStyle = ha; I.fillRect(0, 0, I.width, I.height) } if (0 != Number(zc.type) && !d.Qa) { var dc = na / 2 - Ea, ec = ga / 2 - Fa, fc = 1, jb = Number(zc.type) - 1; Cb < .35 * Dc && (fc = Cb / (.35 * Dc), fc *= fc); Cb > .7 * Dc && (fc = (Dc - Cb) / (.3 * Dc)); fc *= zc.alpha / 100; if (0 < ob[jb].length) for (Mb = 0; Mb < ob[jb].length; Mb++) { var rc = ob[jb][Mb], kb = rc.b * Wb, wa = rc.alpha * fc; 0 > wa && (wa = 0); var gb = rc.color; if (8 == jb || 9 == jb || 10 == jb) gb = zc.color; if (pa) a.useProgram(Z), a.bindBuffer(a.ARRAY_BUFFER, Bc), a.vertexAttribPointer(Z.u, Bc.oa, a.FLOAT, !1, 0, 0), Ec = a.getUniformLocation(Z, "uCanvasDimensions2"), a.uniform2f(Ec, a.drawingBufferWidth, a.drawingBufferHeight), a.uniform2f(a.getUniformLocation(Z, "uCirclePosition"), a.drawingBufferWidth / na * (Ea + dc * rc.a), a.drawingBufferWidth / na * (ga - (Fa + ec * rc.a))), a.uniform2f(a.getUniformLocation(Z, "uCircleTexturePosition"), a.drawingBufferWidth / na * (Ea + dc * rc.a), ga - (Fa + ec * rc.a)), a.uniform1f(a.getUniformLocation(Z, "uCircleRadius"), kb), a.uniform3f(a.getUniformLocation(Z, "uCircleColor"), (gb >> 16 & 255) / 255, (gb >> 8 & 255) / 255, (gb & 255) / 255), a.uniform1f(a.getUniformLocation(Z, "uCircleAlpha"), wa), a.uniform1f(a.getUniformLocation(Z, "uCircleSoftness"), .1), Fc = a.getUniformLocation(Z, "uAspectRatio"), a.uniform1f(Fc, a.drawingBufferWidth / a.drawingBufferHeight / (na / ga)), a.drawArrays(a.TRIANGLE_FAN, 0, Bc.Aa); else { I.save(); I.translate(Ea + dc * rc.a, Fa + ec * rc.a); ha = I.createRadialGradient(0, 0, 1, 0, 0, 1.1 * kb); ha.addColorStop(0, M(gb, wa)); ha.addColorStop(.65, M(gb, .9 * wa)); ha.addColorStop(.8, M(gb, .7 * wa)); ha.addColorStop(1, M(gb, .2 * wa)); I.beginPath(); var vc = 2 * Math.PI / 6, qc = Math.PI / 180 * 35, sc = !0; for (yc = qc; yc <= qc + 2 * Math.PI; yc += vc) sc ? (I.moveTo(kb * Math.sin(yc), kb * Math.cos(yc)), sc = !1) : I.lineTo(kb * Math.sin(yc), kb * Math.cos(yc)); I.closePath(); I.fillStyle = ha; I.fill(); I.restore() } } if (0 < pb[jb].length) for (Mb = 0; Mb < pb[jb].length; Mb++) { var Ub = pb[jb][Mb], kb = Ub.b * Wb, wa = Ub.alpha * fc; 0 > wa && (wa = 0); gb = Ub.color; if (8 == jb || 9 == jb || 10 == jb) gb = zc.color; if (pa) { a.useProgram(Z); a.bindBuffer(a.ARRAY_BUFFER, Zb); a.vertexAttribPointer(Z.u, Zb.oa, a.FLOAT, !1, 0, 0); Ec = a.getUniformLocation(Z, "uCanvasDimensions2"); a.uniform2f(Ec, a.drawingBufferWidth, a.drawingBufferHeight); var hc = a.getUniformLocation(Z, "uCirclePosition"); a.uniform2f(hc, a.drawingBufferWidth / na * (Ea + dc * Ub.a), a.drawingBufferWidth / na * (ga - (Fa + ec * Ub.a))); var ic = a.getUniformLocation(Z, "uCircleTexturePosition"); a.uniform2f(ic, a.drawingBufferWidth / na * (Ea + dc * Ub.a), ga - (Fa + ec * Ub.a)); var nc = a.getUniformLocation(Z, "uCircleRadius"); a.uniform1f(nc, kb); a.uniform3f(a.getUniformLocation(Z, "uCircleColor"), (gb >> 16 & 255) / 255, (gb >> 8 & 255) / 255, (gb & 255) / 255); a.uniform1f(a.getUniformLocation(Z, "uCircleAlpha"), wa); a.uniform1f(a.getUniformLocation(Z, "uCircleSoftness"), Ub.c); Fc = a.getUniformLocation(Z, "uAspectRatio"); a.uniform1f(Fc, a.drawingBufferWidth / a.drawingBufferHeight / (na / ga)); a.drawArrays(a.TRIANGLE_FAN, 0, Zb.Aa) } else I.save(), I.translate(Ea + dc * Ub.a, Fa + ec * Ub.a), ha = I.createRadialGradient(0, 0, 1, 0, 0, kb), ha.addColorStop(0, M(gb, wa)), ha.addColorStop(1 - Ub.c, M(gb, .8 * wa)), ha.addColorStop(1, M(gb, 0)), I.beginPath(), I.arc(0, 0, kb, 0, 2 * Math.PI, !1), I.closePath(), I.fillStyle = ha, I.fill(), I.restore() } if (0 < qb[jb].length) for (Mb = 0; Mb < qb[jb].length; Mb++) { var gc = qb[jb][Mb], kb = gc.b * Wb, wa = gc.alpha * fc; 0 > wa && (wa = 0); pa ? (a.useProgram(Ra), a.activeTexture(a.TEXTURE0), a.bindTexture(a.TEXTURE_2D, we), a.bindBuffer(a.ARRAY_BUFFER, Zb), a.vertexAttribPointer(Ra.u, Zb.oa, a.FLOAT, !1, 0, 0), Ec = a.getUniformLocation(Ra, "uCanvasDimensions2"), a.uniform2f(Ec, na, ga), hc = a.getUniformLocation(Ra, "uCirclePosition"), a.uniform2f(hc, Ea + dc * gc.a, ga - (Fa + ec * gc.a)), ic = a.getUniformLocation(Ra, "uRingTexturePosition"), a.uniform2f(ic, a.drawingBufferWidth / na * (Ea + dc * gc.a), ga - (Fa + ec * gc.a)), nc = a.getUniformLocation(Ra, "uCircleRadius"), a.uniform1f(nc, kb), a.uniform2f(a.getUniformLocation(Ra, "uRingPosition"), Ea + dc * gc.a, ga - (Fa + ec * gc.a)), a.uniform1f(a.getUniformLocation(Ra, "uRingRadius"), kb), a.uniform1f(a.getUniformLocation(Ra, "uRingAlpha"), wa), Fc = a.getUniformLocation(Ra, "uAspectRatio"), a.uniform1f(Fc, a.drawingBufferWidth / a.drawingBufferHeight / (na / ga)), a.uniform1i(a.getUniformLocation(Ra, "uSampler"), 0), a.drawArrays(a.TRIANGLE_FAN, 0, Zb.Aa)) : (I.save(), I.translate(Ea + dc * gc.a, Fa + ec * gc.a), ha = I.createRadialGradient(0, 0, 0, 0, 0, kb), ha.addColorStop(0, M(16777215, 0)), ha.addColorStop(.88, M(0, 0)), ha.addColorStop(.9, M(16654848, wa)), ha.addColorStop(.92, M(16776448, wa)), ha.addColorStop(.94, M(4849466, wa)), ha.addColorStop(.96, M(131071, wa)), ha.addColorStop(.98, M(8190, wa)), ha.addColorStop(1, M(0, 0)), I.beginPath(), I.arc(0, 0, kb, 0, 2 * Math.PI, !1), I.closePath(), I.fillStyle = ha, I.fill(), I.restore()) } } pa && (a.useProgram(H), a.disable(a.BLEND), a.enable(a.DEPTH_TEST)) } } } 50 < Date.now() - e ? ($a(), Od || (2 < Ee ? (Od = !0, $a(), Ac()) : Ee++)) : Ee = 0 }; var Ib = !1, Jc = !1; d.setRenderFlags = function (a) { a = Math.round(a); Ib = 0 < (a & 1); Jc = 0 < (a & 2); Qd = 0 < (a & 4); Od = 0 < (a & 8); 4096 <= a && ($b = 0 < (a & 4096), pa = 0 < (a & 8192), Qc = 0 < (a & 32768)) }; d.getRenderFlags = function () { var a = 0; Ib && (a |= 1); Jc && (a |= 2); Qd && (a |= 4); $b && (a |= 4096); pa && (a |= 8192); Qc && (a |= 32768); return a }; var Ff = 1, H, sb, Z, Ra, Q, la, aa, ma, Ab; d.initWebGL = function () { Rd = !1; try { if (Oa = document.createElement("canvas"), Oa.width = 100, Oa.height = 100, Oa.style.display = "none", Oa.style.sc = "none", C.insertBefore(Oa, C.firstChild), (a = Oa.getContext("webgl", { premultipliedAlpha: !1, stencil: !0 })) || (a = Oa.getContext("experimental-webgl", { premultipliedAlpha: !1, stencil: !0 })), a) { a.aa = 500; a.$ = 500; a.clearColor(0, 0, 0, 0); if (l.Pa && 6 < l.Pa.length) { var e = parseInt(l.Pa); a.clearColor((e >> 16 & 255) / 255, (e >> 8 & 255) / 255, (e >> 0 & 255) / 255, 1) } a.enable(a.DEPTH_TEST); a.viewport(0, 0, 500, 500); a.clear(a.COLOR_BUFFER_BIT | a.DEPTH_BUFFER_BIT); var d = a.createShader(a.FRAGMENT_SHADER), b; b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec2 vTextureCoord;\n"; b += "uniform sampler2D uSampler;\n"; b += "void main(void) {\n"; b += " gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n"; b += "}\n"; a.shaderSource(d, b); a.compileShader(d); a.getShaderParameter(d, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(d)), d = null); var c = a.createShader(a.VERTEX_SHADER); b = ""; b += "attribute vec3 aVertexPosition;\n"; b += "attribute vec2 aTextureCoord;\n"; b += "uniform mat4 uMVMatrix;\n"; b += "uniform mat4 uPMatrix;\n"; b += "uniform float uZoffset;\n"; b += "varying vec2 vTextureCoord;\n"; b += "void main(void) {\n"; b += " gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\n"; b += " gl_Position.z += uZoffset;\n"; b += " vTextureCoord = aTextureCoord;\n"; b += "}\n"; a.shaderSource(c, b); a.compileShader(c); a.getShaderParameter(c, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(c)), c = null); H = a.createProgram(); a.attachShader(H, c); a.attachShader(H, d); a.linkProgram(H); a.getProgramParameter(H, a.LINK_STATUS) || alert("Could not initialise shaders"); a.useProgram(H); H.u = a.getAttribLocation(H, "aVertexPosition"); a.enableVertexAttribArray(H.u); H.N = a.getAttribLocation(H, "aTextureCoord"); a.enableVertexAttribArray(H.N); H.Oa = a.getUniformLocation(H, "uPMatrix"); H.qb = a.getUniformLocation(H, "uMVMatrix"); H.tb = a.getUniformLocation(H, "uSampler"); H.Pb = a.getUniformLocation(H, "uZoffset"); var f = a.createShader(a.VERTEX_SHADER); b = ""; b += "attribute vec3 aVertexPosition;\n"; b += "void main(void) {\n"; b += " gl_Position = vec4(aVertexPosition, 1.0);\n"; b += "}\n"; a.shaderSource(f, b); a.compileShader(f); a.getShaderParameter(f, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(f)), f = null); var h = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec4 vColor;\n"; b += "uniform vec2 uCanvasDimensions;\n"; b += "uniform vec2 uFlareCenterPosition;\n"; b += "uniform float uBlindingValue;\n"; b += "uniform float uAspectRatio;\n"; b += "void main(void) {\n"; b += " float canvasDiag = sqrt( (uCanvasDimensions.x * uCanvasDimensions.x) + (uCanvasDimensions.y * uCanvasDimensions.y) );\n"; b += " vec2 diff = uFlareCenterPosition - gl_FragCoord.xy;\n"; b += " diff.y = diff.y * uAspectRatio;\n"; b += " float distFromFlarePoint = sqrt( (diff.x * diff.x) + (diff.y * diff.y) );\n"; b += " float factor = (distFromFlarePoint / canvasDiag) / 10.0;\n"; b += " gl_FragColor = vec4(1.0, 1.0, 1.0, pow(((1.0 - factor) * 0.8) * uBlindingValue, 2.0));\n"; b += "}\n"; a.shaderSource(h, b); a.compileShader(h); a.getShaderParameter(h, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(h)), h = null); sb = a.createProgram(); a.attachShader(sb, f); a.attachShader(sb, h); a.linkProgram(sb); a.getProgramParameter(sb, a.LINK_STATUS) || alert("Could not initialise shaders"); sb.u = a.getAttribLocation(sb, "aVertexPosition"); a.enableVertexAttribArray(sb.u); var k = a.createShader(a.VERTEX_SHADER), n = a.createShader(a.VERTEX_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "attribute vec3 aVertexPosition;\n"; b += "varying vec4 vColor;\n"; b += "uniform vec2 uCirclePosition;\n"; b += "uniform float uCircleRadius;\n"; b += "uniform vec2 uCanvasDimensions2;\n"; b += "uniform float uAspectRatio;\n"; b += "void main(void) {\n"; b += " vec2 circleOnScreen = aVertexPosition.xy * uCircleRadius + uCirclePosition;\n"; b += " circleOnScreen.y = circleOnScreen.y / uAspectRatio;\n"; b += " vec2 circleNorm = (circleOnScreen / uCanvasDimensions2) * 2.0 - vec2(1.0, 1.0);\n"; b += " gl_Position = vec4(circleNorm.x, circleNorm.y, 0.0, 1.0);\n"; b += "}\n"; a.shaderSource(k, b); a.compileShader(k); a.getShaderParameter(k, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(k)), k = null); a.shaderSource(n, b); a.compileShader(n); a.getShaderParameter(n, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(n)), k = null); var q = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec4 vColor;\n"; b += "uniform vec2 uCircleTexturePosition;\n"; b += "uniform vec3 uCircleColor;\n"; b += "uniform float uCircleRadius;\n"; b += "uniform float uCircleAlpha;\n"; b += "uniform float uCircleSoftness;\n"; b += "uniform float uAspectRatio;\n"; b += "void main(void) {\n"; b += " vec2 diff = uCircleTexturePosition - gl_FragCoord.xy;\n"; b += " diff.y = diff.y * uAspectRatio;\n"; b += " float distFromCircleCenter = sqrt( (diff.x * diff.x) + (diff.y * diff.y) );\n"; b += " float softnessDistance = uCircleRadius * (1.0 - uCircleSoftness);\n"; b += " if (distFromCircleCenter > uCircleRadius)\n"; b += " {\n"; b += "\t gl_FragColor = vec4(uCircleColor, 0.0);\n"; b += " }\n"; b += " else if (distFromCircleCenter <= (softnessDistance))\n"; b += " {\n"; b += "\t float factor = distFromCircleCenter / softnessDistance;\n"; b += "\t gl_FragColor = vec4(uCircleColor, pow((1.0 - (0.2 * factor)) * uCircleAlpha, 1.8));\n"; b += " }\n"; b += " else\n"; b += " {\n"; b += "\t float factor = (distFromCircleCenter - softnessDistance) / (uCircleRadius - softnessDistance);\n"; b += "\t gl_FragColor = vec4(uCircleColor, pow((0.8 - (0.8 * factor)) * uCircleAlpha, 1.8));\n"; b += " }\n"; b += "}\n"; a.shaderSource(q, b); a.compileShader(q); a.getShaderParameter(q, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(q)), q = null); Z = a.createProgram(); a.attachShader(Z, k); a.attachShader(Z, q); a.linkProgram(Z); a.getProgramParameter(Z, a.LINK_STATUS) || alert("Could not initialise shaders"); Z.u = a.getAttribLocation(Z, "aVertexPosition"); a.enableVertexAttribArray(Z.u); var m = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec4 vColor;\n"; b += "uniform vec2 uRingTexturePosition;\n"; b += "uniform float uRingRadius;\n"; b += "uniform float uRingAlpha;\n"; b += "uniform float uAspectRatio;\n"; b += "uniform sampler2D uSampler;\n"; b += "void main(void) {\n"; b += " vec2 diff = uRingTexturePosition - gl_FragCoord.xy;\n"; b += " diff.y = diff.y * uAspectRatio;\n"; b += " float distFromRingCenter = sqrt( (diff.x * diff.x) + (diff.y * diff.y) );\n"; b += " float factor = distFromRingCenter / uRingRadius;\n"; b += " if (distFromRingCenter > uRingRadius)\n"; b += " {\n"; b += "\t gl_FragColor = vec4(1.0, 1.0, 1.0, 0.0);\n"; b += " }\n"; b += " else\n"; b += " {\n"; b += " vec4 textureColor = texture2D(uSampler, vec2(factor / uAspectRatio, 0.5));\n"; b += " gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, uRingAlpha);\n"; b += " }\n"; b += "}\n"; a.shaderSource(m, b); a.compileShader(m); a.getShaderParameter(m, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(m)), m = null); Ra = a.createProgram(); a.attachShader(Ra, n); a.attachShader(Ra, m); a.linkProgram(Ra); a.getProgramParameter(Ra, a.LINK_STATUS) || alert("Could not initialise shaders"); Ra.u = a.getAttribLocation(Ra, "aVertexPosition"); var r = a.createShader(a.VERTEX_SHADER); b = ""; b += "attribute vec3 aVertexPosition;\n"; b += "attribute vec2 aTextureCoord;\n"; b += "varying vec2 vTextureCoord;\n"; b += "uniform bool uZoomIn;\n"; b += "uniform float uZoomFactor;\n"; b += "uniform vec2 uZoomCenter;\n"; b += "void main(void) {\n"; b += "\t gl_Position = vec4(aVertexPosition, 1.0);\n"; b += "\t if(!uZoomIn) {\n"; b += "\t \n"; b += "\t vTextureCoord = aTextureCoord;\n"; b += "\t }\n"; b += "\t else {\n"; b += "\t vTextureCoord = (aTextureCoord - vec2(0.5, 0.5)) * (1.0/uZoomFactor) + uZoomCenter;\n"; b += "\t }\n"; b += "}\n"; a.shaderSource(r, b); a.compileShader(r); a.getShaderParameter(r, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(r)), r = null); var t = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec2 vTextureCoord;\n"; b += "uniform float uAlpha;\n"; b += "uniform sampler2D uSampler;\n"; b += "void main(void) {\n"; b += " vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n"; b += " gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, uAlpha);\n"; b += "}\n"; a.shaderSource(t, b); a.compileShader(t); a.getShaderParameter(t, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(t)), t = null); Q = a.createProgram(); a.attachShader(Q, r); a.attachShader(Q, t); a.linkProgram(Q); a.getProgramParameter(Q, a.LINK_STATUS) || alert("Could not initialise shaders"); Q.u = a.getAttribLocation(Q, "aVertexPosition"); a.enableVertexAttribArray(Q.u); Q.N = a.getAttribLocation(Q, "aTextureCoord"); a.enableVertexAttribArray(Q.N); var u = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec2 vTextureCoord;\n"; b += "uniform float uColorPercent;\n"; b += "uniform float uAlpha;\n"; b += "uniform vec3 uDipColor;\n"; b += "uniform sampler2D uSampler;\n"; b += "void main(void) {\n"; b += " vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n"; b += " gl_FragColor = vec4(textureColor.x * (1.0 - uColorPercent) + uDipColor.x * uColorPercent, textureColor.y * (1.0 - uColorPercent) + uDipColor.y * uColorPercent, textureColor.z * (1.0 - uColorPercent) + uDipColor.z * uColorPercent, uAlpha);\n"; b += "}\n"; a.shaderSource(u, b); a.compileShader(u); a.getShaderParameter(u, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(u)), u = null); la = a.createProgram(); a.attachShader(la, r); a.attachShader(la, u); a.linkProgram(la); a.getProgramParameter(la, a.LINK_STATUS) || alert("Could not initialise shaders"); la.u = a.getAttribLocation(la, "aVertexPosition"); a.enableVertexAttribArray(la.u); la.N = a.getAttribLocation(la, "aTextureCoord"); a.enableVertexAttribArray(la.N); var v = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec2 vTextureCoord;\n"; b += "uniform bool uRound;\n"; b += "uniform float uRadius;\n"; b += "uniform vec2 uRectDim;\n"; b += "uniform vec2 uIrisCenter;\n"; b += "uniform sampler2D uSampler;\n"; b += "void main(void) {\n"; b += " vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n"; b += " float alpha = 0.0;\n"; b += " if (uRound) {\n"; b += "\t vec2 diff = uIrisCenter - gl_FragCoord.xy;\n"; b += "\t float distFromCenter = sqrt( (diff.x * diff.x) + (diff.y * diff.y) );\n"; b += "\t if (distFromCenter > uRadius) alpha = 1.0;\n"; b += " }\n"; b += " else {\n"; b += "\t if (gl_FragCoord.x < uIrisCenter.x - uRectDim.x || gl_FragCoord.x > uIrisCenter.x + uRectDim.x || gl_FragCoord.y < uIrisCenter.y - uRectDim.y || gl_FragCoord.y > uIrisCenter.y + uRectDim.y) alpha = 1.0;\n"; b += " }\n"; b += " gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, alpha);\n"; b += "}\n"; a.shaderSource(v, b); a.compileShader(v); a.getShaderParameter(v, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(v)), v = null); aa = a.createProgram(); a.attachShader(aa, r); a.attachShader(aa, v); a.linkProgram(aa); a.getProgramParameter(aa, a.LINK_STATUS) || alert("Could not initialise shaders"); aa.u = a.getAttribLocation(aa, "aVertexPosition"); a.enableVertexAttribArray(aa.u); aa.N = a.getAttribLocation(aa, "aTextureCoord"); a.enableVertexAttribArray(aa.N); var w = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "varying vec2 vTextureCoord;\n"; b += "uniform float uPercent;\n"; b += "uniform int uDirection;\n"; b += "uniform vec2 uCanvasDimensions;\n"; b += "uniform sampler2D uSampler;\n"; b += "void main(void) {\n"; b += " vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n"; b += " float alpha = 0.0;\n"; b += " if (uDirection == 1) {\n"; b += "\t if (gl_FragCoord.x > uPercent) alpha = 1.0;\n"; b += " }\n"; b += " else if (uDirection == 2) {\n"; b += "\t if (gl_FragCoord.x < uCanvasDimensions.x - uPercent) alpha = 1.0;\n"; b += " }\n"; b += " else if (uDirection == 3) {\n"; b += "\t if (gl_FragCoord.y < uCanvasDimensions.y - uPercent) alpha = 1.0;\n"; b += " }\n"; b += " else if (uDirection == 4) {\n"; b += "\t if (gl_FragCoord.y > uPercent) alpha = 1.0;\n"; b += " }\n"; b += " gl_FragColor = vec4(textureColor.x, textureColor.y, textureColor.z, alpha);\n"; b += "}\n"; a.shaderSource(w, b); a.compileShader(w); a.getShaderParameter(w, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(w)), w = null); ma = a.createProgram(); a.attachShader(ma, r); a.attachShader(ma, w); a.linkProgram(ma); a.getProgramParameter(ma, a.LINK_STATUS) || alert("Could not initialise shaders"); ma.u = a.getAttribLocation(ma, "aVertexPosition"); a.enableVertexAttribArray(ma.u); ma.N = a.getAttribLocation(ma, "aTextureCoord"); a.enableVertexAttribArray(ma.N); var x = a.createShader(a.VERTEX_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "attribute vec3 aVertexPosition;\n"; b += "uniform vec2 uCanvasDimensions;\n"; b += "void main(void) {\n"; b += " vec2 pointNorm = (aVertexPosition.xy / uCanvasDimensions) * 2.0 - vec2(1.0, 1.0);\n"; b += " gl_Position = vec4(pointNorm.x, pointNorm.y * -1.0, 0.0, 1.0);\n"; b += "}\n"; a.shaderSource(x, b); a.compileShader(x); a.getShaderParameter(x, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(x)), x = null); var y = a.createShader(a.FRAGMENT_SHADER); b = ""; b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; b += "precision highp float;\n"; b += "#else\n"; b += "precision mediump float;\n"; b += "#endif\n"; b += "uniform vec3 uColor;\n"; b += "uniform float uAlpha;\n"; b += "void main(void) {\n"; b += " gl_FragColor = vec4(uColor, uAlpha);\n"; a.shaderSource(y, b + "}\n"); a.compileShader(y); a.getShaderParameter(y, a.COMPILE_STATUS) || (alert(a.getShaderInfoLog(y)), y = null); Ab = a.createProgram(); a.attachShader(Ab, x); a.attachShader(Ab, y); a.linkProgram(Ab); a.getProgramParameter(Ab, a.LINK_STATUS) || alert("Could not initialise shaders"); Ab.u = a.getAttribLocation(Ab, "aVertexPosition"); a.enableVertexAttribArray(Ab.u); gf(fd); hf(); if (a && (rb = a.createFramebuffer())) { a.bindFramebuffer(a.FRAMEBUFFER, rb); rb.width = 1024; rb.height = 1024; Tb = a.createTexture(); a.bindTexture(a.TEXTURE_2D, Tb); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR); a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR); a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, rb.width, rb.height, 0, a.RGBA, a.UNSIGNED_BYTE, null); var z = a.createRenderbuffer(); a.bindRenderbuffer(a.RENDERBUFFER, z); a.renderbufferStorage(a.RENDERBUFFER, a.DEPTH_COMPONENT16, rb.width, rb.height); a.framebufferTexture2D(a.FRAMEBUFFER, a.COLOR_ATTACHMENT0, a.TEXTURE_2D, Tb, 0); a.framebufferRenderbuffer(a.FRAMEBUFFER, a.DEPTH_ATTACHMENT, a.RENDERBUFFER, z); a.bindTexture(a.TEXTURE_2D, null); a.bindRenderbuffer(a.RENDERBUFFER, null); a.bindFramebuffer(a.FRAMEBUFFER, null) } } } catch (B) { $a() } a ? pa = !0 : alert("Could not initialise WebGL!") }; var nb = [], we, fa = Gc(), Kb = Gc(), se, Gd, Hd, Ka, xb, Zb, Bc, Tb, rb; d.getPan = function () { return D }; d.getPanDest = function () { return rd }; d.getPanN = function () { for (var a = D; -180 > a;) a += 360; for (; 180 < a;) a -= 360; return a }; d.getPanNorth = function () { for (var a = D - Ae; -180 > a;) a += 360; for (; 180 < a;) a -= 360; return a }; d.setPan = function (a) { U(); isNaN(a) || (D = Number(a)); d.update() }; d.setPanNorth = function (a) { U(); isNaN(a) || (D = Number(a) + Ae); d.update() }; d.changePan = function (a, g) { d.setPan(d.getPan() + a); g && (N = a) }; d.changePanLog = function (a, g) { d.changePan(a * Sa(), g) }; d.getTilt = function () { return w }; d.getTiltDest = function () { return sd }; d.setTilt = function (a) { U(); isNaN(a) || (w = Number(a)); d.update() }; d.changeTilt = function (a, g) { d.setTilt(d.getTilt() + a); g && (ea = a) }; d.changeTiltLog = function (a, g) { d.changeTilt(a * Sa(), g) }; d.setRoll = function (a) { U(); isNaN(a) || (ya = Number(a)); d.update() }; d.getRoll = function () { return ya }; d.getFov = function () { return y }; d.getFovDest = function () { return 70 }; d.setFov = function (a) { U(); if (!isNaN(a) && 0 < a && 180 > a) { var g = y; y = Number(a); Sb(); g != y && d.update() } }; d.changeFov = function (a) { d.setFov(d.getFov() + a) }; d.changeFovLog = function (a, g) { if (!isNaN(a)) { var b; b = a / 90 * Math.cos(y * Math.PI / 360); b = y * Math.exp(b); d.setFov(b); g && (ca = a) } }; d.setPanTilt = function (a, g) { U(); isNaN(a) || (D = a); isNaN(g) || (w = g); d.update() }; d.setPanTiltFov = function (a, g, b) { U(); isNaN(a) || (D = a); isNaN(g) || (w = g); !isNaN(b) && 0 < b && 180 > b && (y = b); d.update() }; d.setDefaultView = function () { d.setPanTiltFov(ze, Be, xd) }; d.setLocked = function (a) { d.setLockedMouse(a); d.setLockedWheel(a); d.setLockedKeyboard(a) }; d.setLockedMouse = function (a) { V = a }; d.setLockedKeyboard = function (a) { Wc = a }; d.setLockedWheel = function (a) { oe = a }; d.moveTo = function (a, d, b, c, f) { U(); uc = !0; var h = a.toString().split("/"); 1 < h.length && (a = Number(h[0]), c = d, d = Number(h[1]), 2 < h.length && (b = Number(h[2]))); rd = isNaN(a) ? D : a; sd = isNaN(d) ? w : d; de = !isNaN(b) && 0 < b && 180 > b ? b : y; !isNaN(c) && 0 < c ? ee = c : ee = 1; isNaN(f) ? td = ya : td = f }; d.moveToDefaultView = function (a) { d.moveTo(ze, Be, xd, a) }; d.addHotspot = function (a, g, b, c) { var f = { type: "point", pan: 0, tilt: 0, url: "", target: "", id: "", skinid: "", w: 100, h: 20, wordwrap: !1, obj: null, Ea: null }; f.pan = g; f.tilt = b; f.id = a; f.obj = {}; f.obj.player = d; f.obj.hotspot = f; f.obj.__div = document.createElement("div"); f.obj.__div.appendChild(c); J.push(f); f.obj.__div.style.left = "-1000px"; f.obj.__div.style.top = "-1000px"; oa.insertBefore(f.obj.__div, oa.firstChild); d.dirty = !0 }; d.updateHotspot = function (a, g, b) { for (var c = 0; c < J.length; c++) { var f = J[c]; f.id == a && (f.pan = g, f.tilt = b) } d.dirty = !0 }; d.removeHotspot = function (a) { for (var d = -1, b = 0; b < J.length; b++) { var c = J[b]; c.id == a && (d = b) } -1 < d && (c = J.slice(d, 1)[0], c.obj && c.obj.__div && oa.removeChild(c.obj.__div)) }; d.getPointHotspotIds = function () { for (var a = [], d = 0; d < J.length; d++) { var b = J[d]; "point" == b.type && a.push(String(b.id)) } return a }; d.getHotspot = function (a) { for (var d = 0; d < J.length; d++) { var b = J[d]; if (b.id == a) return d = {}, d.id = a, d.pan = b.pan, d.tilt = b.tilt, b.obj && b.obj.__div && (d.div = b.obj.__div), d } }; d.getLastActivity = function () { return Sc }; var Fd = -1; d.isTouching = function () { return null != d.Z || 0 <= ra }; var Xa, Ed = 1; U(); var md = 0, $d = 0, ce = 0, Zd = 0, Ia; d.Rb = function () { var a; a = oa; d.control = a; Vb(); setTimeout(function () { lb() }, 10); setTimeout(function () { Nb() }, 200); setTimeout(function () { oc = !0; d.updatePanorama() }, 10); a.addEventListener && (a.addEventListener("touchstart", If, !1), a.addEventListener("touchmove", mc, !1), a.addEventListener("touchend", lc, !1), a.addEventListener("touchcancel", kc, !1), a.addEventListener("pointerdown", Bb, !1), a.addEventListener("MSPointerDown", Bb, !1), a.addEventListener("MSGestureStart", Pb, !1), a.addEventListener("MSGestureEnd", tc, !1), a.addEventListener("MSGestureChange", jc, !1), a.addEventListener("gesturestart", Pb, !1), a.addEventListener("gesturechange", Wb, !1), a.addEventListener("gestureend", tc, !1), a.addEventListener("mousedown", Lf, !1), a.addEventListener("mousemove", Kf, !1), document.addEventListener("mouseup", Jf, !1), a.addEventListener("mousedblclick", d.toggleFullscreen, !1), document.addEventListener("keydown", ic, !1), document.addEventListener("keyup", hc, !1), window.addEventListener("orientationchange", Vb, !1), window.addEventListener("resize", Qf, !1), window.addEventListener("blur", sc, !1), d.l.addEventListener("webkitfullscreenchange", Ta, !1), document.addEventListener("mozfullscreenchange", Ta, !1), window.addEventListener("webkitfullscreenchange", Ta, !1), document.addEventListener("MSFullscreenChange", Ta, !1)); a.oncontextmenu = function (a) { void 0 === a && (a = window.event); return a.ctrlKey ? !0 : (Aa(a.pageX - (d.isFullscreen ? 0 : d.Fa.offsetLeft), a.pageY - (d.isFullscreen ? 0 : d.Fa.offsetTop)), !1) } }; d.addHotspotElements = function () { for (var a = 0; a < J.length; a++) if ("point" == J[a].type && (J[a].obj = d.skinObj && d.skinObj.addSkinHotspot ? new d.skinObj.addSkinHotspot(J[a]) : new Rf(this, J[a]), J[a].obj.__div.style.left = "-1000px", J[a].obj.__div.style.top = "-1000px", J[a].obj && J[a].obj.__div)) { var g = oa.firstChild; g ? oa.insertBefore(J[a].obj.__div, g) : oa.appendChild(J[a].obj.__div) } }; d.isPlaying = function (a) { return "_main" == a ? !0 : (a = r(a)) ? !a.obj.ended && !a.obj.paused : !1 }; d.playSound = function (a, d) { var b = r(a); b && (b.obj.qa = d && !isNaN(Number(d)) ? Number(d) - 1 : b.loop - 1, -1 == b.obj.qa && (b.obj.qa = 1E7), b.obj.play()) }; d.playPauseSound = function (a) { d.isPlaying(a) ? d.pauseSound(a) : d.playSound(a, void 0) }; d.pauseSound = function (a) { if ("_main" == a) { for (a = 0; a < G.length; a++) G[a].obj.pause(); for (a = 0; a < F.length; a++) F[a].obj.pause() } else (a = r(a)) && a.obj.pause() }; d.activateSound = function (a, d) { var b = r(a); b && (0 == d || 1 == d ? b.Ma && b.Ma(1 == d) : 2 == d && b.fa && b.fa()) }; d.stopSound = function (a) { if ("_main" == a) { for (a = 0; a < G.length; a++) G[a].obj.pause(), G[a].obj.currentTime = 0; for (a = 0; a < F.length; a++) F[a].obj.pause(), F[a].obj.currentTime = 0 } else if (a = r(a)) a.obj.pause(), a.obj.currentTime = 0 }; d.setVolume = function (a, d) { var b = Number(d); 1 < b && (b = 1); 0 > b && (b = 0); "_video" == a && z && (z.volume = b); if ("_main" == a) { P = b; for (b = 0; b < G.length; b++) G[b].obj.volume = G[b].level * P; for (b = 0; b < F.length; b++) F[b].obj.volume = F[b].level * P; z && (z.volume = P) } else { var c = r(a); c && (c.level = b, c.obj.volume = b * P) } }; d.changeVolume = function (a, d) { var b; "_video" == a && z && (z.volume = z.volume + d); if ("_main" == a) { b = P; b += Number(d); 1 < b && (b = 1); 0 > b && (b = 0); P = b; for (b = 0; b < G.length; b++) G[b].obj.volume = G[b].level * P; for (b = 0; b < F.length; b++) F[b].obj.volume = F[b].level * P; z && (z.volume = P) } else { var c = r(a); c && (b = c.level, b += Number(d), 1 < b && (b = 1), 0 > b && (b = 0), c.level = b, c.obj.volume = b * P) } }; d.Nb = function () { for (var a = !1, g = !1, b = 0; b < G.length; b++) { var c = G[b]; -1 != c.loop && (d.j && nc && 4 != c.mode && 6 != c.mode ? wf ? (c.obj.play(), c.obj.currentTime = 0, c.m = 0, g = !0) : a = !0 : 4 == c.mode || 6 == c.mode || "_background" == c.id && d.isPlaying(c.id) || (c.obj.play(), c.obj.currentTime && (c.obj.currentTime = 0))) } a && setTimeout(d.ic, 1E3 * bb); g && (xf = d.j.currentTime, yf = setInterval(d.Vb, 10)) }; d.pb = function (a) { if (2 == a.mode || 3 == a.mode || 5 == a.mode) { var g = d.j.currentTime, b = a.G.gain.value, c = a.B.gain.value, f = a.C.gain.value; a.F.gain.linearRampToValueAtTime(a.F.gain.value, g); a.F.gain.linearRampToValueAtTime(0, g + bb); a.G.gain.linearRampToValueAtTime(b, g); a.G.gain.linearRampToValueAtTime(0, g + bb); a.B.gain.linearRampToValueAtTime(c, g); a.B.gain.linearRampToValueAtTime(0, g + bb); a.C.gain.linearRampToValueAtTime(f, g); a.C.gain.linearRampToValueAtTime(0, g + bb) } else g = d.j.currentTime, a.ea.gain.linearRampToValueAtTime(a.ea.gain.value, g), a.ea.gain.linearRampToValueAtTime(0, g + bb); a.zb = !0 }; d.ic = function () { for (var a = 0; a < G.length; a++) { var g = G[a]; d.isPlaying(g.id) || 4 == g.mode || 6 == g.mode || (g.obj.play(), g.obj.currentTime = 0) } }; d.Vb = function () { for (var a = (d.j.currentTime - xf) / bb, a = Math.min(1, a), g = 0; g < G.length; g++) { var b = G[g]; d.isPlaying(b.id) && 1 > b.m && (b.m = a) } 1 == a && clearInterval(yf) }; d.removeHotspots = function () { for (var a; 0 < J.length;) a = J.pop(), a.obj && (oa.removeChild(a.obj.__div), delete a.obj), a.obj = null }; d.ec = function () { for (; 0 < hd.length;) hd.pop() }; d.setFullscreen = function (a) { var g = d.isFullscreen != a; d.isFullscreen != a && (d.isFullscreen = a, d.update(100)); if (d.isFullscreen) { if (Qd) try { d.l.webkitRequestFullScreen ? d.l.webkitRequestFullScreen() : d.l.mozRequestFullScreen ? d.l.mozRequestFullScreen() : d.l.msRequestFullscreen ? d.l.msRequestFullscreen() : d.l.requestFullScreen ? d.l.requestFullScreen() : d.l.requestFullscreen && d.l.requestFullscreen() } catch (b) { $a() } d.l.style.position = "absolute"; a = Zc(); d.l.style.left = window.pageXOffset - a.x + Ba + "px"; d.l.style.top = window.pageYOffset - a.y + ua + "px"; document.body.style.overflow = "hidden"; g && d.divSkin && d.divSkin.ggEnterFullscreen && d.divSkin.ggEnterFullscreen() } else { if (Qd) try { document.webkitIsFullScreen ? document.webkitCancelFullScreen() : document.mozFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.fullScreen && (document.cancelFullScreen ? document.cancelFullScreen() : document.exitFullscreen && document.exitFullscreen()) } catch (c) { $a() } d.l.style.position = "relative"; d.l.style.left = "0px"; d.l.style.top = "0px"; document.body.style.overflow = ""; g && d.divSkin && d.divSkin.ggExitFullscreen && d.divSkin.ggExitFullscreen() } oc = !0 }; d.toggleFullscreen = function () { d.setFullscreen(!d.isFullscreen) }; d.enterFullscreen = function () { d.setFullscreen(!0) }; d.exitFullscreen = function () { d.setFullscreen(!1) }; d.startAutorotate = function (a, d, b) { sa = vb = !0; Eb = 0; Fb = (new Date).getTime(); a && 0 != a && (Gb = a); d && (vd = d); b && (wd = b) }; d.stopAutorotate = function () { vb = sa = !1 }; d.toggleAutorotate = function () { sa = vb = !sa; Eb = 0; vb && (Fb = (new Date).getTime()) }; d.createLayers = function (a) { d.Fa = document.getElementById(a); d.Fa ? (d.Fa.innerHTML = "", d.l = document.createElement("div"), a = "top:\t0px;left: 0px;position:relative;", a += "-ms-touch-action: none;", a += "touch-action: none;", a += "text-align: left;", a += va + "user-select: none;", d.l.setAttribute("style", a), d.Fa.appendChild(d.l), C = document.createElement("div"), a = "top:\t0px;left: 0px;", a += "width: 100px;", a += "height: 100px;", a += "overflow: hidden;", a += "position:absolute;", a += "-ms-touch-action: none;", a += "touch-action: none;", a += va + "user-select: none;", C.setAttribute("style", a), d.l.appendChild(C), Jb = document.createElement("canvas"), a = "top:\t0px;left: 0px;", a += "width: 100px;", a += "height: 100px;", a += "overflow: hidden;", a += "position:absolute;", a += "z-index: 900;", a += va + "user-select: none;", a += va + "pointer-events: none;", Jb.setAttribute("style", a), d.l.appendChild(Jb), oa = document.createElement("div"), a = "top:\t0px;left: 0px;", a += "width: 100px;", a += "height: 100px;", a += "overflow: hidden;", a += "position:absolute;", a += "z-index: 1000;", Sf && (a += "background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);"), cd && !pa && (a += va + "transform: translateZ(9999999px);"), a += va + "user-select: none;", oa.setAttribute("style", a), d.l.appendChild(oa), Da = document.createElement("canvas"), a = "top:\t0px;left: 0px;", a += "width: 100px;", a += "height: 100px;", a += "overflow: hidden;", a += "position:absolute;", a += "z-index: 900;", a += va + "user-select: none;", a += va + "pointer-events: none;", Da.setAttribute("style", a), d.l.appendChild(Da), X = document.createElement("div"), a = "top:\t0px;left: 0px;", a += "position:absolute;", a += "padding: 3px;", a += "visibility: hidden;", a += "z-index: 1100;", X.setAttribute("style", a), X.innerHTML = " Hotspot text!", d.l.appendChild(X), d.divSkin = oa) : alert("container not found!") }; d.yb = function (a) { var g, b, c, f = 128; l.Pa && (C.style.backgroundColor = l.Pa.replace("0x", "#")); a ? (f = gd, fd = 1) : yb > f && (f = yb); for (c = 0; 6 > c; c++) { b = d.O.J[c]; a ? (b.width = gd, b.height = gd) : (b.g = document.createElement("canvas"), b.g.width = yb, b.g.height = yb, b.width = yb, b.height = yb, b.v = b.g.getContext("2d")); g = "position:absolute;"; g += "left: 0px;"; g += "top: 0px;"; g += "width: " + f + "px;"; g += "height: " + f + "px;"; a && (g += "outline: 1px solid transparent;"); g += va + "transform-origin: 0% 0%;"; g += "-webkit-user-select: none;"; g += va + "transform: "; var h; h = ""; var k = 1; Jc && (k = 100); h = 4 > c ? h + ("rotateY(" + -90 * c + "deg)") : h + ("rotateX(" + (4 == c ? -90 : 90) + "deg)"); Jc && (h += " scale(" + k + ")"); h += " translate3d(" + -f / 2 + "px," + -f / 2 + "px," + -f * k / (2 * fd) + "px)"; g += h + ";"; b.Db = h; a || (b.g.setAttribute("style", g), C.insertBefore(b.g, C.firstChild)) } if (!a) { for (c = 0; 6 > c; c++) b = d.O.J[c], "" != vc[c] && (b.Ca = new Image, b.Ca.onload = n(b), b.Ca.setAttribute("src", Ma(vc[c])), d.checkLoaded.push(b.Ca)); for (c = 0; 6 > c; c++) b = d.O.J[c], b.loaded = !1, b.f = new Image, b.f.onload = n(b), b.f.setAttribute("src", Ma(Jd[c])), d.checkLoaded.push(b.f) } }; d.removePanorama = function () { var e; if ($b) { for (e = 0; e < d.O.J.length; e++) d.O.J[e].g && d.O.J[e].g.setAttribute && (d.O.J[e].g.setAttribute("src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYBgeACDAAADIAAE3iTbkAAAAAElFTkSuQmCC"), C.removeChild(d.O.J[e].g)); if (l.i) { for (e = 0; e < l.i.length; e++) { var g = l.i[e], b; for (b in g.s) if (g.s.hasOwnProperty(b)) { var c = g.s[b]; c.visible = !1; c.g && (c.v && (c.v.clear ? c.v.clear() : c.v.clearRect(0, 0, c.v.canvas.width, c.v.canvas.height)), jd.push(c.g)); c.f && delete c.f; c.na && a.deleteTexture(c.na); c.v = null; c.g = null; c.f = null } delete g.s } delete l.i; l.i = null } } if (a && nb) for (; 0 < nb.length;) b = nb.pop(), b.bc = !0, a.deleteTexture(b); for (e = 0; e < F.length; e++) C.removeChild(F[e].obj); for (e = 0; e < Ua.length; e++) C.removeChild(Ua[e].obj); t.Za = -1; Da.style.visibility = "hidden"; ac = 0; b = []; Kc = []; for (e = 0; e < G.length; e++) if (g = G[e], 0 == g.mode || 1 == g.mode || g.nc) b.push(g); else if (d.j && nc && d.isPlaying(g.id)) Kc.push(g), 1 != qa && 2 != qa && d.pb(g); else { try { g.obj.pause() } catch (f) { $a() } d.l.removeChild(g.obj) } G = b; F = []; Ua = []; z && (d.l.removeChild(z), z = null); Cd = Ic = !1 }; d.getScreenResolution = function () { var a = 1, d = -1 != navigator.userAgent.indexOf("Mac"); window.devicePixelRatio && d && (a = window.devicePixelRatio); return { w: screen.width * a, h: screen.height * a } }; d.getMaxScreenResolution = function () { var a = d.getScreenResolution(); return a.w > a.h ? a.w : a.h }; d.readConfigString = function (a, g) { var b = (new DOMParser).parseFromString(a, "text/xml"); d.readConfigXml(b, g) }; d.readConfigUrl = function (a, g, b) { try { var c; c = new XMLHttpRequest; c.open("GET", a, !1); c.send(null); if (c.responseXML) { var f = a.lastIndexOf("/"); 0 <= f && (Hb = a.substr(0, f + 1)); 2 <= arguments.length && null != g && (Hb = g); d.readConfigString(c.responseText, b) } else alert("Error loading panorama XML") } catch (h) { alert("Error:" + h) } }; d.readConfigUrlAsync = function (a, g, b, c) { try { var f; f = new XMLHttpRequest; f.open("GET", a, !0); f.onload = function (h) { if (4 <= f.readyState) if (f.responseXML) { var p = a.lastIndexOf("/"); 0 <= p && (Hb = a.substr(0, p + 1)); 3 <= arguments.length && null != b && (Hb = b); d.readConfigString(f.responseText, c); g && g() } else alert("Error loading panorama XML"); else console.error("Wrong state loading XML:" + f.statusText) }; f.onerror = function () { console.error("Error loading XML:" + f.statusText) }; f.send(null) } catch (h) { alert("Error:" + h) } }; var Td = !0; d.getCurrentNode = function () { return Ha }; d.getNextNode = function () { if (0 < ia.length) { var a; a = ia.indexOf(Ha); a++; a >= ia.length && (a = 0); return ia[a] } return "" }; d.getPrevNode = function () { if (0 < ia.length) { var a; a = ia.indexOf(Ha); a--; 0 > a && (a = ia.length - 1); return ia[a] } return "" }; d.nodeVisited = function (a) { return -1 != Xd.indexOf(a) }; d.readConfigXml = function (a, g) { var b = a.firstChild; qc = []; ia = []; if ("tour" == b.nodeName) { var c = "", f; (f = b.getAttributeNode("start")) && (c = f.nodeValue.toString()); "" != d.startNode && (c = d.startNode, d.startNode = ""); for (b = b.firstChild; b;) f = "", "panorama" == b.nodeName && (f = b.getAttributeNode("id")) && (f = f.nodeValue.toString(), "" == c && (c = f), qc[f] = b, ia.push(f)), b = b.nextSibling; d.sb(qc[c], g); k("{" + c + "}"); d.ib = !0 } else d.ib = !1, d.sb(b, g), k(""), ia.push("") }; d.sb = function (e, g) { d.removeHotspots(); d.ec(); d.hotspot = d.emptyHotspot; d.removePanorama(); d.$a = 0; for (var b = e.firstChild, c, f, h, k, n = 0; b;) { if ("view" == b.nodeName) for ((f = b.getAttributeNode("fovmode")) && (Ce = Number(f.nodeValue)), f = b.getAttributeNode("pannorth"), Ae = 1 * (f ? f.nodeValue : 0), c = b.firstChild; c;) "start" == c.nodeName && (f = c.getAttributeNode("pan"), ze = D = Number(f ? f.nodeValue : 0), f = c.getAttributeNode("tilt"), Be = w = Number(f ? f.nodeValue : 0), f = c.getAttributeNode("roll"), ya = Number(f ? f.nodeValue : 0), f = c.getAttributeNode("fov"), xd = y = Number(f ? f.nodeValue : 70)), "min" == c.nodeName && (f = c.getAttributeNode("pan"), Qb = 1 * (f ? f.nodeValue : 0), f = c.getAttributeNode("tilt"), Ya = 1 * (f ? f.nodeValue : -90), f = c.getAttributeNode("fov"), Na = 1 * (f ? f.nodeValue : 5), 1E-20 > Na && (Na = 1E-20), f = c.getAttributeNode("fovpixel"), xe = 1 * (f ? f.nodeValue : 0)), "max" == c.nodeName && (f = c.getAttributeNode("pan"), hb = 1 * (f ? f.nodeValue : 0), f = c.getAttributeNode("tilt"), ka = 1 * (f ? f.nodeValue : 90), f = c.getAttributeNode("fov"), ta = 1 * (f ? f.nodeValue : 120), 180 <= ta && (ta = 179.9)), c = c.nextSibling; "autorotate" == b.nodeName && ((f = b.getAttributeNode("speed")) && (Gb = 1 * f.nodeValue), (f = b.getAttributeNode("delay")) && (vd = 1 * f.nodeValue), (f = b.getAttributeNode("returntohorizon")) && (wd = 1 * f.nodeValue), (f = b.getAttributeNode("nodedelay")) && (ge = 1 * f.nodeValue), (f = b.getAttributeNode("noderandom")) && (fe = 1 == f.nodeValue), Td && (vb = !0, sa = !1), (f = b.getAttributeNode("startloaded")) && (qd = 1 == f.nodeValue) && (sa = !1), (f = b.getAttributeNode("useanimation")) && (He = 1 == f.nodeValue)); if ("animation" == b.nodeName) for (Rb = [], c = b.firstChild; c;) { if ("clip" == c.nodeName) { B = {}; (f = c.getAttributeNode("animtitle")) && (B.animtitle = f.nodeValue.toString()); (f = c.getAttributeNode("cliptitle")) && (B.cliptitle = f.nodeValue.toString()); (f = c.getAttributeNode("nodeid")) && (B.nodeid = f.nodeValue.toString()); (f = c.getAttributeNode("length")) && (B.length = Number(f.nodeValue)); (f = c.getAttributeNode("animtype")) && (B.animtype = Number(f.nodeValue)); (f = c.getAttributeNode("nextcliptitle")) && (B.nextcliptitle = f.nodeValue.toString()); (f = c.getAttributeNode("nextclipnodeid")) && (B.nextclipnodeid = f.nodeValue.toString()); (f = c.getAttributeNode("transitiontype")) && (B.transitiontype = Number(f.nodeValue)); m = c.firstChild; for (B.keyframes = []; m;) { if ("keyframe" == m.nodeName) { h = {}; (f = m.getAttributeNode("time")) && (h.time = Number(f.nodeValue)); (f = m.getAttributeNode("value")) && (h.value = Number(f.nodeValue)); f = m.getAttributeNode("type"); var q = 0; f && (h.type = Number(f.nodeValue), q = Number(f.nodeValue)); (f = m.getAttributeNode("property")) && (h.property = Number(f.nodeValue)); if (1 == q || 2 == q) (f = m.getAttributeNode("bezierintime")) && (h.bezierintime = Number(f.nodeValue)), (f = m.getAttributeNode("bezierinvalue")) && (h.bezierinvalue = Number(f.nodeValue)), (f = m.getAttributeNode("bezierouttime")) && (h.bezierouttime = Number(f.nodeValue)), (f = m.getAttributeNode("bezieroutvalue")) && (h.bezieroutvalue = Number(f.nodeValue)); B.keyframes.push(h) } m = m.nextSibling } d.xa == B.cliptitle && d.setPanTiltFov(B.keyframes[0].value, B.keyframes[1].value, B.keyframes[2].value); Rb.push(B) } c = c.nextSibling } "input" == b.nodeName && (k || (k = b)); if (k) for (c = 0; 6 > c; c++) f = k.getAttributeNode("prev" + c + "url"), vc[c] = f ? String(f.nodeValue) : ""; "altinput" == b.nodeName && (c = 0, (f = b.getAttributeNode("screensize")) && (c = 1 * f.nodeValue), 0 < c && c <= d.getMaxScreenResolution() && c > n && (n = c, k = b)); if ("control" == b.nodeName && Td) { (f = b.getAttributeNode("simulatemass")) && (ae = 1 == f.nodeValue); (f = b.getAttributeNode("locked")) && (V = 1 == f.nodeValue); f && (Wc = 1 == f.nodeValue); (f = b.getAttributeNode("lockedmouse")) && (V = 1 == f.nodeValue); (f = b.getAttributeNode("lockedkeyboard")) && (Wc = 1 == f.nodeValue); (f = b.getAttributeNode("lockedkeyboardzoom")) && (be = 1 == f.nodeValue); (f = b.getAttributeNode("lockedwheel")) && (oe = 1 == f.nodeValue); (f = b.getAttributeNode("invertwheel")) && ($e = 1 == f.nodeValue); (f = b.getAttributeNode("speedwheel")) && (af = 1 * f.nodeValue); (f = b.getAttributeNode("invertcontrol")) && (Va = 1 == f.nodeValue); if (f = b.getAttributeNode("sensitivity")) Cb = 1 * f.nodeValue, 1 > Cb && (Cb = 1); (f = b.getAttributeNode("dblclickfullscreen")) && (me = 1 == f.nodeValue); (f = b.getAttributeNode("contextfullscreen")) && (ld = 1 == f.nodeValue); (f = b.getAttributeNode("hideabout")) && (kd = 1 == f.nodeValue); for (c = b.firstChild; c;) "menulink" == c.nodeName && (m = { text: "", url: "" }, f = c.getAttributeNode("text"), m.text = f.nodeValue, f = c.getAttributeNode("url"), m.url = f.nodeValue, Lc.push(m)), c = c.nextSibling } if ("transition" == b.nodeName) { (f = b.getAttributeNode("enabled")) && (ud = 1 == f.nodeValue); if (f = b.getAttributeNode("blendtime")) Le = f.nodeValue; (f = b.getAttributeNode("blendcolor")) && (Md = f.nodeValue.toString()); (f = b.getAttributeNode("type")) && (da = f.nodeValue.toString()); if (f = b.getAttributeNode("zoomin")) qa = f.nodeValue; if (f = b.getAttributeNode("zoomout")) Wa = f.nodeValue; if (f = b.getAttributeNode("zoomfov")) Pd = f.nodeValue; if (f = b.getAttributeNode("zoomspeed")) Uc = f.nodeValue; (f = b.getAttributeNode("zoomoutpause")) && (yd = 1 == f.nodeValue) } "soundstransition" == b.nodeName && ((f = b.getAttributeNode("enabled")) && (nc = 1 == f.nodeValue), (f = b.getAttributeNode("transitiontime")) && (bb = 1 * f.nodeValue), (f = b.getAttributeNode("crossfade")) && (wf = 1 == f.nodeValue)); "userdata" == b.nodeName && (d.userdata = x(b)); if ("hotspots" == b.nodeName) for (c = b.firstChild; c;) { if ("label" == c.nodeName) { m = t.vb; if (f = c.getAttributeNode("enabled")) m.enabled = 1 == f.nodeValue; if (f = c.getAttributeNode("width")) m.width = 1 * f.nodeValue; if (f = c.getAttributeNode("height")) m.height = 1 * f.nodeValue; if (f = c.getAttributeNode("textcolor")) m.wb = 1 * f.nodeValue; if (f = c.getAttributeNode("textalpha")) m.ub = 1 * f.nodeValue; if (f = c.getAttributeNode("background")) m.background = 1 == f.nodeValue; if (f = c.getAttributeNode("backgroundalpha")) m.ba = 1 * f.nodeValue; if (f = c.getAttributeNode("backgroundcolor")) m.U = 1 * f.nodeValue; if (f = c.getAttributeNode("border")) m.nb = 1 * f.nodeValue; if (f = c.getAttributeNode("bordercolor")) m.V = 1 * f.nodeValue; if (f = c.getAttributeNode("borderalpha")) m.ca = 1 * f.nodeValue; if (f = c.getAttributeNode("borderradius")) m.mb = 1 * f.nodeValue; if (f = c.getAttributeNode("wordwrap")) m.wordwrap = 1 == f.nodeValue } if ("polystyle" == c.nodeName) { if (f = c.getAttributeNode("mode")) t.mode = 1 * f.nodeValue; if (f = c.getAttributeNode("bordercolor")) t.V = 1 * f.nodeValue; if (f = c.getAttributeNode("backgroundcolor")) t.U = 1 * f.nodeValue; if (f = c.getAttributeNode("borderalpha")) t.ca = 1 * f.nodeValue; if (f = c.getAttributeNode("backgroundalpha")) t.ba = 1 * f.nodeValue } "hotspot" == c.nodeName && (m = { type: "point", pan: 0, tilt: 0, url: "", target: "", id: "", skinid: "", w: 100, h: 20, wordwrap: !1, obj: null, Ea: null }, f = c.getAttributeNode("pan"), m.pan = 1 * (f ? f.nodeValue : 0), f = c.getAttributeNode("tilt"), m.tilt = 1 * (f ? f.nodeValue : 0), (f = c.getAttributeNode("url")) && (m.url = f.nodeValue.toString()), (f = c.getAttributeNode("target")) && (m.target = f.nodeValue.toString()), (f = c.getAttributeNode("title")) && (m.title = f.nodeValue.toString()), (f = c.getAttributeNode("description")) && (m.description = f.nodeValue.toString()), (f = c.getAttributeNode("id")) && (m.id = f.nodeValue.toString()), (f = c.getAttributeNode("skinid")) && (m.skinid = f.nodeValue.toString()), (f = b.getAttributeNode("width")) && (m.w = f.nodeValue.toString()), (f = b.getAttributeNode("height")) && (m.h = f.nodeValue.toString()), (f = b.getAttributeNode("wordwrap")) && (m.wordwrap = 1 == f.nodeValue), J.push(m)); if ("polyhotspot" == c.nodeName) { m = { type: "poly", url: "", target: "", id: "", skinid: "", w: 100, h: 20, wordwrap: !1, obj: null, A: 0, I: 0, V: 255, ca: 1, U: 255, ba: .3, Ea: [] }; (f = c.getAttributeNode("url")) && (m.url = f.nodeValue.toString()); (f = c.getAttributeNode("target")) && (m.target = f.nodeValue.toString()); (f = c.getAttributeNode("title")) && (m.title = f.nodeValue.toString()); (f = c.getAttributeNode("description")) && (m.description = f.nodeValue.toString()); (f = c.getAttributeNode("id")) && (m.id = f.nodeValue.toString()); m.V = t.V; m.U = t.U; m.ca = t.ca; m.ba = t.ba; if (f = c.getAttributeNode("bordercolor")) m.V = 1 * f.nodeValue; if (f = c.getAttributeNode("backgroundcolor")) m.U = 1 * f.nodeValue; if (f = c.getAttributeNode("borderalpha")) m.ca = 1 * f.nodeValue; if (f = c.getAttributeNode("backgroundalpha")) m.ba = 1 * f.nodeValue; m.Ea = []; for (h = c.firstChild; h;) "vertex" == h.nodeName && (q = { pan: 0, tilt: 0 }, f = h.getAttributeNode("pan"), q.pan = 1 * (f ? f.nodeValue : 0), f = h.getAttributeNode("tilt"), q.tilt = 1 * (f ? f.nodeValue : 0), m.Ea.push(q)), h = h.nextSibling; J.push(m) } c = c.nextSibling } if ("sounds" == b.nodeName || "media" == b.nodeName) for (c = b.firstChild; c;) { if ("sound" == c.nodeName) { h = { id: "", loop: 0, level: 1, T: 0, mode: 1, Ta: 10, pan: 0, tilt: 0, H: 0, Ja: 0, m: 1, url: [] }; if (f = c.getAttributeNode("id")) h.id = f.nodeValue.toString(); (f = c.getAttributeNode("url")) && h.url.push(f.nodeValue.toString()); if (f = c.getAttributeNode("level")) h.level = Number(f.nodeValue); if (f = c.getAttributeNode("loop")) h.loop = Number(f.nodeValue); if (f = c.getAttributeNode("mode")) h.mode = Number(f.nodeValue); if (f = c.getAttributeNode("field")) h.Ta = Number(f.nodeValue); if (f = c.getAttributeNode("ambientlevel")) h.T = Number(f.nodeValue); if (f = c.getAttributeNode("pan")) h.pan = Number(f.nodeValue); if (f = c.getAttributeNode("tilt")) h.tilt = Number(f.nodeValue); if (f = c.getAttributeNode("pansize")) h.H = Number(f.nodeValue); if (f = c.getAttributeNode("tiltsize")) h.Ja = Number(f.nodeValue); for (var m = c.firstChild; m;) "source" == m.nodeName && (f = m.getAttributeNode("url")) && h.url.push(f.nodeValue.toString()), m = m.nextSibling; T(h) } if ("video" == c.nodeName) { h = { id: "", poster: "", loop: 0, level: 1, T: 0, mode: 1, Ta: 10, pan: 0, tilt: 0, H: 0, Ja: 0, m: 1, D: 0, L: 0, Y: 0, Ha: 50, sa: 0, ma: 100, pa: 100, va: 1, url: [] }; if (f = c.getAttributeNode("id")) h.id = f.nodeValue.toString(); (f = c.getAttributeNode("url")) && h.url.push(f.nodeValue.toString()); if (f = c.getAttributeNode("poster")) h.poster = String(f.nodeValue); if (f = c.getAttributeNode("level")) h.level = Number(f.nodeValue); if (f = c.getAttributeNode("loop")) h.loop = Number(f.nodeValue); if (f = c.getAttributeNode("mode")) h.mode = Number(f.nodeValue); if (f = c.getAttributeNode("field")) h.Ta = Number(f.nodeValue); if (f = c.getAttributeNode("ambientlevel")) h.T = Number(f.nodeValue); if (f = c.getAttributeNode("pan")) h.pan = Number(f.nodeValue); if (f = c.getAttributeNode("tilt")) h.tilt = Number(f.nodeValue); if (f = c.getAttributeNode("pansize")) h.H = Number(f.nodeValue); if (f = c.getAttributeNode("tiltsize")) h.Ja = Number(f.nodeValue); if (f = c.getAttributeNode("rotx")) h.D = Number(f.nodeValue); if (f = c.getAttributeNode("roty")) h.L = Number(f.nodeValue); if (f = c.getAttributeNode("rotz")) h.Y = Number(f.nodeValue); if (f = c.getAttributeNode("fov")) h.Ha = Number(f.nodeValue); if (f = c.getAttributeNode("width")) h.ma = Number(f.nodeValue); if (f = c.getAttributeNode("height")) h.pa = Number(f.nodeValue); f = c.getAttributeNode("stretch"); h.va = f ? Number(f.nodeValue) : 1; if (f = c.getAttributeNode("clickmode")) h.sa = Number(f.nodeValue); for (m = c.firstChild; m;) "source" == m.nodeName && (f = m.getAttributeNode("url")) && h.url.push(f.nodeValue.toString()), m = m.nextSibling; L(h) } if ("image" == c.nodeName) { h = { id: "", url: "", loop: 0, level: 1, T: 0, mode: 1, Ta: 10, pan: 0, tilt: 0, H: 0, Ja: 0, D: 0, L: 0, Y: 0, Ha: 50, sa: 0, ma: 100, pa: 100, va: 1 }; if (f = c.getAttributeNode("id")) h.id = f.nodeValue.toString(); if (f = c.getAttributeNode("url")) h.url = f.nodeValue.toString(); if (f = c.getAttributeNode("pan")) h.pan = Number(f.nodeValue); if (f = c.getAttributeNode("tilt")) h.tilt = Number(f.nodeValue); if (f = c.getAttributeNode("rotx")) h.D = Number(f.nodeValue); if (f = c.getAttributeNode("roty")) h.L = Number(f.nodeValue); if (f = c.getAttributeNode("rotz")) h.Y = Number(f.nodeValue); if (f = c.getAttributeNode("fov")) h.Ha = Number(f.nodeValue); if (f = c.getAttributeNode("width")) h.ma = Number(f.nodeValue); if (f = c.getAttributeNode("height")) h.pa = Number(f.nodeValue); f = c.getAttributeNode("stretch"); h.va = f ? Number(f.nodeValue) : 1; if (f = c.getAttributeNode("clickmode")) h.sa = Number(f.nodeValue); for (m = c.firstChild; m;) "source" == m.nodeName && (f = m.getAttributeNode("url")) && (h.url = f.nodeValue.toString()), m = m.nextSibling; u(h) } if ("lensflare" == c.nodeName) { h = { id: "", pan: 0, tilt: 0, xb: 50, alpha: 50, type: 0, color: 16777215 }; if (f = c.getAttributeNode("id")) h.id = f.nodeValue.toString(); if (f = c.getAttributeNode("pan")) h.pan = Number(f.nodeValue); if (f = c.getAttributeNode("tilt")) h.tilt = Number(f.nodeValue); if (f = c.getAttributeNode("blinding")) h.xb = Number(f.nodeValue); if (f = c.getAttributeNode("alpha")) h.alpha = Number(f.nodeValue); if (f = c.getAttributeNode("type")) h.type = Number(f.nodeValue); if (f = c.getAttributeNode("color")) h.color = 1 * f.nodeValue; hd.push(h) } c = c.nextSibling } b = b.nextSibling } g && "" != g && (b = g.toString().split("/"), 0 < b.length && (f = String(b[0]), "N" == f.charAt(0) ? d.setPanNorth(Number(f.substr(1))) : "S" == f.charAt(0) ? d.setPanNorth(-180 + Number(f.substr(1))) : d.setPan(Number(f))), 1 < b.length && d.setTilt(Number(b[1])), 2 < b.length && d.setFov(Number(b[2]))); if (k) { for (c = 0; 6 > c; c++) (f = k.getAttributeNode("tile" + c + "url")) && (Jd[c] = String(f.nodeValue)), f = k.getAttributeNode("tile" + c + "url1"); for (c = 0; 6 > c; c++) (f = k.getAttributeNode("prev" + c + "url")) && (vc[c] = String(f.nodeValue)); (f = k.getAttributeNode("tilesize")) && (yb = 1 * f.nodeValue); (f = k.getAttributeNode("canvassize")) && (gd = Number(f.nodeValue)); (f = k.getAttributeNode("tilescale")) && (fd = 1 * f.nodeValue); if (f = k.getAttributeNode("leveltileurl")) l.Jb = f.nodeValue; if (f = k.getAttributeNode("leveltilesize")) l.o = Number(f.nodeValue); if (f = k.getAttributeNode("levelbias")) l.Ib = Number(f.nodeValue); f = k.getAttributeNode("overlap"); Ca.Da = 0; Ca.pitch = 0; f && (l.P = Number(f.nodeValue)); if (f = k.getAttributeNode("levelingroll")) Ca.Da = Number(f.nodeValue); if (f = k.getAttributeNode("levelingpitch")) Ca.pitch = Number(f.nodeValue); ac = 0; (f = k.getAttributeNode("flat")) && 1 == f.nodeValue && (ac = 2); f = k.getAttributeNode("width"); l.width = 1 * (f ? f.nodeValue : 1); f = k.getAttributeNode("height"); l.height = 1 * (f ? f.nodeValue : l.width); dd = []; l.i = []; for (c = k.firstChild; c;) { if ("preview" == c.nodeName) { if (f = c.getAttributeNode("color")) l.Pa = f.nodeValue; if (f = c.getAttributeNode("strip")) l.Lb = 1 == f.nodeValue } if ("video" == c.nodeName) for (f = c.getAttributeNode("format"), (f = c.getAttributeNode("bleed")) && (Nd = Number(f.nodeValue)), (f = c.getAttributeNode("endaction")) && (ed = String(f.nodeValue)), f = c.getAttributeNode("width"), f = c.getAttributeNode("height"), m = c.firstChild; m;) "source" == m.nodeName && (f = m.getAttributeNode("url")) && dd.push(f.nodeValue.toString()), m = m.nextSibling; if ("level" == c.nodeName) { k = { width: 0, height: 0, cache: !1, rb: !1, M: 0, ja: 0, s: [] }; f = c.getAttributeNode("width"); k.width = 1 * (f ? f.nodeValue : 1); f = c.getAttributeNode("height"); k.height = 1 * (f ? f.nodeValue : k.width); if (f = c.getAttributeNode("preload")) k.cache = 1 == f.nodeValue; if (f = c.getAttributeNode("preview")) k.rb = 1 == f.nodeValue; k.M = Math.floor((k.width + l.o - 1) / l.o); k.ja = Math.floor((k.height + l.o - 1) / l.o); l.i.push(k) } c = c.nextSibling } l.Gb = l.i.length } Qc && (pa = $b = !1, zb || ($a(), zb = document.createElement("canvas"), zb.width = 100, zb.height = 100, zb.id = "dummycanvas", C.appendChild(zb)), Ac()); pa && a && (gf(fd), hf()); $b && (0 < l.i.length ? d.yb(!0) : d.yb(), d.$a = 0); 0 < l.i.length && l.Lb && 0 == ac && (f = new Image, f.onload = Of(f), f.setAttribute("src", Kd(6, l.i.length - 1, 0, 0))); if (0 < dd.length) { z = document.createElement("video"); z.setAttribute("style", "display: none; max-width:none;"); z.dc = !0; z.volume = P; d.l.appendChild(z); Ic = !1; z.oncanplay = function () { if (!Ic) { Cd = !0; var b, c, d, e, f, g, h, k = [], l = new Ga, m = z.videoWidth / 3; for (b = 0; 6 > b; b++) for (e = b % 3 * m + Nd, g = e + m - 2 * Nd, f = 4, 3 <= b && (f += m), h = f + m - 2 * Nd, d = 0; 4 > d; d++) { l.x = -1; l.y = -1; l.z = 1; for (c = 0; c < d; c++) l.Mb(); k.push((0 < l.x ? e : g) / (3 * m), (0 < l.y ? f : h) / (2 * m)) } a.bindBuffer(a.ARRAY_BUFFER, Id); a.bufferData(a.ARRAY_BUFFER, new Float32Array(k), a.STATIC_DRAW) } }; "exit" == ed ? z.onended = function () { Ic = Cd = !1; d.l.removeChild(z); z = null } : "stop" == ed ? z.onended = function () { } : "{" == ed[0] ? z.onended = function () { d.openNext(ed, "$fwd") } : z.loop = !0; for (c = 0; c < dd.length; c++) f = document.createElement("source"), f.setAttribute("src", Ma(dd[c])), z.appendChild(f); z.play() } d.addHotspotElements(); d.ya || d.Nb(); d.update(); Td && d.divSkin && d.divSkin.ggViewerInit && d.divSkin.ggViewerInit(); Td = !1; d.hasConfig = !0; Ac() }; d.openUrl = function (a, g) { 0 < a.length && (".xml" == a.substr(a.length - 4) || ".swf" == a.substr(a.length - 4) || "{" == a.charAt(0) ? d.openNext(Ma(a), g) : window.open(Ma(a), g)) }; d.openNext = function (e, g) { d.isLoaded = !1; d.hasConfig = !1; d.checkLoaded = []; pd = 0; d.divSkin && d.divSkin.ggReLoaded && d.divSkin.ggReLoaded(); d.skinObj && d.skinObj.hotspotProxyOut && d.skinObj.hotspotProxyOut(d.hotspot.id); ".swf" == e.substr(e.length - 4) && (e = e.substr(0, e.length - 4) + ".xml"); var b = ""; g && (b = g.toString()); b = b.replace("$cur", D + "/" + w + "/" + y); b = b.replace("$fwd", "N" + d.getPanNorth() + "/" + w + "/" + y); b = b.replace("$bwd", "S" + d.getPanNorth() + "/" + w + "/" + y); b = b.replace("$ap", String(D)); b = b.replace("$an", d.getPanNorth()); b = b.replace("$at", String(w)); b = b.replace("$af", String(y)); if ("" != b) { var c = b.split("/"); 3 < c.length && "" != c[3] && (d.startNode = c[3]) } U(); if ("{" == e.charAt(0)) if (c = e.substr(1, e.length - 2), qc[c]) { if (0 == ac && ud && pa && rb) { d.Ka || d.ya || (Me = V, Ne = Wc, d.setLockedMouse(!0), d.setLockedKeyboard(!0)); var f; "wipeleftright" == da ? f = 1 : "wiperightleft" == da ? f = 2 : "wipetopbottom" == da ? f = 3 : "wipebottomtop" == da ? f = 4 : "wiperandom" == da && (f = Math.ceil(4 * Math.random())); ye = f; a.bindFramebuffer(a.FRAMEBUFFER, rb); a.viewport(0, 0, rb.width, rb.height); a.clear(a.COLOR_BUFFER_BIT | a.DEPTH_BUFFER_BIT); d.Qa = !0; d.updatePanorama(); d.Qa = !1; a.bindFramebuffer(a.FRAMEBUFFER, null); a.viewport(0, 0, a.aa, a.$); f = new Date; d.hotspot != d.emptyHotspot ? ($c = d.hotspot.X / E, ad = 1 - d.hotspot.R / v) : ad = $c = .5; 1 != qa && 2 != qa ? (he = f.getTime(), d.Ka = !0) : (Ie = f.getTime(), d.ya = !0, S = Math.sin(d.getVFov() / 2 * Math.PI / 180) / Math.sin(Pd / 2 * Math.PI / 180), S = Math.max(S, 1), Je = 1 / Uc * S * .3) } d.sb(qc[c], b); k(e); ud && pa && (1 == Wa || 2 == Wa || 3 == Wa) && (zd = d.getPan(), Ad = d.getTilt(), Bd = d.getVFov(), 1 == Wa || 3 == Wa ? d.setVFov(Pd) : d.setVFov(d.getFov() + (d.getFov() - Pd)), yd || 1 == qa || 2 == qa || d.moveTo(zd, Ad, Bd, Uc)) } else { Dd("invalid node id: " + c); return } else d.readConfigUrl(e, null, b); d.update(5) }; d.getNodeIds = function () { return ia.slice(0) }; d.getNodeUserdata = function (a) { if (!a) return d.userdata; if (a = qc[a]) for (a = a.firstChild; a;) { if ("userdata" == a.nodeName) return x(a); a = a.nextSibling } return x() }; d.getNodeLatLng = function (a) { a = d.getNodeUserdata(a); var g = []; "" != a.latitude && 0 != a.latitude && 0 != a.longitude && (g.push(a.latitude), g.push(a.longitude)); return g }; d.getNodeTitle = function (a) { return d.getNodeUserdata(a).title }; d.Bb = function (a, d) { var b; for (b = 0; b < B.keyframes.length; b++) if (B.keyframes[b].time == a && B.keyframes[b].property == d) return B.keyframes[b]; return !1 }; d.Wb = function (a) { var d, b = 1E5, c = a, f = !1; for (d = 0; d < B.keyframes.length; d++) B.keyframes[d].property == a.property && B.keyframes[d].time > a.time && B.keyframes[d].time < b && (c = B.keyframes[d], b = c.time, f = !0); return f ? c : !1 }; d.videoPanoPlay = function () { z && z.play() }; d.videoPanoStop = function () { z && (z.pause(), z.time = 0) }; d.videoPanoPause = function () { z && z.pause() }; d.setVideoPanoTime = function (a) { z && (0 > a && (a = 0), a > z.duration && (a = z.duration - .1), z.currentTime = a, d.update()) }; d.getVideoPanoTime = function () { return z ? z.currentTime : 0 }; d.getVideoPanoObject = function () { if (z) return z }; //Custom function added by Amarjit :-) d.getHotspotsReference = function () { return J; } d.setHotspotReference = function (HotspotsArr) { J = HotspotsArr.slice(0); } d.detectBrowser(); d.createLayers(h); d.Rb() } window.ggHasHtml5Css3D = Wd; window.ggHasWebGL = Fe; window.pano2vrPlayer = pano2vrPlayer;