<!DOCTYPE html>
<html>

  <head>
    <link rel="stylesheet" href="style.css">
    <script src="Panorado_min.js" type="text/javascript"></script>
    <script src="script.js"></script>
  </head>

  <body>
    <canvas id="ViewerCanvas" style="width:800px;height:450px">
    Please update your browser for HTML5 support!
  </canvas>
  </body>

</html>
// Code goes here

window.onload = function() {
    Viewer = new PanoradoJS(document.getElementById("ViewerCanvas"));
    Viewer.image = {
      src: 'http://tours.imagemaker360.com/media/virtualtours/panoramicimages/1053283.jpg',
      projection: 'flat'
    };
  }
/* Styles go here */

/*


 Panorado JS - Panoramic Viewer for HTML5
 (c) 2012-2014 by Karl Maloszek - Simple Software
 http://www.panorado.com/en/PanoradoJs.php
 Use is free on private (non-commercial) websites.
 This is not public domain software!
 Comments are welcome.

*/

function PanoradoJS(Rc) {
  var fb, Sc, Cb, t, hc, ic, Wb, gb, Tc, jc, kc, hb, Aa, ca, Xb, da, Yb, Ba, ma, Wa, Xa, Ya, Ca, Da, ib, jb, na;

  function Zb() {
    v();
    var a = "-- Viewer:\nPanorado JS v. " + fb + "\n" + Sc + "\n\n",
      a = a + ("-- Browser:\n" + navigator.appName + "\n" + navigator.appVersion + "\n" + navigator.platform + "\n\n"),
      a = a + "-- WebGL:\n",
      a = Q ? f ? a + (f.getParameter(f.VERSION) + "\n" + f.getParameter(f.VENDOR) + "\n" + f.getParameter(f.RENDERER) + "\n" + f.getParameter(f.SHADING_LANGUAGE_VERSION)) : a + "Drawing context not available" : a + "Currently not used";
    m();
    setTimeout(function() {
      alert(a)
    }, 0)
  }

  function vc(a, h) {
    if (!d) {
      oa = a.style.backgroundColor ? a.style.backgroundColor : "";
      var c = oa.match(/\d+/g);
      if (!c || 3 != c.length) oa = "rgb(32, 32, 32)"
    }
    f && (delete f, f = null);
    i && (i.parentNode && i.parentNode.removeChild(i), delete i, i = null);
    b && (delete b, b = null);
    d && (delete d, d = null);
    Q = !1;
    if (a && a.getContext && (b = a.getContext("2d"))) {
      d = a;
      d.setAttribute("hidefocus", !0);
      if (!Number(d.style.zIndex) || 0 > d.style.zIndex) d.style.zIndex = 0;
      d.style.position = "relative";
      d.setAttribute("tabindex",
        0);
      d.style["-ms-touch-action"] = "none";
      d.style["-ms-content-zooming"] = "none";
      d.style.backgroundColor = oa;
      h && zd();
      d.removeEventListener("keydown", Uc, !1);
      d.addEventListener("keydown", Uc, !1);
      Vc(M);
      Db(U);
      d.removeEventListener("focus", Wc, !1);
      d.addEventListener("focus", Wc, !1);
      d.removeEventListener("blur", Xc, !1);
      d.addEventListener("blur", Xc, !1);
      window.removeEventListener("resize", Ea, !1);
      window.addEventListener("resize", Ea, !1);
      window.removeEventListener("move", Ea, !1);
      window.addEventListener("move", Ea, !1);
      Ea();
      ea(Za);
      ea(Fa);
      ea(Ga);
      ea(kb);
      R();
      d.style.background = Q && z == t ? "transparent" : oa;
      m();
      R();
      fa.create()
    }
  }

  function zd() {
    f && (delete f, f = null);
    i && (canvas3d.parentNode && i.parentNode.removeChild(i), delete i, i = null);
    delete lb;
    lb = null;
    delete $a;
    $a = null;
    Q = !1;
    if (!(i = document.createElement("canvas"))) return !1;
    try {
      f = i.getContext("webgl") || i.getContext("experimental-webgl")
    } catch (a) {}
    if (!f) return delete i, i = null, !1;
    i.addEventListener("webglcontextlost", Ad, !1);
    i.addEventListener("webglcontextrestored", Bd, !1);
    Q = !0;
    i.style.backgroundColor =
      "transparent";
    i.style.border = "none";
    d.parentNode.insertBefore(i, d);
    var h;
    h = Yc(f, f.VERTEX_SHADER, "attribute vec3 aVertexPos;\nattribute vec2 aTextureCoord;\nuniform mat4 uMVMatrix;\nvarying vec2 vTextureCoord;\nvoid main(void) {\ngl_Position = uMVMatrix * vec4(aVertexPos, 1.0);\nvTextureCoord = aTextureCoord;\n}");
    var b = Yc(f, f.FRAGMENT_SHADER, "precision mediump float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float uAlpha;\nvoid main(void) {\nvec4 textureColor = texture2D(uSampler, vTextureCoord);\ngl_FragColor = vec4(textureColor.rgb, uAlpha);\n}");
    A = f.createProgram();
    f.attachShader(A, h);
    f.attachShader(A, b);
    f.linkProgram(A);
    f.getProgramParameter(A, f.LINK_STATUS) || wc("Could not initialise shaders");
    f.useProgram(A);
    A.vertexPosAttribute = f.getAttribLocation(A, "aVertexPos");
    f.enableVertexAttribArray(A.vertexPosAttribute);
    A.textureCoordAttribute = f.getAttribLocation(A, "aTextureCoord");
    f.enableVertexAttribArray(A.textureCoordAttribute);
    A.mvMatrixUniform = f.getUniformLocation(A, "uMVMatrix");
    A.alphaUniform = f.getUniformLocation(A, "uAlpha");
    xc();
    return !0
  }

  function Yc(a, h, b) {
    h = a.createShader(h);
    a.shaderSource(h, b);
    a.compileShader(h);
    return !a.getShaderParameter(h, a.COMPILE_STATUS) ? (alert(a.getShaderInfoLog(h)), ga = hc, null) : h
  }

  function yc() {
    Zc();
    $c();
    ad()
  }

  function $c() {
    if (c) q = c.pan, l = c.tilt, g = c.scale, ha = V = $b = S = o = j = 0, ia = !1, N = B = 0, K = E()
  }

  function v() {
    pa && (clearTimeout(pa), pa = 0);
    ha = S = o = j = 0;
    N = E()
  }

  function x() {
    return ga == ic
  }

  function E() {
    return (new Date).getTime()
  }

  function bd(a) {
    ja && (0 > a ? a = 0 : a >= ja.length - 1 && (a = ja.length - 1), a !== qa && (cd(ja[a]), qa = a))
  }

  function zc(a) {
    bd(qa +
      a)
  }

  function cd(a) {
    ga = Wb;
    Zc();
    delete c;
    c = null;
    if (!a || !a.src) ra(), qa = -1, m();
    else {
      var h = a.src;
      ga = jc;
      var b = new Image;
      b.src = h;
      b.onload = dd;
      b.onerror = Ac;
      b.onabort = Ac;
      c = b;
      c.title = a.title ? a.title : "";
      c.projection = "spherical" == a.projection ? t : gb;
      z = c.projection;
      c.horizon = a.horizon ? Ha(Number(a.horizon), -45, 45) : 0;
      c.pan = a.pan ? Number(a.pan) : 0;
      c.tilt = a.tilt ? Number(a.tilt) : 0;
      c.scale = "number" == typeof a.scale ? Number(a.scale) : 1;
      h = Number(a.horzFov);
      c.horzFov =
        0 < h && 360 > h ? h : 360;
      c.vertFov = 0;
      c.is360 = 360 == c.horzFov;
      c.panSpeed = null != a.panSpeed ? mb(Number(a.panSpeed)) : Tc;
      c.tiltSpeed = a.tiltSpeed ? mb(Number(a.tiltSpeed)) : 0;
      Eb = a.compassNorth ? !0 : !1;
      c.compassNorth = a.compassNorth ? Number(a.compassNorth) : 0;
      c.compassNorth += 3600;
      c.compassNorth %= 360;
      sa = [];
      ab = null;
      if (a = a.hotspots)
        for (h = 0; h < a.length; h++) sa.push(new Cd(a[h]));
      c.hotspots = sa;
      fa.create();
      R()
    }
  }

  function Ac() {
    ga = kc;
    ra();
    m()
  }

  function dd() {
    if (c && c.complete) {
      ga = ic;
      c.vertFov = c.horzFov * c.height / c.width;
      if (180 < c.vertFov) c.horzFov *=
        180 / c.vertFov, c.vertFov = 180;
      c.is360 = 360 == c.horzFov;
      c.scale = Ia(c.scale);
      c.pan = Ja(c.pan);
      c.tilt = nb(c.tilt);
      xc();
      $c();
      R();
      ed = !1;
      m(!0);
      ob && setTimeout(ob, 0);
      K = E()
    }
  }

  function Zc() {
    var a = i && z == t ? i : d;
    Fb = !1;
    if (!s) s = new Image, s.onload = function() {
      if (s) {
        d.parentNode.insertBefore(s, i ? i : d);
        s.style.zIndex = Number(a.style.zIndex) - 1;
        d.style.backgroundColor = "transparent";
        if (i) i.style.backgroundColor = "transparent";
        s.style.position = "absolute";
        s.style.left = a.offsetLeft + a.clientLeft + "px";
        s.style.top = a.offsetTop + a.clientTop +
          "px";
        s.width = a.clientWidth;
        s.height = a.clientHeight;
        Fb = !0
      }
    };
    try {
      s.src = a.toDataURL("image/jpeg")
    } catch (h) {
      ra()
    }
  }

  function ra() {
    s && (s.parentNode && s.parentNode.removeChild(s), delete s, s = null, Fb = !1);
    B = 1;
    d.style.background = Q && z == t ? "transparent" : oa
  }

  function ta(a, h) {
    fd(q + a, l + h, null)
  }

  function fd(a, h, b) {
    K = 0;
    v();
    ia = !1;
    x() && ("number" == typeof b && (g = Ia(b)), q = a, l = h, m())
  }

  function ua(a) {
    ia = !1;
    L(g * a)
  }

  function gd(a) {
    ia = !0;
    L(g * a)
  }

  function L(a) {
    K = 0;
    v();
    x() && (0 != bb ? ($b = g, V = Ia(a), V != g && (ha = E(), m())) : (a = Ia(a), g != a && (Bc(g,
      a), g = a, m())))
  }

  function hd(a, h) {
    a ? pb = Math.min(h, hb) : Ka = Math.max(h, Aa);
    L(g)
  }

  function u(a, h) {
    K = 0;
    v();
    x() && (null !== a && (j = mb(a)), null !== h && (o = mb(h)), N = E(), m())
  }

  function mb(a) {
    return a < -ca ? -ca : a > ca ? ca : a
  }

  function Ia(a) {
    Gb = !1;
    if ("number" != typeof a || 0 == a) {
      Gb = !0;
      if (x()) {
        var a = c.width,
          h = c.height,
          b = d.width,
          e = d.height;
        if (z == t) {
          var f;
          f = Math.min(c.horzFov, Xb) / 2;
          b *= f * da / cb(f);
          f = Math.min(c.vertFov, Yb) / 2;
          e *= f * da / cb(f);
          a = Math.min(a * Xb / c.horzFov, a);
          h = Math.min(h * Yb / c.vertFov, h)
        }
        a = Math.min(b / a, e / h);
        a = Math.max(a, Ka);
        a =
          Math.min(a, pb)
      } else a = 0;
      return a
    }
    if (a < Ka) return Ka;
    if (a > pb) return pb;
    h = [0.125, 0.125 * Math.SQRT2, 0.25, 0.25 * Math.SQRT2, 0.5, 0.5 * Math.SQRT2, 1, 1 * Math.SQRT2, 2, 2 * Math.SQRT2, 4, 4 * Math.SQRT2, 8];
    for (b = 0; b < h.length; b++)
      if (a > 0.999 * h[b] && a < 1.001 * h[b]) {
        a = h[b];
        break
      }
    return a
  }

  function Ja(a) {
    if (c.is360) a = (a + 36E3) % 360;
    else {
      var h = d.width / c.width * c.horzFov / g;
      z == t ? (h = 2 * Math.atan(h * da / 2) * Ba, h = Math.min(h, Xb)) : h = Math.min(h, c.horzFov);
      var h = h / 2,
        b = c.horzFov - h;
      h > b ? a = c.horzFov / 2 : a < h ? a = h : a > b && (a = b)
    }
    return a
  }

  function nb(a) {
    var h;
    d ? (h = d.height / c.height * c.vertFov / g, z == t ? (h = 2 * Math.atan(h * da / 2) * Ba, h = Math.min(h, Yb)) : h = Math.min(h, c.vertFov)) : h = 0;
    var b = (c.vertFov - h) / 2,
      e = -b,
      b = b - c.horizon,
      e = e - c.horizon;
    z == t && c.is360 && (90 <= c.vertFov / 2 - c.horizon && (b += h / 2), 90 <= c.vertFov / 2 + c.horizon && (e -= h / 2));
    b < e ? a = (e + b) / 2 : a < e ? a = e : a > b && (a = b);
    return a
  }

  function Bc(a, b) {
    if (ia && 0 <= C) {
      var c = Cc(a) - Cc(b);
      q += c;
      c = Dc(a) - Dc(b);
      l += c
    }
    c = g;
    g = b;
    q = Ja(q);
    l = nb(l);
    g = c;
    0 == ha && (ia = !1)
  }

  function Cc(a) {
    a || (a = g);
    var b = C - d.width / 2,
      w = -(y - d.height / 2),
      e = 0;
    z == t ? (a = c.width / c.horzFov *
      a * Ba * W(l) - w * La(l), e = q + Ma(b, a)) : e = q + b / a * c.horzFov / c.width;
    c.is360 && (0 > e ? e += 360 : 360 < e && (e -= 360));
    return e
  }

  function Dc(a) {
    a || (a = g);
    var b = C - d.width / 2,
      w = -(y - d.height / 2),
      e = 0;
    z == t ? (e = c.width / c.horzFov * a * Ba, a = e * W(l) - w * La(l), w = e * La(l) + w * W(l), e = Ma(w, Math.sqrt(b * b + a * a))) : e = l + w / a * c.vertFov / c.height;
    return e
  }

  function ac(a, b) {
    var d, e;
    if (z == t) {
      d = c.width / c.horzFov * g * Ba;
      e = d * W(l) - b * La(l);
      var f = d * La(l) + b * W(l);
      d = Ma(a, e);
      e = Ma(f, Math.sqrt(a * a + e * e))
    } else d = a / g * c.horzFov / c.width, e = l + b / g * c.vertFov / c.height;
    c.is360 && (0 > d ?
      d += 360 : 360 < d && (d -= 360));
    return new id(d, e)
  }

  function jd(a, b) {
    var w, e;
    w = a - q;
    c.is360 && (-180 >= w ? w += 360 : 180 < w && (w -= 360));
    if (z == t) {
      var f = c.width / c.horzFov * g * Ba,
        O = Ma(cb(b), W(w));
      e = O - l;
      if (-90 >= e || 90 < e) return null;
      var n = f / W(e),
        O = W(O) * n;
      w = cb(w) * O;
      e = cb(e) * f
    } else e = b - l, w = w / c.horzFov * c.width * g, e = e / c.vertFov * c.height * g;
    return new id(d.width / 2 + w, d.height / 2 - e)
  }

  function m(a) {
    var h;
    if (x()) {
      var w = N,
        e = q,
        Dd = l,
        O = g;
      N = E();
      var n = !1,
        n = n | Ed(),
        n = n | Fd();
      if (0 <= Hb) 50 < N - lc && (j = o = 0), n = !0;
      else {
        var Ib = (N - w) / 1E3;
        q += j * Ib;
        l += o * Ib
      }
      var i;
      var m, p, G, r, X, va, k = g;
      0 == ha || V == $b || (m = 1 + (N - ha) / (500 * (2 << bb)), r = Math.log($b), X = Math.log(V), va = Math.log(g), p = 1 + Math.min(2 * Math.abs(r - va), Math.abs(X - va) + (X - va) * (X - va)) / Math.abs(r - X) / 16, G = m * p, $b < V ? (k *= G, k > V && (k = V)) : (k /= G, k < V && (k = V)), k == V ? (g = k, ha = 0) : ha = N);
      i = k;
      Bc(g, i);
      g = i;
      n |= e != q;
      n |= Dd != l;
      n |= O != g;
      h = n |= kd()
    } else h = !1; if (!a || h) {
      if (b) {
        b.clearRect(0, 0, d.width, d.height);
        if (f) {
          if (1 != B) f.clearColor(0, 0, 0, B);
          else {
            var s = oa.match(/\d+/g);
            f.clearColor(s[0] / 255, s[1] / 255, s[2] / 255, B)
          }
          f.clear(f.COLOR_BUFFER_BIT)
        }
        switch (ga) {
          case Wb:
            mc("");
            break;
          case jc:
            ed && mc("Loading image '" + c.src + "'...");
            break;
          case kc:
            mc("Error loading image '" + c.src + "' !");
            break;
          case hc:
            mc("WebGL error: Context lost!");
            break;
          case ic:
            var Gd = d.width,
              C = d.height,
              u;
            if (d) {
              var y;
              if (z == t) {
                var K = Math.min(c.horzFov, Xb);
                y = 2 * cb(K / 2) / (c.horzFov * da) * c.width * g
              } else y = c.width * g;
              u = Math.round(Math.min(y, d.width))
            } else u = 0;
            var J, L;
            if (z == t) {
              var Q = Math.min(c.vertFov, Yb);
              L = 2 * cb(Q / 2) / (c.vertFov * da) * c.height * g
            } else L = c.height * g;
            J = Math.round(Math.min(L, d.height));
            var H = Math.round((Gd -
              u) / 2),
              P = Math.round((C - J) / 2),
              v = H + u,
              D = P + J;
            if (z == t)
              if (f) {
                if (!f.isContextLost() && $a) {
                  var S = E(),
                    T = v - H,
                    U = D - P;
                  f.viewport(H, P, T, U);
                  f.blendFunc(f.SRC_ALPHA, f.ONE_MINUS_SRC_ALPHA);
                  f.enable(f.BLEND);
                  var ea, ia = T / c.width * c.horzFov / g,
                    ja = U / c.height * c.vertFov / g,
                    ra = Math.sqrt(ia * ia + ja * ja);
                  ea = 2 * Math.atan(ra * da / 2) * Ba;
                  var la, $ = T / U,
                    ma = 0.2 * cb(ea / 2) / Math.sqrt(1 + $ * $),
                    na = 1 / 1.8;
                  la = [0.2 / (ma * $), 0, 0, 0, 0, 0.2 / ma, 0, 0, 0, 0, -2.2 * na, -1, 0, 0, -0.8 * na, 0];
                  var pa, qa = q,
                    ua = W(qa),
                    Da = La(qa);
                  pa = [ua, 0, -Da, 0, 0, 1, 0, 0, Da, 0, ua, 0, 0, 0, 0, 1];
                  var Ea = -l,
                    Ha = W(Ea),
                    Sa = La(Ea);
                  ld = md(md(pa, [1, 0, 0, 0, 0, Ha, Sa, 0, 0, -Sa, Ha, 0, 0, 0, 0, 1]), la);
                  f.uniformMatrix4fv(A.mvMatrixUniform, !1, ld);
                  f.uniform1f(A.alphaUniform, B);
                  f.bindBuffer(f.ARRAY_BUFFER, Ec);
                  f.vertexAttribPointer(A.vertexPosAttribute, 3, f.FLOAT, !1, 0, 0);
                  f.bindBuffer(f.ARRAY_BUFFER, $a);
                  f.vertexAttribPointer(A.textureCoordAttribute, 2, f.FLOAT, !1, 0, 0);
                  f.bindTexture(f.TEXTURE_2D, lb);
                  f.drawArrays(f.TRIANGLE_STRIP, 0, Jb);
                  f.flush();
                  f.finish();
                  S = E() - S;
                  Fc(S + " ms")
                }
              } else {
                b.globalAlpha = B;
                var ya = v - H,
                  aa = D - P,
                  za = E();
                if (z != t) I =
                  null;
                else {
                  F = bc;
                  Gc || (F *= 0.5);
                  var eb = Math.min(4 / Math.min(c.width / c.horzFov * g, 4), 2);
                  F *= eb;
                  F = c.horzFov / Math.floor(c.horzFov / F);
                  var ba = Math.round(c.horzFov / F);
                  c.is360 && (F = c.horzFov / ba);
                  var ca = Math.round(c.vertFov / F);
                  180 > c.vertFov && ca++;
                  ba++;
                  ca++;
                  if (!I || I.length != ca) I = Array(ca);
                  for (var Wa, Kb, Xa = Math.max(-c.vertFov / 2 - c.horizon, -90), Ya = Math.min(c.vertFov / 2 - c.horizon, 90), qb = 0; qb < ca; qb++) {
                    if (!I[qb] || I[qb].length != ba) I[qb] = Array(ba);
                    Kb = c.vertFov / 2 - c.horizon - qb * F;
                    Kb > Ya ? Kb = Ya : Kb < Xa && (Kb = Xa);
                    for (var ta = 0; ta < ba; ta++) Wa =
                      ta * F, I[qb][ta] = new Hd(Wa, Kb)
                  }
                }
                b.fillStyle = oa;
                b.fillRect(H, P, ya, aa);
                var pb = ac(0, 0),
                  Ka = ac(0, aa / 2),
                  Ma = ac(ya / 2, aa / 2),
                  Oa = ac(ya / 2, -aa / 2),
                  Pa = ac(0, -aa / 2),
                  Lb, ka, rb, sb;
                90 < Math.abs(Ka.x - Pa.x) ? 0 < pb.y ? (ka = c.horzFov / 2, rb = Math.min(Pa.y, Oa.y), sb = 90) : (ka = c.horzFov / 2, rb = -90, sb = Math.max(Ka.y, Ma.y)) : (ka = Math.max(Ma.x, Oa.x), rb = Math.min(Pa.y, Oa.y), sb = Math.max(Ka.y, Ma.y), ka += F);
                Lb = -ka;
                ka += q;
                Lb += q;
                c.is360 && (Lb = (Lb + 3600) % 360, ka = (ka + 3600) % 360); - 90 < rb && (rb -= F);
                90 > sb && (sb += F);
                for (var Qa = Lb, Ra = ka, vb = rb, wb = sb, yb = I.length, zb = I[0].length,
                    Ta = 0; Ta < yb; Ta++)
                  for (var Ua = 0; Ua < zb; Ua++) {
                    var Y = I[Ta][Ua];
                    Y.valid = !1;
                    if (!(Y.tilt < vb) && !(Y.tilt > wb)) {
                      if (c.is360 && Qa >= Ra) {
                        if (Y.pan < Qa && Y.pan > Ra) continue
                      } else {
                        if (Y.pan < Qa) continue;
                        if (Y.pan > Ra) continue
                      }
                      var Va = jd(Y.pan, Y.tilt);
                      if (Va) Y.valid = !0, Y.xDisp = Va.x, Y.yDisp = Va.y
                    }
                  }
                for (var Bb = I.length - 1, Cb = I[0].length - 1, gb = F / c.horzFov * c.width * g, hb = F / c.vertFov * c.height * g, Aa = new nc(-gb, -hb, d.width + 2 * gb, d.height + 2 * hb), Mb = 0; Mb < Bb; Mb++)
                  for (var Nb = 0; Nb < Cb; Nb++) {
                    var tb = I[Mb][Nb];
                    if (tb.valid) {
                      var cc = I[Mb][Nb + 1];
                      if (cc.valid) {
                        var Ca =
                          I[Mb + 1][Nb + 1];
                        if (Ca.valid) {
                          var dc = I[Mb + 1][Nb];
                          if (dc.valid && (oc(tb, Aa) || oc(cc, Aa) || oc(Ca, Aa) || oc(dc, Aa))) {
                            var Db = tb.pan / c.horzFov * c.width,
                              Za = cc.pan / c.horzFov * c.width;
                            Za == c.width && Za--;
                            var Ob = Db,
                              Pb = (0.5 - (tb.tilt + c.horizon) / c.vertFov) * c.height,
                              Qb = Za,
                              Rb = (0.5 - (dc.tilt + c.horizon) / c.vertFov) * c.height,
                              Fa = tb.xDisp,
                              Ga = tb.yDisp,
                              kb = cc.xDisp,
                              mb = cc.yDisp,
                              Ia = Ca.xDisp,
                              Ja = Ca.yDisp,
                              nb = dc.xDisp,
                              ob = dc.yDisp,
                              Fb = 0 < tb.tilt + c.horizon;
                            Gc ? (pc(Ob, Pb, Qb, Pb, Qb, Rb, Fa, Ga, kb, mb, Ia, Ja, !0), pc(Ob, Pb, Qb, Rb, Ob, Rb, Fa, Ga, Ia, Ja, nb, ob, !1)) :
                              Fb ? pc(Ob, Pb, Qb, Rb, Ob, Rb, Fa, Ga, Ia, Ja, nb, ob) : pc(Ob, Pb, Qb, Pb, Qb, Rb, Fa, Ga, kb, mb, Ia, Ja)
                          }
                        }
                      }
                    }
                  }
                za = E() - za;
                Fc(za + " ms")
              } else {
                var Gb = E();
                b.globalAlpha = B;
                b.setTransform(1, 0, 0, 1, 0, 0);
                var db = c.width,
                  ub = c.height,
                  Ub = q / c.horzFov * db,
                  Vb = (0.5 - (l + c.horizon) / c.vertFov) * ub,
                  xb = Math.min((v - H) / g, db),
                  Ab = Math.min((D - P) / g, ub),
                  wa = Ub - xb / 2,
                  Na = Vb - Ab / 2,
                  ec = wa + xb,
                  fb = Na + Ab;
                0 > wa && (c.is360 ? (wa += db, ec += db) : wa = 0);
                0 > Na && (Na = 0);
                if (ec <= db) b.drawImage(c, wa, Na, ec - wa, fb - Na, H, P, v - H, D - P);
                else {
                  var fc = (db - wa) * g;
                  Sb && (fc = (fc + 0.5).toFixed(0));
                  b.drawImage(c,
                    wa, Na, db - wa, fb - Na, H, P, fc, D - P);
                  b.drawImage(c, 0, Na, ec - db, fb - Na, H + fc, P, v - H - fc, D - P)
                }
                Fc(E() - Gb + " ms")
              }
            if (xa && sa) {
              b.save();
              b.globalAlpha = B;
              for (var ib = 0; ib < sa.length; ib++) {
                var jb = sa[ib];
                jb.paint();
                !M && jb.isUnderCursor() && (ab = jb)
              }
              b.restore()
            }
            b.save();
            b.setTransform(1, 0, 0, 1, 0, 0);
            b.globalAlpha = B;
            b.fillStyle = oa;
            var Zb = d.width,
              qc = d.height;
            0 < H && b.fillRect(0, 0, H, qc);
            v < Zb && b.fillRect(v, 0, v, qc);
            0 < P && b.fillRect(H, 0, v - H, P);
            D < qc && b.fillRect(H, D, v - H, qc - D);
            b.restore();
            if (Eb) {
              var rc, sc;
              if (z == t) rc = d.width / 2, sc = (q - c.compassNorth +
                3600) % 360, nd(sc, rc);
              else {
                for (var Tb = 50 / g * (c.horzFov / c.width), tc = [1, 2, 5, 10, 15, 30, 45, 90], gc = 0; gc < tc.length; gc++)
                  if (Tb <= tc[gc] || gc == tc.length - 1) {
                    Tb = tc[gc];
                    break
                  }
                for (var Z = q - d.width / 2 / g * c.horzFov / c.width, Z = Z - c.compassNorth, Z = Math.round(Z / Tb) * Tb, Z = Z - Tb, Z = Z + c.compassNorth;
                  (rc = g * c.width / c.horzFov * (Z - q) + d.width / 2) < d.width;) sc = (Z - c.compassNorth + 36E3) % 360, nd(Math.round(sc), rc), Z += Tb
              }
            }
            Hc && fa.paint();
            ab && 1 == B && ab.paintPopup()
        }
      }
      R()
    }
    ad();
    h && uc && setTimeout(uc, 0)
  }

  function od() {
    m(!0)
  }

  function ad() {
    if (j || o || K || S ||
      ha) pa && (clearTimeout(pa), pa = 0), pa = window.setTimeout(od, 0)
  }

  function Ed() {
    var a = 1E3 * Ic;
    if (0 == K) return ra(), !1;
    if (s && !Fb) return B = 0, !0;
    if (N < K + a) {
      var b = B;
      B = (N - K) / a;
      return B != b
    }
    if (0 == c.panSpeed && 0 == c.tiltSpeed) return ra(), K = 0, !0;
    if (c.panSpeed != j || c.tiltSpeed != o) {
      ra();
      if (U != ma) j = o = 0;
      else {
        a = (N - K - a - 2E3) / 4E3;
        if (0 > a) return !0;
        j = a * c.panSpeed;
        o = a * c.tiltSpeed;
        j = 0 < c.panSpeed ? Math.min(c.panSpeed, j) : Math.max(c.panSpeed, j);
        0 < c.tiltSpeed ? o = Math.min(c.tiltSpeed, o) : _tiltspeed = Math.max(c.tiltSpeed, o)
      }
      return !0
    }
    ra();
    K = 0;
    return !1
  }

  function Fd() {
    if (0 == S || S == N) return !1;
    if (Math.sqrt(j * j + o * o) > 0.02 / g * c.horzFov / 90) {
      var a = 1 - (N - S) / (25 * (2 << ub));
      if (0 < a) return j *= a, o *= a, S = N, !0
    }
    j = o = S = 0;
    return !0
  }

  function mc(a) {
    b.globalAlpha = 1;
    str = "";
    d.style.fontStyle && (str += d.style.fontStyle + " ");
    d.style.fontVariant && (str += d.style.fontVariant + " ");
    d.style.fontWeight && (str += d.style.fontWeight + " ");
    str = d.style.fontSize ? str + (d.style.fontSize + " ") : str + "14px ";
    str = d.style.fontFamily ? str + d.style.fontFamily : str + "sans-serif";
    b.font = str;
    b.fillStyle = d.style.color ?
      d.style.color : "#000";
    b.textBaseline = "top";
    b.fillText(a, 20, 20)
  }

  function oc(a, b) {
    return a.xDisp >= b.x && a.xDisp <= b.x + b.cx && a.yDisp >= b.y && a.yDisp <= b.y + b.cy
  }

  function pc(a, h, d, e, f, O, n, Ib, i, m, p, G, r) {
    var X = a,
      va = h,
      k = d - a,
      l = O - h,
      j, d = d - a,
      e = e - h,
      f = f - a,
      O = O - h,
      a = h = 0,
      i = i - n,
      m = m - Ib,
      p = p - n,
      G = G - Ib,
      o = f * e - d * O,
      q = (p * e - i * O) / o,
      s = (G * e - m * O) / o,
      i = (i * f - p * d) / o,
      m = (m * f - G * d) / o;
    b.save();
    b.setTransform(q, s, i, m, n, Ib);
    Gc && (b.beginPath(), j = 1 == B ? 1 : 0, r ? (b.moveTo(a - 2 * j, h - j), b.lineTo(d + j, e - j), b.lineTo(f + j, O + 2 * j)) : (b.moveTo(a - j, h - 2 * j), b.lineTo(d +
      2 * j, e + j), b.lineTo(f - j, O + j)), b.closePath(), b.clip());
    try {
      j = 1 == B ? 10 / g / F : 0, k = Math.min(k + j, c.width - X), l = Math.min(l + j, c.height - va), b.drawImage(c, X, va, k, l, 0, 0, k, l)
    } catch (u) {}
    b.restore()
  }

  function nd(a, h) {
    var a = Math.round(a),
      c = Id(a),
      e = 0 == a % 90;
    b.save();
    b.globalAlpha = B;
    b.font = (e ? "20px" : "14px") + " sans-serif";
    b.textBaseline = "bottom";
    b.lineWidth = 4;
    b.fillStyle = e ? "#ff0" : "#fff";
    b.strokeStyle = "#222";
    b.beginPath();
    b.rect(h, d.height - 14, 1.5, d.height - 1);
    b.stroke();
    b.fill();
    b.strokeText(c, h + 4, d.height + 0.5);
    b.fillText(c,
      h + 4, d.height);
    b.restore()
  }

  function Id(a) {
    switch (a) {
      case 0:
      case 360:
        return "N";
      case 90:
        return "E";
      case 180:
        return "S";
      case 270:
        return "W";
      default:
        return 10 > a ? "00" + a : 100 > a ? "0" + a : "" + a
    }
  }

  function kd() {
    var a = fa.mouseOver();
    if (Jc != a) return Jc = a, !0;
    a = Kc();
    return Hc != a ? (Hc = a, !0) : !1
  }

  function Kc() {
    return !D || !fa.visible ? !1 : Lc()
  }

  function Jd(a) {
    Oa = new Image;
    Oa.onload = function() {
      m()
    };
    Oa.src = a
  }

  function Kd(a) {
    Pa = new Image;
    Pa.onload = function() {
      m()
    };
    Pa.src = a
  }

  function Mc() {
    if (!xa || !sa) return null;
    for (var a = 0; a < sa.length; a++) {
      var b =
        sa[a];
      if (b && b.isUnderCursor()) return b
    }
    return null
  }

  function pd(a) {
    var b = document.createElement("canvas"),
      c = b.width = b.height = 96,
      e = b.getContext("2d");
    e.setTransform(1, 0, 0, 1, 48, 48);
    e.beginPath();
    e.arc(0, 0, c / 2 - 2, 0, 2 * Math.PI, !1);
    e.lineWidth = 2;
    var d = e.createLinearGradient(0, -c / 2, 0, c / 2);
    d.addColorStop(0, "#f88");
    d.addColorStop(1, "#a00");
    e.fillStyle = d;
    e.stroke();
    e.fill();
    e.beginPath();
    e.arc(0, 0, 0.4 * c, 0, 2 * Math.PI, !1);
    e.fillStyle = "#f00";
    e.fill();
    e.strokeStyle = e.fillStyle = "#fff";
    e.lineCap = "round";
    e.lineJoin =
      "round";
    e.lineWidth = 7;
    e.shadowBlur = 4;
    e.shadowColor = "#444";
    a ? (e.beginPath(), e.moveTo(-15, -15), e.lineTo(15, 0), e.lineTo(-15, 15)) : (e.beginPath(), e.moveTo(-12, -4), e.lineTo(0, -4), e.lineTo(0, 20), e.moveTo(-14, 20), e.lineTo(14, 20), e.stroke(), e.beginPath(), e.arc(-2, -20, 2.5, 0, 2 * Math.PI, !1));
    e.stroke();
    return b
  }

  function xc() {
    delete lb;
    lb = null;
    delete $a;
    $a = null;
    if (f && Q && x()) {
      var a;
      a = c;
      var b = f.getParameter(f.MAX_TEXTURE_SIZE),
        d = a.width / a.height,
        e, g;
      if (a.width <= b && a.height <= b && 0 == (a.width & a.width - 1) && 0 == (a.height &
        a.height - 1)) a.widthUsed = a.width, a.heightUsed = a.height;
      else {
        1 <= d ? (e = Math.min(a.width, b), g = e / d) : (g = Math.min(a.height, b), e = g * d);
        d = document.createElement("canvas");
        d.width = qd(e);
        d.height = qd(g);
        for (var j = d.getContext("2d"), n = e / a.width, i = 0; i < a.height; i += b)
          for (var m = Math.min(b, a.height - i), l = 0; l < a.width; l += b) {
            var p = Math.min(b, a.width - l);
            1 == n ? j.drawImage(a, l, i, p, m, l, i, p, m) : j.drawImage(a, l, i, p, m, l * n - 0.4, i * n - 0.4, p * n + 0.8, m * n + 0.8)
          }
        d.widthUsed = e;
        d.heightUsed = g;
        a = d
      }
      var d = 1 / c.horzFov * a.widthUsed / a.width,
        j = 1 / c.vertFov *
          a.heightUsed / a.height,
        n = a.width != a.widthUsed,
        b = [],
        G = p = 0;
      e = g = 0;
      i = c.horzFov;
      g = Math.max(-c.vertFov / 2 - c.horizon, -90);
      var m = Math.min(c.vertFov / 2 - c.horizon, 90),
        r, X, l = bc;
      for (G = g, g = 0, X = !1; !X; G += l, g++) {
        G >= m && (G = m, X = !0);
        var va = La(G),
          k = W(G),
          o = (m - G) * j;
        for (p = 0, e = 0, r = !1; !r; p += l, e++) {
          p >= i && (p = i, r = !0);
          var q = La(p),
            s = W(p),
            u = p * d;
          n && c.is360 && (p ? r && (u -= 1.0E-4) : u += 1.0E-4);
          b.push(new Ld(u, o, q * k, va, -s * k))
        }
      }
      d = [];
      j = [];
      n = null;
      for (i = Jb = 0; i < g - 1; i++) {
        i && (n = b[i * e], d.push(n.x), d.push(n.y), d.push(n.z), j.push(0), j.push(0), Jb++);
        for (m =
          0; m < e; m++) n = b[i * e + m], d.push(n.x), d.push(n.y), d.push(n.z), j.push(n.xSrc), j.push(n.ySrc), n = b[(i + 1) * e + m], d.push(n.x), d.push(n.y), d.push(n.z), j.push(n.xSrc), j.push(n.ySrc), Jb += 2;
        d.push(n.x);
        d.push(n.y);
        d.push(n.z);
        j.push(0);
        j.push(0);
        Jb++
      }
      Ec = f.createBuffer();
      f.bindBuffer(f.ARRAY_BUFFER, Ec);
      f.bufferData(f.ARRAY_BUFFER, new Float32Array(d), f.STATIC_DRAW);
      lb = f.createTexture();
      f.bindTexture(f.TEXTURE_2D, lb);
      try {
        f.texImage2D(f.TEXTURE_2D, 0, f.RGBA, f.RGBA, f.UNSIGNED_BYTE, a)
      } catch (t) {
        f.bindTexture(f.TEXTURE_2D,
          null);
        return
      }
      f.texParameteri(f.TEXTURE_2D, f.TEXTURE_MAG_FILTER, f.LINEAR);
      f.texParameteri(f.TEXTURE_2D, f.TEXTURE_MIN_FILTER, f.LINEAR);
      f.texParameteri(f.TEXTURE_2D, f.TEXTURE_WRAP_S, f.CLAMP_TO_EDGE);
      f.texParameteri(f.TEXTURE_2D, f.TEXTURE_WRAP_T, f.CLAMP_TO_EDGE);
      f.bindTexture(f.TEXTURE_2D, null);
      $a = f.createBuffer();
      f.bindBuffer(f.ARRAY_BUFFER, $a);
      f.bufferData(f.ARRAY_BUFFER, new Float32Array(j), f.STATIC_DRAW)
    }
  }

  function Ub(a) {
    var b = d,
      c = parseInt(d.style.borderLeftWidth);
    isNaN(c) && (c = 0);
    var e = parseInt(d.style.borderTopWidth);
    for (isNaN(e) && (e = 0);
      "BODY" != b.tagName;) e += b.offsetTop, c += b.offsetLeft, b = b.offsetParent;
    b = a.changedTouches ? a.changedTouches[0] : a;
    C = b.clientX - c + window.pageXOffset;
    y = b.clientY - e + window.pageYOffset;
    M ? (Nc = a.touches ? a.touches.length : 1, 2 == Nc && 0 < Qa && (Ra = rd(a) / Qa)) : Nc = 0
  }

  function Lc() {
    return 0 <= C && C <= d.width && 0 <= y && y < d.height
  }

  function rd(a) {
    if (!a.touches || 2 > a.touches.length) return 0;
    var b = a.touches[0].clientX - a.touches[1].clientX,
      a = a.touches[0].clientY - a.touches[1].clientY;
    return Math.sqrt(b * b + a * a)
  }

  function ea(a) {
    if (d &&
      a) d.style.cursor = "url(" + a + "),move", d.width = d.width
  }

  function R() {
    if (d) {
      var a;
      ga == Wb || ga == kc ? a = "auto" : ga == jc ? a = "wait" : D ? 0 > J && fa.getFunctionUnderCursor() && !M ? a = "pointer" : (a = Mc()) && a.isLink() && !M ? a = "pointer" : (a = la ? 0 <= J ? kb : Ga : 0 <= J ? Fa : Za, a = (a ? "url(" + a + ")," : "") + "move") : a = "auto";
      d.style.cursor = a
    }
  }

  function Vc(a) {
    v();
    d.removeEventListener("touchstart", Sa, !1);
    document.removeEventListener("touchend", $, !0);
    document.removeEventListener("touchmove", ya, !0);
    d.removeEventListener("MSPointerDown", Sa, !1);
    document.removeEventListener("MSPointerUp",
      $, !0);
    document.removeEventListener("MSPointerMove", ya, !0);
    d.removeEventListener("mousedown", Sa, !1);
    document.removeEventListener("mouseup", $, !0);
    document.removeEventListener("mouseout", $, !0);
    document.removeEventListener("mousemove", ya, !0);
    d.removeEventListener("mousewheel", Vb, !0);
    d.removeEventListener("DOMMouseScroll", Vb, !1);
    (M = a && (aa || vb)) ? aa ? (d.addEventListener("touchstart", Sa, !1), document.addEventListener("touchend", $, !0), document.addEventListener("touchmove", ya, !0)) : vb && (d.addEventListener("MSPointerDown",
      Sa, !1), document.addEventListener("MSPointerUp", $, !0), document.addEventListener("MSPointerMove", ya, !0)) : (d.addEventListener("mousedown", Sa, !1), document.addEventListener("mouseup", $, !0), document.addEventListener("mouseout", $, !0), document.addEventListener("mousemove", ya, !0), d.addEventListener("mousewheel", Vb, !0), d.addEventListener("DOMMouseScroll", Vb, !1))
  }

  function Db(a) {
    v();
    window.removeEventListener("deviceorientation", sd, !1);
    window.removeEventListener("compassneedscalibration", td, !1);
    Oc && a != ma ? (U =
      a, window.addEventListener("deviceorientation", sd, !1), window.addEventListener("compassneedscalibration", td, !1)) : U = ma
  }

  function Md() {
    switch (U) {
      case Wa:
        return "absolute";
      case Xa:
        return "relative";
      default:
        return "none"
    }
  }

  function Wc() {
    m()
  }

  function Xc() {
    m()
  }

  function Uc(a) {
    if (!(!D || !x() || -1 != J)) switch (a.which) {
      case 37:
      case 177:
        a.shiftKey ? u(j - Ya, null) : (u(0, 0), ta(-1 / Math.sqrt(g), 0));
        break;
      case 39:
      case 176:
        a.shiftKey ? u(j + Ya, null) : (u(0, 0), ta(1 / Math.sqrt(g), 0));
        break;
      case 38:
        a.shiftKey ? u(null, o + Ya) : (u(0, 0), ta(0,
          1 / Math.sqrt(g)));
        break;
      case 40:
        a.shiftKey ? u(null, o - Ya) : (u(0, 0), ta(0, -1 / Math.sqrt(g)));
        break;
      case 13:
        wb && xb(!0);
        break;
      case 27:
        j || o ? u(0, 0) : wb && za && xb(!1);
        break;
      case 178:
        u(0, 0);
        break;
      case 179:
        yc();
        break;
      case 107:
      case 187:
      case 175:
        a.ctrlKey || (a.shiftKey ? ua(Ca) : ua(Da));
        break;
      case 109:
      case 189:
      case 174:
        a.ctrlKey || (a.shiftKey ? ua(1 / Ca) : ua(1 / Da));
        break;
      case 49:
      case 97:
        L(1);
        break;
      case 50:
      case 98:
        L(2);
        break;
      case 53:
      case 101:
        L(0.5);
        break;
      case 65:
        L(0);
        break;
      case 77:
        la = !la;
        R();
        break;
      case 67:
        Eb = !Eb;
        m();
        break;
      case 72:
        xa = !xa;
        m();
        break;
      case 73:
        Zb()
    }
  }

  function Sa(a) {
    if (D && x() && (Ub(a), Lc() && !(a.which && 1 != a.which) && !a.shiftKey && !a.ctrlKey && !a.altKey)) {
      a.preventDefault();
      a.stopPropagation();
      document.activeElement == d || d.focus();
      ud();
      ha = K = 0;
      B = 1;
      var b = fa.getFunctionUnderCursor();
      b ? (J = eb = -1, yb = null, Jc = -1, fa.paint(), window.setTimeout(b, 0)) : (v(), m(), J = C, eb = y, yb = vd(a), la && (Hb = q, zb = l), M && aa && (Qa = rd(a)))
    }
  }

  function $(a) {
    if (D && x() && Nd(a) && (Ub(a), !(a.which && 1 != a.which) && !(0 > J) && ("mouseout" != a.type || Lc()))) {
      a.preventDefault();
      a.stopPropagation();
      var b = M ? 12 : 4,
        b = Math.abs(J - C) <= b && Math.abs(eb - y) <= b;
      J = eb = -1;
      yb = null;
      R();
      if (b) {
        var c = ab,
          d = Mc();
        ab = d;
        if (c || d)
          if (M) {
            if (c && c.isLink() && c.isPopupUnderCursor()) {
              c.gotoUrl();
              Hb = zb = -1;
              return
            }
          } else if (d && d.isLink() && d.isUnderCursor()) {
          d.gotoUrl();
          Hb = zb = -1;
          return
        }
        m()
      }
      0 != ub && (0 != j || 0 != o) ? S = E() : j = o = 0;
      Hb = zb = -1;
      lc = Sb ? E() : a.timeStamp;
      if ("mouseout" != a.type)
        if (M && Ra && 1 != Ra) gd(Ra), Ra = Qa = 0;
        else if (T && clearTimeout(T), b && (Ta || Ua)) T ? (T = 0, Ua && setTimeout(Ua, 0)) : T = setTimeout(function() {
        T = 0;
        Ta && Ta()
      }, 500)
    }
  }

  function ya(a) {
    if (!(!D || !x() || Od && "mousemove" == a.type && !a.webkitMovementX && !a.webkitMovementY)) {
      var b = Sb ? E() : a.timeStamp;
      if (!Pc || !wd || !(b && 0 < E() - b)) {
        var d = C,
          e = y;
        Ub(a);
        var f = b - lc;
        lc = b;
        if (0 <= J) {
          a.preventDefault();
          a.stopPropagation();
          ud();
          if (T) {
            clearTimeout(T);
            T = 0;
            return
          }
          if (M && Qa) return;
          a = c.horzFov / c.width / g;
          la ? (q = Hb - (C - J) * a, l = zb + (y - eb) * a, j /= 1.2 * a, o /= 1.2 * a, f && (j += 100 * ((d - C) / f), o -= 100 * ((e - y) / f)), j *= a, o *= a) : (d = C - J, e = y - eb, j = d * Math.max(Math.abs(d), 100) * ib * a, o = -e * Math.max(Math.abs(e), 100) * ib * a);
          od();
          Ab && setTimeout(Ab, 0)
        } else kd() ?
          m() : M || (d = Mc(), d != ab && (ab = d, m()));
        R()
      }
    }
  }

  function Vb(a) {
    if (!(!D || !x() || -1 != J) && !a.ctrlKey && !a.altKey && !(a.mozInputSource && a.mozInputSource == a.MOZ_SOURCE_TOUCH) && !(null != a.axis && a.axis == a.HORIZONTAL_AXIS) && !(null != a.wheelDeltaY && 0 == a.wheelDeltaY) && !(null != a.wheelDelta && 1E4 < Math.abs(a.wheelDelta))) {
      var b = a.shiftKey ? Ca : Da;
      d.focus();
      Ub(a);
      var c = 0 <= (a.detail ? -120 * a.detail : a.wheelDelta);
      Qc && (c = !c);
      var e = 0 == ha ? g : V,
        b = e * (c ? b : 1 / b);
      0 == bb && Bc(e, b);
      ia = !0;
      L(b);
      a.preventDefault();
      a.stopPropagation()
    }
  }

  function ud() {
    document.selection ?
      document.selection.empty() : window.getSelection && window.getSelection().removeAllRanges()
  }

  function Nd(a) {
    if (M) {
      if (null == yb) return !1;
      if ("undefined" != typeof a.isPrimary && !0 === a.isPrimary) return !0
    } else return !0;
    a = vd(a);
    return null == a || a == yb ? !0 : !1
  }

  function vd(a) {
    return M && a.changedTouches && a.changedTouches.length ? a.changedTouches[0].identifier : a.pointerId ? a.pointerId : a.streamId ? a.streamId : null
  }

  function sd(a) {
    if (!(!D || !x() || U == ma)) {
      if (Pc && wd) {
        var b = a.timeStamp;
        if (b && 0 < E() - b) {
          wc(E());
          return
        }
      }
      var d = "number" ==
        typeof window.orientation ? window.orientation : 0,
        e = b = 0;
      switch (U) {
        case Wa:
          b = a.alpha;
          Sb || (b = 360 - b);
          b += d;
          break;
        case Xa:
          switch (d) {
            case 0:
              b = Sb ? a.gamma : -a.gamma;
              break;
            case -90:
              b = a.beta;
              break;
            case 180:
              b = a.gamma;
              break;
            case 90:
              b = -a.beta
          }
      }
      switch (d) {
        case 0:
          e = Sb ? -a.beta : a.beta;
          e -= 90;
          90 < a.gamma && (e *= -1);
          break;
        case -90:
          e = a.gamma - 90;
          break;
        case 180:
          e = -a.beta - 90;
          90 < a.gamma && (e *= -1);
          break;
        case 90:
          e = -a.gamma - 90, 180 < a.gamma && (e += 180)
      }
      a = b - Va; - 180 > a ? a += 360 : 180 < a && (a -= 360);
      Va += a / 2;
      a = e - Bb;
      Bb += a / 2;
      switch (U) {
        case Wa:
          (1 <= Math.abs(Va -
            q) || 1 <= Math.abs(Bb - l)) && setTimeout(function() {
            v();
            q = Ja(Va - c.compassNorth);
            l = nb(Bb);
            m()
          }, 0);
          break;
        case Xa:
          var e = e + 60,
            b = 3 < b ? b - 3 : -3 > b ? b + 3 : 0,
            e = 3 < e ? e - 3 : -3 > e ? e + 3 : 0,
            f = 0.5 * b * Math.abs(b),
            g = 0.5 * e * Math.abs(e);
          la && (f *= -1, g *= -1);
          K = 0;
          setTimeout(function() {
            u(f, g)
          }, 0)
      }
    }
  }

  function td(a) {
    wc("_onCompassNeedsCalibration");
    a.preventDefault();
    a.stopPropagation()
  }

  function Ad() {
    alert("WebGL context lost - page will be reloaded!");
    window.location.reload()
  }

  function Bd() {
    alert("WebGL context restored!");
    ga = hc;
    dd();
    m()
  }

  function xd(a,
    b) {
    if (d) {
      ra();
      d.width = a;
      d.height = b;
      if (d.style.width && d.style.width.match(/px$/)) d.style.width = a + "px";
      if (d.style.height && d.style.height.match(/px$/)) d.style.height = b + "px";
      if (d && i) i.style.zIndex = d.style.zIndex, i.style.position = "absolute", i.style.left = d.offsetLeft + d.clientLeft + "px", i.style.top = d.offsetTop + d.clientTop + "px", i.style.width = a + "px", i.style.height = b + "px", i.width = d.clientWidth, i.height = d.clientHeight;
      var c = bb;
      bb = 0;
      L(Gb ? 0 : g);
      bb = c;
      m()
    }
  }

  function Ea() {
    xd(d.clientWidth, d.clientHeight)
  }

  function xb(a) {
    if (d &&
      a != za) {
      if (za = a) a = document.body.style, document.body.oldStyleText = "overflow:" + (a.overflow ? a.overflow : "auto") + ";width:" + document.body.clientWidth + "px;height:" + document.body.clientHeight + "px;", a.overflow = "hidden", a = d.style, d.oldStyleText = "position:" + (a.position ? a.position : "static") + ";left:" + (a.left ? a.left : 0) + ";top:" + (a.top ? a.top : 0) + ";width:" + d.clientWidth + "px;height:" + d.clientHeight + "px;border:" + (a.border ? a.border : "none") + ";border-radius:" + (a.borderRadius ? a.borderRadius : 0) + ";z-index:" + (a.zIndex ? a.zIndex :
        "auto") + ";", a.position = "absolute", a.left = "0", a.top = "0", a.width = "100%", a.height = "100%", a.border = "none", a.borderRadius = "0", a.zIndex = 9999, document.documentElement.scrollLeft = 0, document.documentElement.scrollTop = 0, document.body.scrollLeft = 0, document.body.scrollTop = 0;
      else {
        if (d.oldStyleText) d.style.cssText = d.oldStyleText, delete d.oldStyleText;
        if (document.body.oldStyleText) document.body.style.cssText = document.body.oldStyleText, delete document.body.oldStyleText
      }
      Ea()
    }
  }

  function qd(a) {
    --a;
    for (var b = 1; 32 > b; b <<=
      1) a |= a >> b;
    return a + 1
  }

  function Cd(a) {
    function c(a) {
      return C < a.x || C > a.x + a.cx || y < a.y || y > a.y + a.cy ? !1 : !0
    }

    function f() {
      if (!xa) return null;
      var a = jd(j, n);
      if (!a) return null;
      var b = p && p.src ? p.width : jb,
        b = b * (Math.log(10 * g) / 5),
        c = p && p.src ? p.height : jb,
        c = c * (Math.log(10 * g) / 5);
      a.x -= b / 2;
      a.y -= c / 2;
      return 0 > a.x + b || a.x > d.width || 0 > a.y + c || a.y > d.height ? null : new nc(a.x, a.y, b, c)
    }

    function e() {
      var a = f();
      if (!a) return null;
      b.save();
      b.font = "14px sans-serif";
      for (var c = l.split("<br>"), e = 0, h = 0, e = 0; e < c.length; e++) {
        var k = b.measureText(c[e]);
        if (k.width > h) h = k.width
      }
      b.restore();
      c = a = new nc(a.x + a.cx + 10, a.y + a.cy / 2 - 10, h + 10, 17 * e + 6);
      if (0 > c.x) c.x = 0;
      else if (c.x > d.width - c.cx) c.x = d.width - c.cx;
      if (0 > c.y) c.y = 0;
      else if (c.y > d.height - c.cy) c.y = d.height - c.cy;
      return a
    }

    function i() {
      return o ? !0 : !1
    }
    this.isUnderCursor = function() {
      var a = f();
      return !a ? !1 : c(a)
    };
    this.isPopupUnderCursor = function() {
      var a = e();
      return !a ? !1 : c(a)
    };
    this.gotoUrl = function() {
      if (o)
        if ("_self" == q) window.location.href = o;
        else {
          var a = self.open(o, q);
          a ? a.focus() : window.location.href = o
        }
    };
    this.isLink = i;
    this.paint = function() {
      var a = f();
      if (a) b.shadowColor = "#444", b.shadowBlur = 20 * (Math.log(10 * g) / 5), p && b.drawImage(p, a.x, a.y, a.cx, a.cy), b.shadowBlur = 0
    };
    this.paintPopup = function() {
      b.save();
      b.globalAlpha = B;
      b.shadowColor = "#444";
      b.shadowBlur = 3;
      b.shadowOffsetX = 1;
      b.shadowOffsetY = 1;
      b.font = "14px sans-serif";
      var a = e();
      if (a) {
        b.strokeStyle = "#008";
        b.lineWidth = 2;
        var c = b.createLinearGradient(a.x, a.y, a.x, a.y + a.cy);
        c.addColorStop(0, "#fff");
        c.addColorStop(1, "#bbb");
        b.fillStyle = c;
        yd(a, 2);
        b.stroke();
        b.fill();
        b.shadowBlur =
          0;
        b.shadowOffsetX = 0;
        b.shadowOffsetY = 0;
        b.fillStyle = "#008";
        b.textAlign = "left";
        b.textBaseline = "top";
        for (var c = l.split("<br>"), d = 0; d < c.length; d++) b.fillText(c[d], a.x + 4, a.y + 4 + 17 * d)
      }
      b.restore()
    };
    var j = a.pan ? Number(a.pan) : 0,
      n = a.tilt ? Number(a.tilt) : 0,
      l = a.text ? a.text : "???",
      o = a.url ? a.url : null,
      q = a.target ? a.target : "_self";
    Object.defineProperty(this, "pan", {
      set: function(a) {
        j = a;
        m()
      },
      get: function() {
        return j
      }
    });
    Object.defineProperty(this, "tilt", {
      set: function(a) {
        n = a;
        m()
      },
      get: function() {
        return n
      }
    });
    Object.defineProperty(this,
      "text", {
        set: function(a) {
          l = a
        },
        get: function() {
          return l
        }
      });
    Object.defineProperty(this, "url", {
      set: function(a) {
        o = a
      },
      get: function() {
        return o
      }
    });
    Object.defineProperty(this, "target", {
      set: function(a) {
        q = a
      },
      get: function() {
        return q
      }
    });
    Object.defineProperty(this, "img", {
      get: function() {
        return p ? p.src : null
      }
    });
    var p;
    a.img ? (p = new Image, p.src = a.img) : p = i() ? Pa : Oa;
    i() && (l += "  >>")
  }

  function W(a) {
    return a ? Math.cos(a * da) : 1
  }

  function La(a) {
    return Math.sin(a * da)
  }

  function cb(a) {
    return Math.tan(a * da)
  }

  function Ma(a, b) {
    return Math.atan2(a,
      b) * Ba
  }

  function Ha(a, b, c) {
    return a <= b ? b : a >= c ? c : a
  }

  function yd(a, c) {
    var d = a.x + a.cx,
      e = a.y + a.cy;
    b.beginPath();
    b.moveTo(a.x + c, a.y);
    b.lineTo(d - c, a.y);
    b.quadraticCurveTo(d, a.y, d, a.y + c);
    b.lineTo(d, a.y + a.cy - c);
    b.quadraticCurveTo(d, e, d - c, e);
    b.lineTo(a.x + c, e);
    b.quadraticCurveTo(a.x, e, a.x, e - c);
    b.lineTo(a.x, a.y + c);
    b.quadraticCurveTo(a.x, a.y, a.x + c, a.y)
  }

  function wc(a) {
    if (Cb) {
      var b = document.getElementById("debug1");
      if (b) b.innerHTML = a
    }
  }

  function Fc(a) {
    if (Cb) {
      var b = document.getElementById("debug3");
      if (b) b.innerHTML =
        a
    }
  }

  function id(a, b) {
    this.x = a;
    this.y = b
  }

  function nc(a, b, c, d) {
    this.x = a;
    this.y = b;
    this.cx = c;
    this.cy = d
  }

  function Hd(a, b) {
    this.pan = a;
    this.tilt = b;
    this.yDisp = this.xDisp = 0;
    this.valid = !1
  }

  function Ld(a, b, c, d, f) {
    this.xSrc = a;
    this.ySrc = b;
    this.x = c;
    this.y = d;
    this.z = f
  }

  function md(a, b) {
    for (var c = [], d = 0, f = 0, g, i, j;;) {
      g = 0;
      i = d;
      for (j = f; !(g += a[i++] * b[j], j += 4, 16 <= j););
      c.push(g);
      f++;
      if (4 == f) {
        d += 4;
        if (16 == d) break;
        f = 0
      }
    }
    return c
  }
  Cb = !1;
  fb = "2.0.1.31";
  Sc = "(c) 2012-2014 by Karl Maloszek - Simple Software\n(http://www.panorado.com)";
  da = Math.PI / 180;
  Ba = 180 / Math.PI;
  gb = 1;
  t = 2;
  Tc = 3;
  Ya = 3;
  ca = 45;
  Aa = 0.25;
  hb = 8;
  Da = Math.SQRT2;
  Ca = Math.sqrt(Math.sqrt(Math.sqrt(Math.SQRT2)));
  Xb = 110;
  Yb = 71;
  ib = 0.04;
  jb = 80;
  na = 30;
  Wb = 0;
  jc = 1;
  ic = 2;
  kc = 3;
  hc = 4;
  ma = 0;
  Wa = 1;
  Xa = 2;
  this.about = Zb;
  this.aboutDebug = function() {
    if (Cb) {
      var a = "-- Debug Info:\n",
        a = a + ("Navigator User Agent: " + navigator.userAgent + "\nNavigator App Name: " + navigator.appName + "\nNavigator Version: " + navigator.appVersion + "\nTouch: " + this.isTouchAvailable + "\nOrientation: " + this.isOrientationAvailable + "\nWebGL: " +
          this.isWebGlAvailable + "\nWebGL max. Texture Size: " + (f ? f.getParameter(f.MAX_TEXTURE_SIZE) : 0));
      setTimeout(function() {
        alert(a)
      }, 0)
    }
  };
  this.reset = yc;
  this.move = ta;
  this.moveTo = fd;
  this.zoom = ua;
  this.zoomToCursor = gd;
  this.setSpeed = u;
  this.resize = xd;
  this.selectImage = bd;
  this.nextImage = zc;
  var ba = navigator.userAgent,
    Pd = 0 <= ba.indexOf("MSIE"),
    Od = 0 <= ba.indexOf("Chrome"),
    Sb = 0 <= ba.indexOf("Firefox"),
    wd = 0 <= ba.indexOf("Opera") || 0 <= ba.indexOf("OPR/"),
    Pc = 0 <= ba.indexOf("Android"),
    Gc = Pd;
  if (Object.defineProperty)
    if (Object.defineProperty(this,
      "version", {
        get: function() {
          return fb
        }
      }), "object" != typeof Rc) alert("PanoradoJS object constructor requires a Canvas parameter!");
    else {
      var d = null,
        b = null,
        oa = "#000";
      Object.defineProperty(this, "canvas", {
        get: function() {
          return d
        }
      });
      var za = !1;
      Object.defineProperty(this, "fullWindow", {
        set: function(a) {
          xb(a)
        },
        get: function() {
          return za
        }
      });
      var wb = !0;
      Object.defineProperty(this, "fullWindowEnabled", {
        set: function(a) {
          wb = a ? !0 : !1
        },
        get: function() {
          return wb
        }
      });
      var ja = null;
      Object.defineProperty(this, "imageList", {
        set: function(a) {
          ja =
            a;
          qa = -1;
          fa.create()
        },
        get: function() {
          return ja
        }
      });
      var qa = -1,
        c = null;
      Object.defineProperty(this, "image", {
        set: function(a) {
          cd(a)
        },
        get: function() {
          return c
        }
      });
      var s = null,
        Fb = !1,
        z = gb;
      Object.defineProperty(this, "projection", {
        set: function(a) {
          if (b && d) z = "spherical" == a ? t : gb, d.style.background = Q && z == t ? "transparent" : oa, m()
        },
        get: function() {
          return z == t ? "spherical" : "flat"
        }
      });
      var Qd = function() {
        var a = !1,
          b = document.createElement("canvas");
        if (b) {
          try {
            var c = b.getContext("webgl") || b.getContext("experimental-webgl");
            c && (delete c,
              a = !0)
          } catch (d) {}
          delete b
        }
        return a
      }(),
        i = null,
        f = null,
        Q = !1,
        ld = null,
        A = null,
        Ec = null,
        lb = null,
        $a = null,
        Jb = 0;
      Object.defineProperty(this, "isWebGlAvailable", {
        get: function() {
          return Qd
        }
      });
      Object.defineProperty(this, "useWebGl", {
        set: function(a) {
          d && (a ? Q || vc(d, !0) : Q && vc(d, !1))
        },
        get: function() {
          return Q
        }
      });
      var I = null,
        bc = 5,
        F = bc;
      Object.defineProperty(this, "gridSize", {
        set: function(a) {
          bc = Ha(a, 1, 8);
          xc();
          m()
        },
        get: function() {
          return bc
        }
      });
      var D = !0;
      Object.defineProperty(this, "enabled", {
        set: function(a) {
          D = a ? !0 : !1
        },
        get: function() {
          return D
        }
      });
      var Ka = Aa;
      Object.defineProperty(this, "minScale", {
        set: function(a) {
          hd(!1, a)
        },
        get: function() {
          return Ka
        }
      });
      var pb = hb;
      Object.defineProperty(this, "maxScale", {
        set: function(a) {
          hd(!0, a)
        },
        get: function() {
          return pb
        }
      });
      var aa = !1;
      if ("undefined" != typeof document.ontouchstart) try {
        document.createEvent("TouchEvent"), aa = !0
      } catch (Rd) {}
      var vb = !1;
      if (navigator.msMaxTouchPoints) try {
        document.createEvent("MsPointerEvent"), vb = !0
      } catch (Sd) {}
      Object.defineProperty(this, "isTouchAvailable", {
        get: function() {
          return aa || vb
        }
      });
      var M =
        aa || vb;
      Object.defineProperty(this, "useTouch", {
        set: function(a) {
          Vc(a)
        },
        get: function() {
          return M
        }
      });
      var Oc = !1;
      try {
        document.createEvent("DeviceOrientationEvent"), Oc = !0
      } catch (Td) {}
      Object.defineProperty(this, "isOrientationAvailable", {
        get: function() {
          return Oc
        }
      });
      var U = ma;
      Object.defineProperty(this, "orientationMode", {
        set: function(a) {
          switch (a) {
            case "absolute":
              Db(Wa);
              break;
            case "relative":
              Db(Xa);
              break;
            default:
              Db(ma)
          }
        },
        get: function() {
          return Md()
        }
      });
      var Va = 0,
        Bb = 0,
        la = !1;
      Object.defineProperty(this, "mouseMode", {
        set: function(a) {
          la =
            "grab" == a;
          R()
        },
        get: function() {
          return la ? "grab" : "pan"
        }
      });
      var Qc = !1;
      Object.defineProperty(this, "mouseWheel", {
        set: function(a) {
          Qc = "in" == a
        },
        get: function() {
          return Qc ? "in" : "out"
        }
      });
      var Za = "",
        Fa = "",
        Ga = "",
        kb = "";
      Object.defineProperty(this, "panCursor0", {
        set: function(a) {
          ea(a);
          Za = a;
          R()
        },
        get: function() {
          return Za
        }
      });
      Object.defineProperty(this, "panCursor1", {
        set: function(a) {
          ea(a);
          Fa = a;
          R()
        },
        get: function() {
          return Fa
        }
      });
      Object.defineProperty(this, "grabCursor0", {
        set: function(a) {
          ea(a);
          Ga = a;
          R()
        },
        get: function() {
          return Ga
        }
      });
      Object.defineProperty(this, "grabCursor1", {
        set: function(a) {
          ea(a);
          kb = a;
          R()
        },
        get: function() {
          return kb
        }
      });
      var ub = 2;
      Object.defineProperty(this, "softPan", {
        set: function(a) {
          ub = Ha(a, 0, 5)
        },
        get: function() {
          return ub
        }
      });
      var bb = 3;
      Object.defineProperty(this, "softZoom", {
        set: function(a) {
          bb = Ha(a, 0, 5)
        },
        get: function() {
          return bb
        }
      });
      var Ic = 0.5;
      Object.defineProperty(this, "softFade", {
        set: function(a) {
          Ic = Ha(a, 0, 10)
        },
        get: function() {
          return Ic
        }
      });
      var ga = Wb;
      Object.defineProperty(this, "loaded", {
        get: function() {
          return x()
        }
      });
      var ed = !0,
        q = 0;
      Object.defineProperty(this, "pan", {
        set: function(a) {
          x() && (v(), q = Ja(a), m())
        },
        get: function() {
          return x() ? q : 0
        }
      });
      var l = 0;
      Object.defineProperty(this, "tilt", {
        set: function(a) {
          x() && (v(), l = nb(a), m())
        },
        get: function() {
          return x() ? l : 0
        }
      });
      var g = 1;
      Object.defineProperty(this, "scale", {
        set: function(a) {
          ia = !1;
          L(a)
        },
        get: function() {
          return g
        }
      });
      var Gb = !1;
      Object.defineProperty(this, "panSpeed", {
        set: function(a) {
          u(a, null)
        },
        get: function() {
          return x() ? j : 0
        }
      });
      Object.defineProperty(this, "tiltSpeed", {
        set: function(a) {
          u(null,
            a)
        },
        get: function() {
          return x() ? o : 0
        }
      });
      Object.defineProperty(this, "mousePan", {
        get: function() {
          return x() ? Cc(g) : 0
        }
      });
      Object.defineProperty(this, "mouseTilt", {
        get: function() {
          return x() ? Dc(g) : 0
        }
      });
      var pa = 0,
        B = 0,
        K = 0,
        N = 0,
        j = 0,
        o = 0,
        Hb = -1,
        zb = -1,
        S = 0,
        ha = 0,
        $b = 0,
        V = 0,
        lc = 0,
        C = -1,
        y = -1,
        J = -1,
        eb = -1,
        yb = null,
        ia = !1,
        Nc = 0,
        Qa = 0,
        Ra = 0,
        T = 0,
        ob = null,
        Ta = null,
        Ua = null,
        Ab = null,
        uc = null;
      Object.defineProperty(this, "onImageLoaded", {
        set: function(a) {
          ob = a
        },
        get: function() {
          return ob
        }
      });
      Object.defineProperty(this, "onClick", {
        set: function(a) {
          Ta = a
        },
        get: function() {
          return Ta
        }
      });
      Object.defineProperty(this, "onDblClick", {
        set: function(a) {
          Ua = a
        },
        get: function() {
          return Ua
        }
      });
      Object.defineProperty(this, "onMouseMove", {
        set: function(a) {
          Ab = a
        },
        get: function() {
          return Ab
        }
      });
      Object.defineProperty(this, "onImageMove", {
        set: function(a) {
          uc = a
        },
        get: function() {
          return uc
        }
      });
      var Eb = !1;
      Object.defineProperty(this, "compassVisible", {
        set: function(a) {
          Eb = a;
          m()
        },
        get: function() {
          return Eb
        }
      });
      var xa = !0;
      Object.defineProperty(this, "hotspotsVisible", {
        set: function(a) {
          xa = a;
          m()
        },
        get: function() {
          return xa
        }
      });
      var Oa = pd(!1),
        Pa = pd(!0);
      Object.defineProperty(this, "hotspotInfo", {
        set: function(a) {
          Jd(a)
        },
        get: function() {
          return Oa.src
        }
      });
      Object.defineProperty(this, "hotspotLink", {
        set: function(a) {
          Kd(a)
        },
        get: function() {
          return Pa.src
        }
      });
      var sa = null,
        ab = null,
        fa = new function() {
          function a() {
            if (d) {
              r = [];
              var a = 1.1 * na * c,
                f = 1.5 * na * c,
                k = 10 + a / 2;
              e && (r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-4, -4);
                  b.lineTo(4, 0);
                  b.lineTo(-4, 4);
                  b.closePath();
                  b.stroke()
                },
                fnClick: function() {
                  yc()
                }
              }), k += f);
              i && (r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-4, 0);
                  b.lineTo(4, 0);
                  b.stroke()
                },
                fnClick: function() {
                  ua(1 / Da)
                },
                fnEnabled: function() {
                  return g > Aa
                }
              }), k += a, r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-4, -1);
                  b.lineTo(0, -4);
                  b.lineTo(0, 6);
                  b.stroke()
                },
                fnClick: function() {
                  L(1)
                },
                fnHilight: function() {
                  return 1 == g
                }
              }), k += a, r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.strokeRect(-4, -4, 8, 8)
                },
                fnClick: function() {
                  L(0)
                },
                fnHilight: function() {
                  return Gb
                }
              }), k += a, r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-4, 0);
                  b.lineTo(4, 0);
                  b.moveTo(0, -4);
                  b.lineTo(0, 4);
                  b.stroke()
                },
                fnClick: function() {
                  ua(Da)
                },
                fnEnabled: function() {
                  return g < hb
                }
              }), k += f);
              l && (r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(3, -3);
                  b.lineTo(-3, 0);
                  b.lineTo(3, 3);
                  b.stroke()
                },
                fnClick: function() {
                  u(j - 2, null)
                }
              }), k += a, r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-3, -4);
                  b.lineTo(-3, 4);
                  b.moveTo(3, -4);
                  b.lineTo(3, 4);
                  b.stroke()
                },
                fnClick: function() {
                  u(0, 0)
                },
                fnEnabled: function() {
                  return 0 != j || 0 != o
                }
              }), k += a, r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-3, -3);
                  b.lineTo(3,
                    0);
                  b.lineTo(-3, 3);
                  b.stroke()
                },
                fnClick: function() {
                  u(j + 2, null)
                }
              }), k += f);
              n && ja && (r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-3, -3);
                  b.lineTo(-9, 0);
                  b.lineTo(-3, 3);
                  b.stroke();
                  b.strokeRect(1, -4, 8, 8)
                },
                fnClick: function() {
                  zc(-1)
                },
                fnEnabled: function() {
                  return 0 < qa
                }
              }), k += a, r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(3, -3);
                  b.lineTo(9, 0);
                  b.lineTo(3, 3);
                  b.stroke();
                  b.strokeRect(-9, -4, 8, 8)
                },
                fnClick: function() {
                  zc(1)
                },
                fnEnabled: function() {
                  return qa < ja.length - 1
                }
              }), k += f);
              q && sa && (r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.arc(0, 0, 4, 0, 2 * Math.PI, !0);
                  b.moveTo(-7, 0);
                  b.lineTo(7, 0);
                  b.moveTo(0, -7);
                  b.lineTo(0, 7);
                  b.stroke()
                },
                fnClick: function() {
                  xa = !xa;
                  m()
                },
                fnHilight: function() {
                  return xa
                }
              }), k += a);
              s && wb && (r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-8, 2);
                  b.lineTo(-8, 6);
                  b.lineTo(-5, 6);
                  b.moveTo(8, 2);
                  b.lineTo(8, 6);
                  b.lineTo(5, 6);
                  b.moveTo(-8, -2);
                  b.lineTo(-8, -6);
                  b.lineTo(-5, -6);
                  b.moveTo(8, -2);
                  b.lineTo(8, -6);
                  b.lineTo(5, -6);
                  b.stroke()
                },
                fnClick: function() {
                  xb(!za)
                },
                fnHilight: function() {
                  return za
                }
              }), k += f);
              t && (r.push({
                x: k,
                fnPaint: function() {
                  b.fillStyle =
                    b.strokeStyle;
                  b.fillText("?", 0, 6)
                },
                fnClick: function() {
                  "javascript:" == t.substr(0, 11).toLowerCase() ? eval(t.substr(11)) : (p = self.open(t, "ViewerHelp", "width=500,height=500,location=no,menubar=no,scrollbars=no,resizable=yes,status=no,toolbar=no,titlebar=yes")) && p.focus()
                }
              }), k += a);
              r.push({
                x: k,
                fnPaint: function() {
                  b.beginPath();
                  b.moveTo(-3, -1);
                  b.lineTo(0, -1);
                  b.lineTo(0, 5);
                  b.moveTo(-4, 5);
                  b.lineTo(4, 5);
                  b.stroke();
                  b.beginPath();
                  b.arc(-0.5, -5, 0.7, 0, 2 * Math.PI, !0);
                  b.stroke()
                },
                fnClick: function() {
                  Zb()
                }
              });
              v && self.opener &&
                r.push({
                  x: k + a,
                  fnPaint: function() {
                    b.beginPath();
                    b.moveTo(0, -7);
                    b.lineTo(0, 3);
                    b.stroke();
                    b.beginPath();
                    b.arc(0, 1, 5, 225 * Math.PI / 180, 315 * Math.PI / 180, !0);
                    b.stroke()
                  },
                  fnClick: function() {
                    p && !p.closed && (p.close(), p = null);
                    window.close()
                  }
                })
            }
          }
          this.getFunctionUnderCursor = function() {
            if (!Kc() || !r) return null;
            var a = na * c / 2,
              b = 20 * c / 2,
              e = d.height - 10 - b;
            if (!(y >= e - b && y <= e + b)) return null;
            for (b = 0; b < r.length; b++)
              if (e = r[b], C >= e.x - a && C <= e.x + a)
                if (e.fnEnabled) {
                  if (e.fnEnabled()) return e.fnClick;
                  break
                } else return e.fnClick;
            return null
          };
          this.mouseOver = function() {
            if (!Kc() || !r || document.activeElement != d) return -1;
            var a = na * c / 2,
              b = 20 * c / 2,
              e = d.height - 10 - b;
            if (!(y >= e - b && y <= e + b)) return -1;
            for (b = 0; b < r.length; b++)
              if (e = r[b], C >= e.x - a && C <= e.x + a) return b;
            return -1
          };
          this.paint = function() {
            if (r) {
              b.save();
              b.globalAlpha = 1;
              var a = !Pc;
              if (a) b.shadowColor = "#000", b.shadowBlur = 1.5, b.shadowOffsetX = 1, b.shadowOffsetY = 2;
              b.font = "bold 16px sans-serif";
              b.textAlign = "center";
              b.textBaseline = "alphabetic";
              b.lineWidth = 1.5;
              b.lineCap = "round";
              b.lineJoin = "round";
              b.fillStyle = "#fff";
              b.strokeStyle = "#fff";
              for (var e = d.height - 10 - 20 * c / 2, f = 0; f < r.length; f++) {
                var g = r[f],
                  i = g.x,
                  j = !g.fnEnabled || g.fnEnabled();
                b.setTransform(c, 0, 0, c, i, e);
                b.fillStyle = g.fnHilight && g.fnHilight() ? a ? "rgba(128, 170, 255, 0.4)" : "rgba(64, 85, 127, 0.6)" : a ? "rgba(24, 32, 48, 0.4)" : "rgba(12, 16, 24, 0.6)";
                b.lineWidth = j ? 2 : 1.01;
                i = new nc(-na / 2, -10, na, 20);
                yd(i, 4);
                b.fill();
                b.stroke();
                b.lineWidth = 1.5;
                g.fnPaint()
              }
              b.restore()
            }
          };
          this.create = a;
          var c = 1;
          Object.defineProperty(this, "size", {
            set: function(a) {
              c = Ha(a, 0.7, 2);
              fa.create()
            },
            get: function() {
              return c
            }
          });
          var f = !0,
            e = !0,
            i = !0,
            l = !0,
            n = !0,
            q = !0,
            s = !0,
            t = "",
            p = null,
            v = !0;
          Object.defineProperty(this, "visible", {
            set: function(a) {
              f = a;
              m()
            },
            get: function() {
              return f
            }
          });
          Object.defineProperty(this, "reset", {
            set: function(b) {
              e = b;
              a()
            },
            get: function() {
              return e
            }
          });
          Object.defineProperty(this, "scale", {
            set: function(b) {
              i = b;
              a()
            },
            get: function() {
              return i
            }
          });
          Object.defineProperty(this, "motion", {
            set: function(b) {
              l = b;
              a()
            },
            get: function() {
              return l
            }
          });
          Object.defineProperty(this, "hotspots", {
            set: function(b) {
              q = b;
              a()
            },
            get: function() {
              return q
            }
          });
          Object.defineProperty(this, "fullWindow", {
            set: function(b) {
              s = b;
              a()
            },
            get: function() {
              return s
            }
          });
          Object.defineProperty(this, "browse", {
            set: function(b) {
              n = b;
              a()
            },
            get: function() {
              return n
            }
          });
          Object.defineProperty(this, "helpUrl", {
            set: function(b) {
              t = b;
              a()
            },
            get: function() {
              return t
            }
          });
          Object.defineProperty(this, "closeWindow", {
            set: function(b) {
              v = b;
              a()
            },
            get: function() {
              return v
            }
          });
          var r = null;
          a()
        };
      this.controls = fa;
      var Hc = !1,
        Jc = -1;
      vc(Rc, !0)
    } else alert("PanoradoJS requires a browser with ECMAScript 5 support! Hint: Prevent compatibility mode in MSIE!")
};