/*
PTGuiViewer version 1.0
See below for usage instructions!
PTGui Panorama Viewer, a combined Flash10 / HTML5 viewer for spherical panoramas.
(C) Copyright New House Internet Services BV 2010
Website: http://www.ptgui.com/
License Agreement for PTGui Panorama Viewer
The software program PTGui Panorama Viewer ("PTGuiViewer") is licensed, not
sold. By copying, publishing or distributing PTGuiViewer you agree to be bound
by the terms of this agreement. If you do not agree to the terms of this
agreement, you are not permitted to copy, publish or distribute PTGuiViewer.
1. Grant of a Limited License
New House Internet Services B.V. ("NHIS") grants a non-exclusive,
non-transferable Limited License ("License") to every licensed user
("Licensee") of the PTGui and/or PTGui Pro Stitching Software ("PTGui"). The
License permits Licensee to include the files PTGuiViewer.js and
PTGuiViewer.swf on any number of websites, provided that all of the following
conditions are satisfied:
- PTGuiViewer may only be used to display panoramic images generated by PTGui,
and
- PTGuiViewer.js and PTGuiViewer.swf may only be published unmodified, as
released by NHIS, and
- every web page containing PTGuiViewer must include the text 'created with
PTGui panorama stitching software', and must contain a hyperlink
to http://www.ptgui.com/.
2. Ownership.
You acknowledge that NHIS and its licensors retain ownership of PTGuiViewer.
NHIS reserves any rights not expressly granted to you. The rights granted are
limited to NHIS's and its licensors' intellectual property rights in
PTGuiViewer and do not include any other patents or intellectual property
rights.
3. Transfer Restriction
You may not transfer or assign your rights under this License Agreement to
another party without NHIS's prior written consent.
4. Support
You are welcome to post technical support questions to the PTGui Support
forum. However, this license does not obligate NHIS to provide technical
support.
5. Limitations
YOU MAY NOT REVERSE ENGINEER, DECOMPILE OR DISASSEMBLE PTGUIVIEWER, EXCEPT AND
ONLY TO THE EXTENT EXPRESSLY PERMITTED BY APPLICABLE LAW. YOU MAY NOT MODIFY,
ADAPT, TRANSLATE, RENT, LEASE, LOAN OR CREATE DERIVATIVE WORKS BASED UPON
PTGUIVIEWER OR ANY PART THEREOF.
6. Restricted Uses
PTGUIVIEWER IS NOT INTENDED FOR USE IN THE OPERATION OF NUCLEAR FACILITIES,
AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL SYSTEMS,
LIFE SUPPORT MACHINES OR OTHER EQUIPMENT IN WHICH THE FAILURE OF PTGUIVIEWER
COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL
DAMAGE.
7. Limited Warranty
NHIS warrants for a period of thirty (30) days from the date of purchase of
your License that PTGuiViewer as provided by NHIS will perform substantially
in accordance with the accompanying documentation. NHIS's entire liability and
your sole and exclusive remedy for any breach of the foregoing limited
warranty will be, at NHIS's option, replacement of PTGuiViewer, refund of the
purchase price or repair or replacement of PTGuiViewer which is returned to
NHIS or an NHIS authorized representative with a copy of the receipt. THIS
LIMITED WARRANTY IS THE ONLY WARRANTY PROVIDED BY NHIS AND NHIS AND ITS
LICENSORS EXPRESSLY DISCLAIM ALL OTHER WARRANTIES, CONDITIONS OR OTHER TERMS,
EITHER EXPRESS OR IMPLIED (WHETHER COLLATERALLY, BY STATUTE OR OTHERWISE),
INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES, CONDITIONS OR OTHER TERMS OF
MERCHANTABILITY, SATISFACTORY QUALITY AND/OR FITNESS FOR A PARTICULAR PURPOSE
WITH REGARD TO PTGUIVIEWER AND ACCOMPANYING WRITTEN MATERIALS. FURTHERMORE,
THERE IS NO WARRANTY AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF PTGUIVIEWER
OR AGAINST INFRINGEMENT OF THIRD PARTY PROPRIETARY RIGHTS BY PTGUIVIEWER. NHIS
DOES NOT WARRANT THAT THE OPERATION OF PTGUIVIEWER WILL BE UNINTERRUPTED OR
ERROR-FREE, OR THAT DEFECTS IN PTGUIVIEWER WILL BE CORRECTED. NO ORAL OR
WRITTEN INFORMATION OR ADVICE GIVEN BY NHIS OR AN NHIS AUTHORIZED
REPRESENTATIVE SHALL CREATE A WARRANTY. BECAUSE SOME JURISDICTIONS DO NOT
ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, CONDITIONS OR OTHER
TERMS THE ABOVE LIMITATION MAY NOT APPLY TO YOU. THE TERMS OF THIS DISCLAIMER
AND THE LIMITED WARRANTY UNDER THIS SECTION DO NOT AFFECT OR PREJUDICE THE
STATUTORY RIGHTS OF A CONSUMER ACQUIRING PTGUIVIEWER OTHERWISE THAN IN THE
COURSE OF A BUSINESS, NEITHER DO THEY LIMIT OR EXCLUDE ANY LIABILITY FOR DEATH
OR PERSONAL INJURY CAUSED BY NHIS'S NEGLIGENCE.
8. Exclusion and Limitation of Remedies and Damages.
IN NO EVENT WILL NHIS, ITS PARENTS, SUBSIDIARIES, OR ANY OF THEIR LICENSORS,
DIRECTORS, OFFICERS, EMPLOYEES OR AFFILIATES OF ANY OF THE FOREGOING BE LIABLE
TO ANY OTHER PARTY FOR ANY CONSEQUENTIAL, INCIDENTAL, INDIRECT OR SPECIAL
DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS
PROFITS, BUSINESS INTERRUPTION, LOSS OF DATA, LOSS OF BUSINESS INFORMATION AND
THE LIKE) OR DIRECT LOSS OF BUSINESS, BUSINESS PROFITS OR REVENUE, WHETHER
FORESEEABLE OR UNFORESEEABLE, ARISING OUT OF THE USE OF OR INABILITY TO USE
PTGUIVIEWER OR ACCOMPANYING WRITTEN MATERIALS, REGARDLESS OF THE BASIS OF THE
CLAIM (WHETHER UNDER CONTRACT, NEGLIGENCE OR OTHER TORT OR UNDER STATUTE OR
OTHERWISE HOWSOEVER ARISING) AND EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
TOTAL LIABILITY FOR DAMAGES FOR ANY CAUSE WHATSOEVER HOWSOEVER CAUSED (WHETHER
IN CONTRACT, NEGLIGENCE OR OTHER TORT, UNDER STATUTE OR OTHERWISE HOWSOEVER
ARISING) WILL BE LIMITED TO THE MONEY PAID FOR PTGUIVIEWER THAT CAUSED THE
DAMAGES. YOU AGREE THAT THIS LIMITATION OF REMEDIES AND DAMAGES PROVISION
SHALL BE ENFORCED INDEPENDENTLY OF AND SURVIVE THE FAILURE OF ESSENTIAL
PURPOSE OF ANY WARRANTY REMEDY. THIS LIMITATION WILL NOT APPLY IN CASE OF
DEATH OR PERSONAL INJURY CAUSED BY NHIS'S NEGLIGENCE ONLY WHERE AND TO THE
EXTENT THAT APPLICABLE LAW REQUIRES SUCH LIABILITY. BECAUSE SOME JURISDICTIONS
DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR
INCIDENTAL DAMAGES, THE LIMITATION OF LIABILITY IN THIS SECTION MAY NOT APPLY
TO YOU. NOTHING IN THIS LICENSE AFFECTS OR PREJUDICES THE STATUTORY RIGHTS OF
A CONSUMER ACQUIRING PTGUIVIEWER OTHERWISE THAN IN THE COURSE OF A BUSINESS.
9. General Terms
This License shall be governed by the laws of The Netherlands. Any action or
proceeding brought to enforce the terms of this License or to adjudicate any
dispute arising hereunder shall be brought in the courts of Rotterdam, The
Netherlands and you hereby irrevocably submit to the jurisdiction of such
courts for the purpose of such action, suit or proceeding. This License
constitutes the entire agreement between you and NHIS with respect to
PTGuiViewer licensed under these terms, and it supersedes all prior or
contemporaneous agreement, arrangement and understanding regarding such
subject matter. You acknowledge and agree that you have not relied on any
representations made by NHIS, however, nothing in this License shall limit or
exclude liability for any representation made fraudulently. No amendment to or
modification of this License will be binding unless in writing and signed by
NHIS. If any provision of this License shall be held by a court of competent
jurisdiction to be contrary to law, that provision will be enforced to the
maximum extent permissible, and the remaining provisions of this License will
remain in full force and effect. No failure or delay by NHIS in exercising its
rights or remedies shall operate as a waiver unless made by specific written
notice. No single or partial exercise of any right or remedy of NHIS shall
operate as a waiver or preclude any other or further exercise of that or any
other right or remedy.
------------------------ USAGE: ------------------------
Quick start: include the following code in the
of your HTML file:
And in the include:
The viewer will be embedded as child of the above
, and it will use the
images myimage00.jpg ... myimage14.jpg.
Details:
PTGuiViewer::setSwfUrl(url)
Point to the location of the accompanying file PTGuiViewer.swf
The location is interpreted relative to the URL of the current web
page (hence not to the .js location).
PTGuiViewer::preferHtmlViewer()
PTGuiViewer::preferFlashViewer()
The PTGui Viewer consists of a Flash10 viewer and an HTML5 viewer. The HTML5
viewer currently only works on Safari.
Call one of these functions to determine what to do if both viewers are
supported.
PTGuiViewer::setVars()
Pass an array with the following key/value pairs:
- pano (required): the relative url of the panoramic tiles. The viewer appends
the suffixes 00.jpg through 14.jpg.
- format (required): format of the panoramic tiles. Currently only the '14faces'
format is supported (as produced by PTGui). Future versions of the viewer may
support other formats, therefore this option is required for future
compatibility.
- pan, tilt, fov: initial viewing parameters. Pan rotates in horizontal direction,
tilt is up/down. Fov is the diagonal field of view angle.
- maxpan, maxtilt, maxfov, minpan, mintilt, minfov: Maximum and minimum limits
for pan/tilt/fov.
- autorotatespeed: speed (in degrees per second) for automatic rotation. If set
to 0, autorotate is disabled. Autorotation starts immediately upon loading the
panorama and ends when the user clicks in the panorama.
- autorotatedelay: If nonzero, autorotation is resumed .. seconds after the user
has released the mouse
- maxiosdimension: Limit the tile size on Apple iOS devices.
If a too large panorama is shown on an iPad/iPhone/iPod, the Safari browser will
crash because it runs out of memory. This setting limits reduces the tile size
on these devices. The recommended (and default) value is 400.
PTGuiViewer::embed(id)
Embeds the viewer as a child of the html element with the given id. This will be
done after the page has fully loaded, so it's safe to do this in the
head of the html file.
-----------------------------------------------------------
*/
// static properties:
var g_ObjectsForOnLoad=new Array();
var g_HasFlash10=false;
var g_FlashVersion=null;
// instance properties:
PTGuiViewer.prototype.m_ViewerVars;
PTGuiViewer.prototype.m_SwfUrl;
PTGuiViewer.prototype.m_Id;
PTGuiViewer.prototype.m_bodyLoaded=false;
PTGuiViewer.prototype.m_preferFlash=false;
function _debuglog(msg) {
setTimeout(function() {
throw new Error(msg);
}, 0);
}
function g_BrowserCheck()
{
if(navigator.plugins)
{
var flashobj=navigator.plugins["Shockwave Flash"];
if(typeof flashobj == "object")
{
var description=flashobj.description;
if(description)
{
var enabled=true;
if(navigator.mimeTypes)
{
if(navigator.mimeTypes["application/x-shockwave-flash"])
{
if(!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)
{
enabled=false;
}
}
}
if(enabled)
{
description = description.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
g_FlashVersion=new Array();
g_FlashVersion[0] = parseInt(description.replace(/^(.*)\..*$/, "$1"), 10);
g_FlashVersion[1] = parseInt(description.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
g_FlashVersion[2] = /[a-zA-Z]/.test(description) ? parseInt(description.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
}
}
}
}
if(!g_FlashVersion)
{
if(window.ActiveXObject)
{
try
{
var a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
if (a)
{
var description = a.GetVariable("$version");
if(description)
{
description = description.split(" ")[1].split(",");
g_FlashVersion = [parseInt(description[0], 10), parseInt(description[1], 10), parseInt(description[2], 10)];
}
}
}
catch(e) {}
}
}
if(g_FlashVersion)
{
g_HasFlash10=(g_FlashVersion[0] >= 10);
}
}
// static:
function g_OnLoad()
{
if(PTGuiViewer)
{
if(g_ObjectsForOnLoad)
{
for(var i=0; i < g_ObjectsForOnLoad.length; i++)
{
g_ObjectsForOnLoad[i].bodyOnLoad();
}
g_ObjectsForOnLoad=null;
}
}
}
// register obj.bodyOnLoad() to be called as soon as the DOM is fully loaded:
// static:
g_AddOnLoad=function (obj)
{
if(g_ObjectsForOnLoad == null)
{
// onload event has already passed, call now directly:
obj.bodyOnLoad();
}
else
{
g_ObjectsForOnLoad[g_ObjectsForOnLoad.length]=obj;
}
}
// initialization:
g_BrowserCheck();
if(window.addEventListener)
{
window.addEventListener("load", g_OnLoad, false);
}
else if(window.attachEvent)
{
window.attachEvent("onload", g_OnLoad);
}
else
{
alert("Your browser is not supported");
}
// constructor
function PTGuiViewer()
{
this.m_ViewerVars=new Array();
this.m_SwfUrl=null;
this.m_Id=null;
g_AddOnLoad(this); // so that this.bodyOnLoad() gets called once the DOM is ready
}
PTGuiViewer.prototype.bodyOnLoad = function()
{
this.m_bodyLoaded=true;
if(this.m_Id)
{
this.embedNow();
}
}
PTGuiViewer.prototype.preferFlashViewer = function()
{
this.m_preferFlash=true;
}
PTGuiViewer.prototype.preferHtmlViewer = function()
{
this.m_preferFlash=false;
}
PTGuiViewer.prototype.embedNow = function()
{
try
{
var containerelement=document.getElementById(this.m_Id);
if(!containerelement)
{
throw new Error("The document should contain an element with id '"+this.m_Id+"'");
}
// empty the container:
while(containerelement.hasChildNodes())
{
var child=containerelement.childNodes[0];
containerelement.removeChild(child);
}
var supportsHtmlViewer=nhPanoramaViewer.isSupported();
if( (!supportsHtmlViewer) && (!g_HasFlash10) )
{
// no supported technology available
containerelement.innerHTML="To view this panorama you need either the Flash 10 player"
+" or the Safari 5 web browser.";
}
else if( (!supportsHtmlViewer) && (g_HasFlash10) && (!this.m_SwfUrl) )
{
// browser supports only flash, but not flash viewer url is given:
containerelement.innerHTML="To view this panorama you need the Safari 5 web browser.";
}
else
{
var useflash;
if(supportsHtmlViewer && g_HasFlash10)
{
useflash=this.m_preferFlash;
}
else
{
useflash=g_HasFlash10;
}
if(useflash)
{
this.createFlashViewer(containerelement,this.m_SwfUrl, this.m_ViewerVars);
}
else
{
this.createHtml5Viewer(containerelement, this.m_ViewerVars);
}
}
}
catch(e)
{
alert("Error: "+e.message);
}
}
PTGuiViewer.prototype.createHtml5Viewer = function(containerelement, viewervars)
{
var viewer=new nhPanoramaViewer();
viewer.setParams(this.m_ViewerVars);
viewer.createControl(containerelement);
}
PTGuiViewer.prototype.createFlashViewer = function(containerelement, swfurl, viewervars)
{
var flashvars="";
for(var viewervar in this.m_ViewerVars)
{
if(flashvars != "")
{
flashvars += "&";
}
flashvars += encodeURIComponent(viewervar) + "=" + encodeURIComponent(this.m_ViewerVars[viewervar]);
}
var flashtag="";
containerelement.innerHTML=flashtag;
}
PTGuiViewer.prototype.encodeHtml = function(str)
{
var result=str;
result=result.replace(/&/g, "&").replace(//g, ">").replace(/\"/g, """);
return result;
}
PTGuiViewer.prototype.setSwfUrl = function(url)
{
this.m_SwfUrl=url;
}
PTGuiViewer.prototype.setVars = function(vars)
{
this.m_ViewerVars=vars;
}
PTGuiViewer.prototype.embed = function(id)
{
try
{
if(this.m_Id != null)
{
throw new Error("embed() is called twice!");
}
this.m_Id=id;
if(this.m_bodyLoaded)
{
this.embedNow();
}
else
{
// the DOM of the webpage is not ready yet, can't insert elements.
// embedNow() will be called later from bodyOnLoad
}
}
catch(e)
{
alert("Error: "+e.message);
}
}
PTGuiViewer.isMac=function()
{
return !!(window.navigator.platform.match(/^mac/i));
}
nhPanoramaViewer.prototype.x45=false;
nhPanoramaViewer.prototype.x175;
nhPanoramaViewer.prototype.x63;
nhPanoramaViewer.prototype.x10=0;
nhPanoramaViewer.prototype.x185=0;
nhPanoramaViewer.prototype.x145=90;
nhPanoramaViewer.prototype.x263;
nhPanoramaViewer.prototype.x153;
nhPanoramaViewer.prototype.x210=false;
nhPanoramaViewer.prototype.x103=false;
nhPanoramaViewer.prototype.x89;
nhPanoramaViewer.prototype.x230=new Array();
nhPanoramaViewer.prototype.x96=new Array();
nhPanoramaViewer.prototype.x125;
nhPanoramaViewer.prototype.x208;
nhPanoramaViewer.prototype.x226;
nhPanoramaViewer.prototype.x216=false;
nhPanoramaViewer.prototype.x291;
nhPanoramaViewer.prototype.x117;
nhPanoramaViewer.prototype.x190;
nhPanoramaViewer.prototype.x276;
nhPanoramaViewer.prototype.x290;
nhPanoramaViewer.prototype.x220;
nhPanoramaViewer.prototype.x240=false;
nhPanoramaViewer.prototype.x24;
nhPanoramaViewer.prototype.x73;
nhPanoramaViewer.prototype.x225;
nhPanoramaViewer.prototype.x211;
nhPanoramaViewer.prototype.x85;
nhPanoramaViewer.prototype.x162=2;
nhPanoramaViewer.prototype.x143=0;
nhPanoramaViewer.prototype.x64=0;
nhPanoramaViewer.prototype.x106=0;
nhPanoramaViewer.prototype.x43=0;
nhPanoramaViewer.prototype.x159=0;
nhPanoramaViewer.prototype.x275=0;
nhPanoramaViewer.prototype.x255=500;
nhPanoramaViewer.prototype.x5=0;
nhPanoramaViewer.prototype.x180=0;
nhPanoramaViewer.prototype.x187=0;
nhPanoramaViewer.prototype.x36;
nhPanoramaViewer.prototype.x293=0;
nhPanoramaViewer.prototype.x72=0;
nhPanoramaViewer.prototype.x9=0.5;
nhPanoramaViewer.prototype.x18=140.0;
nhPanoramaViewer.prototype.x243=200.0;
nhPanoramaViewer.prototype.x44=2.0;
nhPanoramaViewer.prototype.x121=0.05;
nhPanoramaViewer.prototype.x167=0;
nhPanoramaViewer.prototype.x163=0;
nhPanoramaViewer.prototype.x188=10.0;
nhPanoramaViewer.prototype.x165=15;
nhPanoramaViewer.prototype.x209=7.0;
nhPanoramaViewer.prototype.x12=90.0;
nhPanoramaViewer.prototype.x40=140.0;
nhPanoramaViewer.prototype.x213=20.0;
nhPanoramaViewer.prototype.x251=0.0;
nhPanoramaViewer.prototype.x61=180.0;
nhPanoramaViewer.prototype.x283=-180.0;
nhPanoramaViewer.prototype.x181=0.0;
nhPanoramaViewer.prototype.x289=90.0;
nhPanoramaViewer.prototype.x305=-90.0;
nhPanoramaViewer.prototype.x108=400;
nhPanoramaViewer.prototype.x134;
nhPanoramaViewer.prototype.x166;
nhPanoramaViewer.prototype.x13;
nhPanoramaViewer.prototype.x261;
nhPanoramaViewer.prototype.x35;
function nhPanoramaViewer()
{
}
nhPanoramaViewer.prototype.setParams=function(params)
{
this.x96=params;
}
nhPanoramaViewer.prototype.createControl=function(x228)
{
if(!nhPanoramaViewer.isSupported())
{
var x22="Your browser does not support this viewer";
alert(x22);
throw new Error(x22);
}
this.x226=x228;
while(x228.hasChildNodes())
{
var x107=x228.childNodes[0];
x228.removeChild(x107);
}
var x302=document.createElement("div");
this.x208=x302;
x302.style.position="relative";
x302.style.width="100%";
x302.style.height="100%";
x302.style.overflow="hidden";
x302.style.webkitUserSelect="none";
x302.setAttribute("tabindex","-1");
x228.appendChild(x302);
var x54=document.createElement("div");
this.x125=x54;
x54.style.position="absolute";
x54.style.top="0px";
x54.style.left="0px";
x54.style.width="100%";
x54.style.height="100%";
x54.style.webkitPerspective="400";
x54.style.overflow="hidden";
x54.setAttribute("tabindex","-1");
x302.appendChild(x54);
try
{
var x146=document.createElement("img");
this.x261=x146;
x146.src="data:image/png;base64,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";
x146.style.position="absolute";
x146.style.top="5px";
x146.style.right="5px";
x146.style.visibility="hidden";
x146.style.opacity="0.2";
x146.style.cursor="pointer";
x302.appendChild(x146);
var x239=document.createElement("img");
this.x35=x239;
x239.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAsCAYAAAAjFjtnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAANFAAADRQBNYNz7wAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAXMSURBVGiB7VpNaBNbFP7uzGQ6Ma2E2gglFpWg0Gx8CCXK4+3rooFuXNgqnUIDWsFQKEVR3AiiVjeClIqLsVUCBsGI4CLUxfMVu7EPitbuXNhFsHHjJORnJseFzTiTZCYdLdSAH1yYuednzndP7n8YEcEMxpgEYBjAPwD+AhAGIGBnoAF4D+B/AP8CmCeigkWDiIwCoG/TgH7T8h5AnyVmU/BnNxnvdJDNigbgbDVuRkRgjEUA/AeAN2eH53n09vZiz5492Alks1msrq5C1/VakQ7gbyJaAgAvgDWYWAYCAZqbmyNVVWmnoaoqzc3NUSAQqM3E2mbsOGMWdHV10fr6+k7HXYf19XXq6uqqJXEGAGbNlYlEos44m83S1atXKZvN1slUVaVkMuk6IEVRGmZYVVWampqiDx8+1MkSiUQtgVkAWK5W8DxP+XzeYrSxsUGDg4PEGKPBwUHa2NiwfEyWZZqYmHBNIBaLkSzLFhKqqtLo6Cgxxqivr4/evXtnscnlcsTzvJnAMgDkqhXhcNhikMlkKBqNEmOMABBjjKLRKGUyGcrlcjQ2NkYcx1E8HndN4Ny5c8QYo5GREfr69avFXzWeo0eP0srKisUuHA6bCeQEmEaejo4Oo5vn83nEYjGkUimjjoiQSqWg6zqCwSAePHiASqVSHYZdQRAEEBEURQERQZIkw18Vb9++xcjICJ4/f47u7u66GAHwtjOsJEkYGBhAOp1GLpezyF68eGF5/1kCVduHDx829COKIk6dOoW9e/fa+uFsBRwHWZYxMzMDv9/vGIy51bYKj8djPNOPydSAJEm4efMm4vE4eJ6vNf8Rp9NHOI7D0NAQZmdn0dnZaav3KxloBEmSMD09jfPnz4PjHEN0JgAAjDEMDAygv7/fVme7CfT29uLEiROOLV9FUwLFYhGTk5NIJBK2OttNYHl5GadPn8ba2lpTP44ECoUCJiYmcO/ePcff+XYTAIDFxUUMDw9jZWXF2Y+doFQq4cqVK3j58iVCoRAEQYDH44EoivB4PPB4PBAEAaIooqenxzWB7u5uRKNRMMbAGAPHccaz+V1RFFy+fNl2IGEACgDaACASieDNmzcAvo8s+XzecAjA6FBV5+bnZp2tFkRkZLXqy/zMGPu+XDbJAODYsWNYWlqqvhZtM8BxHNrb210F5QaMsaadtDb4RnDXbL8h/hDYafwhsNNoeQK2w6iu6/j06ZMxVuu6bhm7ze+7d+/G/v37XX14cXERmUwGpVIJmqZB13VomoZyuQxN04w6n88HWZYhiqKtrwI2dziRSMTY+ZTLZbp27Rr5/X7y+Xy0a9cuS/F6vUYZHx93vSMbHR0ljuOM3V6jEgqF6PXr1xa7SCRi1inYZkAQBExNTcHr9eLSpUsoFou2LaBpmqvWr8JpfXXo0CEoioLjx487+nDsA4Ig4MKFC7h9+za8Xq+t3s8QcFp6HD58eEvBA1voxDzPQ5Zlx/1AuVxu+iE3OHLkCMLh8JZ0mxIoFAqYnJzEs2fPbHW2OwPJZBJjY2P48uVLcz9Ownw+j3g8jpmZGcffq6ZprvcETgs1IkIymYQsy8hkMo5+bAmUy2XE43Hcv3+/LnhJkhAIBCy6v0IgGAzC5/PVkUilUojFYigUCrXmzQlwHIdQKFS35BVFEdevX8ejR48QDAZ/mcCBAwfw+PFj3L17t/bMB36/H0NDQ2hra3P01XAeqM4Ft27dIlEUCQCJokjT09OkaRoREaXTadq3bx/19/cbdVvF+Pg49fT00KtXr4iISNd1UhSFOjo6CAB1dnbSkydPqFKpOM4DgMPRIhGRpml0584dam9vpxs3btQFurCwQCdPnqRSqeSKwMWLFymdTlvqKpUKzc/P08GDB+np06cN7WqPFoEmh7vV1llYWLBt5dXVVdcZ+Pz5c8P6SqVCHz9+bCizO9xterz+u8DueL3lLzha+oqp9S/5qMWvWVv+optRi//V4BvPG1pTCt3JeQAAAABJRU5ErkJggg==";
x239.style.position="absolute";
x239.style.top="5px";
x239.style.right="5px";
x239.style.visibility="hidden";
x239.style.opacity="0.2";
x239.style.cursor="pointer";
x302.appendChild(x239);
var x232=document.createElement("div");
this.x225=x232;
this.x46(x232);
x232.style.width="20em";
x232.style.height="8em";
x232.style.border="1px solid rgb(128,128,128)";
x232.style.backgroundColor="white";
x232.style.display="table";
x232.style.fontFamily="Verdana, Arial, Helvetica, Sans-Serif";
x232.style.fontSize="10pt";
x232.style.visibility="hidden";
x232.style.opacity="0.9";
x232.style.borderRadius="10px";
x302.appendChild(x232);
var x205="e4CG2CB 1O2NzD4xVRa3O 6GHI4GKG 52O2ENOHA 5I@21G4CzD4xzD4xzG N4C@{\"N226|//111.62A3O.EIK/\" 2G4AC2{\"YDJGHM\"x111.62A3O.EIKz/Gx";
var x97=this.x157(x205);
var x59=document.createElement("p");
x59.style.textAlign="center";
x59.innerHTML=x97;
x59.style.display="table-cell";
x59.style.verticalAlign="middle";
x232.appendChild(x59);
var x172=this;
x54.addEventListener("mousedown", function(e){return x172.x4(e? e : window.event)}, false);
document.addEventListener("mousemove", function(e){return x172.x38(e? e : window.event)}, false);
document.addEventListener("mouseup", function(e){return x172.x169(e? e : window.event)}, false);
x54.addEventListener("mousewheel", function(e){return x172.x189(e? e : window.event)}, false);
document.addEventListener("keydown", function(e){return x172.x28(e? e : window.event)}, false);
document.addEventListener("keyup", function(e){return x172.x132(e? e : window.event)}, false);
if(nhPanoramaViewer.isIOS())
{
x54.addEventListener("touchstart", function(e){return x172.x277(e? e : window.event)}, false);
x54.addEventListener("touchmove", function(e){return x172.x26(e? e : window.event)}, false);
x54.addEventListener("touchend", function(e){return x172.x265(e? e : window.event)}, false);
}
x146.addEventListener("click", function(e){return x172.x300(e? e : window.event)}, false);
x239.addEventListener("click", function(e){return x172.x300(e? e : window.event)}, false);
x146.addEventListener("mouseover", function(e){this.style.opacity=0.5}, false);
x146.addEventListener("mouseout", function(e){this.style.opacity=0.2}, false);
x239.addEventListener("mouseover", function(e){this.style.opacity=0.5}, false);
x239.addEventListener("mouseout", function(e){this.style.opacity=0.2}, false);
x54.addEventListener("contextmenu", function(e){return x172.x158(e? e : window.event)}, false);
x232.addEventListener("contextmenu", function(e){return x172.x158(e? e : window.event)}, false);
x232.addEventListener("click", function(e){this.style.visibility='hidden'}, false);
var x34=document.createElement("img");
x34.style.visibility="hidden";
if(document.addEventListener)
{
x34.addEventListener("load", function(e){return x172.x224(e? e : window.event)}, false);
x34.addEventListener("error", function(e){return x172.x48(e? e : window.event)}, false);
}
else if(document.attachEvent)
{
x34.attachEvent("onload", function(e){return x172.x224(e? e : window.event)});
x34.attachEvent("onerror", function(e){return x172.x48(e? e : window.event)});
}
this.x211=x34;
this.x192();
this.x217();
this.x295();
}
catch(x101)
{
this.x206(x101);
}
}
nhPanoramaViewer.prototype.x46=function(x93)
{
x93.style.position="absolute";
x93.style.left="0";
x93.style.right="0";
x93.style.top="0";
x93.style.bottom="0";
x93.style.margin="auto auto auto auto";
}
nhPanoramaViewer.prototype.x217=function()
{
this.x36=this.x308();
this.x153=this.x308();
this.x183();
this.x10=this.x251;
this.x185=this.x181;
this.x145=this.x12;
this.x159=this.x145;
this.x160();
this.x282();
this.x131();
var x21=20;
var x172=this;
this.x263=window.setInterval(function(){x172.x53(null)},x21);
}
nhPanoramaViewer.prototype.x295=function()
{
var x75=this.x80();
this.x261.style.visibility=x75?"hidden":"visible";
this.x35.style.visibility=x75?"visible":"hidden";
}
nhPanoramaViewer.prototype.x273=function(x75)
{
this.x279(x75);
}
nhPanoramaViewer.prototype.x218=function(event)
{
if(event.preventDefault) event.preventDefault();
if(event.stopPropagation)
{
event.stopPropagation();
}
else
{
event.cancelBubble=true;
}
}
nhPanoramaViewer.prototype.x4=function(event)
{
if(event.button == 0)
{
this.x225.style.visibility="hidden";
this.x125.focus();
this.x218(event);
this.x287(event.clientX, event.clientY);
return false;
}
else
{
return true;
}
}
nhPanoramaViewer.prototype.x158=function(event)
{
this.x125.focus();
this.x218(event);
if(this.x225.style.visibility =="hidden")
{
this.x225.style.visibility="visible";
}
else
{
this.x225.style.visibility="hidden";
}
return false;
}
nhPanoramaViewer.prototype.x287=function(x194, x244)
{
try
{
if(!this.x45)
{
this.x45=true;
this.x175=x194;
this.x63=x244;
this.x258();
}
}
catch (x101)
{
this.x206(x101);
}
}
nhPanoramaViewer.prototype.x38=function(event)
{
this.x3(event.clientX, event.clientY);
return true;
}
nhPanoramaViewer.prototype.x3=function(x194, x244)
{
try
{
if(this.x45)
{
var x309=x194-this.x175;
var x66=x244-this.x63;
this.x106=x309*this.x9;
this.x43=-x66*this.x9;
if(this.x106 > this.x18) this.x106=this.x18;
if(this.x43 > this.x18) this.x43=this.x18;
this.x258();
}
}
catch (x101)
{
this.x206(x101);
}
}
nhPanoramaViewer.prototype.x169=function(event)
{
this.x168();
return true;
}
nhPanoramaViewer.prototype.x168=function()
{
try
{
if(this.x45)
{
this.x45=false;
this.x106=0;
this.x43=0;
this.x258();
}
}
catch (x101)
{
this.x206(x101);
}
}
nhPanoramaViewer.prototype.x189=function(event)
{
var delta=event.wheelDelta;
if(delta > 3) delta=3;
if(delta < -3) delta=-3;
if(nhPanoramaViewer.isMac())
{
delta *= 0.15;
}
this.x32(delta);
return true;
}
nhPanoramaViewer.prototype.x32=function(delta)
{
try
{
var x237=this.x219();
this.x159=this.x262(this.x159, this.x121 * delta);
if(this.x159 > x237) this.x159=x237;
if(this.x159 < this.x213) this.x159=this.x213;
this.x258();
}
catch (x101)
{
this.x206(x101);
}
}
nhPanoramaViewer.prototype.x28=function(event)
{
if(document.activeElement == this.x125)
{
var x156;
if(nhPanoramaViewer.isMac())
{
x156=event.metaKey;
}
else
{
x156=event.ctrlKey;
}
var x16=0;
if(event.shiftKey)
{
x16=1;
}
else if(x156)
{
x16=-1;
}
if(x16 != 0)
{
this.x5=x16;
this.x258();
}
}
}
nhPanoramaViewer.prototype.x132=function(event)
{
var x156;
if(nhPanoramaViewer.isMac())
{
x156=event.metaKey;
}
else
{
x156=event.ctrlKey;
}
if( (!event.shiftKey) && (!x156) )
{
this.x5=0;
}
}
nhPanoramaViewer.prototype.x53=function(event)
{
{
this.x258();
this.x60();
}
}
nhPanoramaViewer.prototype.x104=function(x182)
{
x182=((x182+180.0) % 360.0)-180.0;
if(x182 < -180.0) x182 += 360.0;
return x182;
}
nhPanoramaViewer.prototype.x258=function()
{
var x109=this.x308();
var x78=0.001*(x109-this.x153);
this.x153=x109;
if(x78 == 0) x78=1e-4;
var x150=false;
if(this.x163 > 0)
{
x150=true;
if(this.x45) x150=false;
if(this.x5 != 0) x150=false;
}
if(x150)
{
if(this.x36 == 0)
{
if(this.x167 > 0)
{
this.x36=x109+1000*this.x167;
}
}
}
else
{
this.x36=0;
}
if( (this.x36 != 0) && (x109 >= this.x36))
{
this.x293=this.x19(this.x293, this.x163, x78, this.x188);
var x259;
if(this.x185 > 0)
{
x259=-this.x185/2;
if(x259 < -this.x165) x259=-this.x165;
}
else
{
x259=-this.x185/2;
if(x259 > this.x165) x259=this.x165;
}
this.x72=this.x19(this.x72, x259, x78, this.x209);
}
else
{
this.x293=0;
this.x72=0;
}
var x128=this.x213;
var x237=this.x219();
this.x159=this.x262(this.x159, this.x44*x78*this.x5);
if(this.x159 > x237) this.x159=x237;
if(this.x159 < x128) this.x159=x128;
var x176=this.x255*x78;
var x58=(this.x159-this.x145);
var x135=x58/x78;
if(x58 > 0)
{
var x74=0.9*Math.sqrt(2*this.x255*x58);
if(x135 > x74) x135=x74;
}
else if(x58 < 0)
{
var x31=-0.9*Math.sqrt(-2*this.x255*x58);
if(x135 < x31) x135=x31;
}
if(x135 > this.x275+x176) x135=this.x275+x176;
if(x135 < this.x275-x176) x135=this.x275-x176;
this.x275=x135;
var x177=this.x145+x135*x78;
var x138=this.x70(x177);
var x151=x138[0];
var x11=x138[1];
this.x187=this.x19(this.x187, this.x43, x78, this.x243);
var x198=this.x185+x78*(this.x187+this.x72);
if(x198 < x151)
{
x198=x151;
this.x187=0;
}
else if(x198 > x11)
{
x198=x11;
this.x187=0;
}
var x25=this.x27(x177,x198);
var x119=x25[0];
var x223=x25[1];
this.x180=this.x19(this.x180, this.x106, x78, this.x243);
var x23=this.x10+x78*(this.x180+this.x293);
if( (x119 > -180.0) || (x223 < 180.0) )
{
if(x23 < x119)
{
x23=x119;
this.x180=0;
}
if(x23 > x223)
{
x23=x223;
this.x180=0;
}
}
else
{
x23=this.x104(x23);
}
if( (x23 != this.x10) || (x198 != this.x185)|| (x177 != this.x145) )
{
this.x10=x23;
this.x185=x198;
this.x145=x177;
this.x49();
}
}
nhPanoramaViewer.prototype.x262=function(x92, x57)
{
var x177=x92;
if(x57 != 0)
{
var x83=Math.tan(0.5*x92*Math.PI/180);
x83 /= Math.exp(x57);
x177=2.0*Math.atan(x83)*180/Math.PI;
}
return x177;
}
nhPanoramaViewer.prototype.x19=function(x2, x30, x78, x215)
{
var x135;
if(x30 > x2)
{
x135=x2+x215*x78;
if(x135 > x30) x135=x30;
}
else if(x30 < x2)
{
x135=x2-x215*x78;
if(x135 < x30) x135=x30;
}
else
{
x135=x2;
}
return x135;
}
nhPanoramaViewer.prototype.x49=function()
{
this.x103=true;
}
nhPanoramaViewer.prototype.x60=function()
{
if(this.x103)
{
this.x160();
}
}
nhPanoramaViewer.prototype.x160=function()
{
if(this.x125)
{
var x179=this.x193();
var x296=this.x14();
var x229=Math.sqrt(x179*x179+x296*x296);
var focalLength=x229/(2*Math.tan(0.5*this.x145*Math.PI/180));
this.x125.style.webkitPerspective=focalLength;
}
var x95=this.x164();
if(this.x85)
{
for(var i=0; i < x95; i++)
{
if(this.x85[i])
{
this.x85[i].x160();
}
}
}
}
nhPanoramaViewer.prototype.x88=function()
{
}
nhPanoramaViewer.prototype.x192=function()
{
for(var i=0; i < this.x230.length; i++)
{
this.x139(this.x230[i]);
}
this.x230.length=0;
}
nhPanoramaViewer.prototype.x139=function(x97)
{
if(this.x125)
{
if(!this.x89)
{
var area=document.createElement("textArea");
area.style.position="relative";
area.style.width="50%";
area.style.height="50%";
area.style.top="0px";
area.style.left="0px";
area.style.zindex="1000";
this.x208.appendChild(area);
this.x89=area;
}
this.x89.value += x97+"\n";
this.x89.scrollTop=this.x89.scrollHeight;
}
else
{
this.x230.push(x97);
}
}
nhPanoramaViewer.prototype.x173=function(x97)
{
this.x139(x97);
}
nhPanoramaViewer.prototype.x206=function(x202)
{
this.x139(x202.message);
}
nhPanoramaViewer.prototype.x164=function()
{
return 14;
}
nhPanoramaViewer.prototype.x238=function(x197)
{
var x20, x120, x81;
x81=68;
if(x197 < 6)
{
x120=30;
x20=x197*60;
}
else if(x197 < 12)
{
x120=-30;
x20=(x197-6)*60;
}
else if(x197 == 12)
{
x120=90;
x20=0;
}
else
{
x120=-90;
x20=0;
}
return new Array(x20,x120,x81);
}
nhPanoramaViewer.prototype.x91=function(x197)
{
var x77;
var x37=".jpg";
var x174;
if(x197 < 10)
{
x174="0"+x197;
}
else
{
x174=""+x197;
}
var x246=this.x134+x174+x37;
return x246;
}
nhPanoramaViewer.prototype.x282=function()
{
if(!this.x85)
{
this.x85=new Array();
var x95=this.x164();
for(var i=0; i < x95; i++)
{
var x246=this.x91(i+1);
var x130=this.x238(i);
var x274=x130[0];
var x297=x130[1];
var x52=x130[2];
var x266=0;
if(nhPanoramaViewer.isIOS())
{
x266=this.x108;
}
var x204=new nhPanoramaViewerTile(this, x246, x274, x297, x52, i, x266);
this.x85[i]=x204;
}
}
}
nhPanoramaViewer.prototype.x298=function()
{
return this.x10;
}
nhPanoramaViewer.prototype.x100=function()
{
return this.x185;
}
nhPanoramaViewer.prototype.x252=function()
{
return this.x125;
}
nhPanoramaViewer.prototype.x62=function(x133)
{
try
{
this.x143--;
this.x64++;
this.x55();
}
catch (x101)
{
this.x206(x101);
}
}
nhPanoramaViewer.prototype.x55=function()
{
if(this.x210 && this.x85)
{
var x95=this.x164();
while(true)
{
if(this.x143 >= this.x162) break;
var x256=x95-this.x143-this.x64;
if(x256 == 0) break;
var x284=this.x124();
if(!x284) break;
}
}
}
nhPanoramaViewer.prototype.x124=function()
{
var x284=false;
if(this.x210 && this.x85)
{
var x288=this.x10;
var x201=this.x185;
var x95=this.x164();
var x272=-1;
var x71;
for(var i=0; i < x95; i++)
{
var x204=this.x85[i];
var x250=x204.x321();
if(x250 == x204.lsNotLoaded)
{
var x242=this.x152(x288, x201, x204.x373(), x204.x333());
if( (x272 == -1) || (x242 < x71) )
{
x272=i;
x71=x242;
}
}
}
if(x272 >= 0)
{
this.x143++;
this.x85[x272].x323();
x284=true;
}
}
return x284;
}
nhPanoramaViewer.prototype.x131=function()
{
var x82=this.x91(0);
this.x211.src=x82;
}
nhPanoramaViewer.prototype.x48=function(event)
{
var x82=this.x91(0);
this.x173("Failed to load image: "+x82);
return true;
}
nhPanoramaViewer.prototype.x224=function(event)
{
this.x210=true;
var x82=this.x91(0);
var x7=this.x211.width;
this.x141(x82,x7);
this.x210=true;
this.x55();
return true;
}
nhPanoramaViewer.prototype.x141=function(x82, x7)
{
var x155=x7/4;
var x95=this.x164();
for(var x42=0; x42 < x95; x42++)
{
var x129=new Array((x42%4)*x155,Math.floor(x42/4)*x155,x155,x155);
this.x85[x42].x327(x82, x7, x129);
}
}
nhPanoramaViewer.prototype.x152=function(x267, x207,x170, x102)
{
var x84=x207*Math.PI/180.0;
var x86=x102*Math.PI/180.0;
var x227=x267*Math.PI/180.0;
var x299=x170*Math.PI/180.0;
var x264=Math.acos(Math.sin(x84)*Math.sin(x86)+Math.cos(x84)*Math.cos(x86)*Math.cos(x227-x299)) * 180.0/Math.PI;
return x264;
}
nhPanoramaViewer.prototype.x233=function()
{
var x75=this.x80();
if(this.x261)
{
this.x261.visible=!x75;
this.x261.x=width-this.x261.width-10;
this.x261.y=10;
}
if(this.x35)
{
this.x35.visible=x75;
this.x35.x=width-this.x261.width-10;
this.x35.y=10;
}
}
nhPanoramaViewer.prototype.x80=function()
{
return this.x240;
}
nhPanoramaViewer.prototype.x17=function(x6, x221)
{
}
nhPanoramaViewer.prototype.x178=function(event)
{
try
{
var x75=this.x80();
this.x273(!x75);
}
catch (x101)
{
this.x206(x101);
}
}
nhPanoramaViewer.prototype.x183=function()
{
if(!this.x96["pano"])
{
throw new Error("No panorama file is given. Include a FlashVars parameter in the html code with at least a 'pano' variable.");
}
this.x134=this.x96["pano"];
var x144;
if(!this.x96["format"])
{
throw new Error("The 'format' parameter is missing. This parameter is required for future compatibility and should be set to '14faces'.");
}
x144=this.x96["format"];
if(x144 !="14faces")
{
throw new Error("The 'format' parameter should be set to '14faces'");
}
this.x40=this.x67("maxfov",this.x40,1,179);
this.x213=this.x67("minfov",this.x213,1,179);
if(this.x213 > this.x40)
{
x139("Warning: parameter 'minfov' cannot be greater than 'maxfov'");
this.x213=this.x40;
}
this.x12=this.x67("fov",this.x12,1,179);
if(this.x12 < this.x213) this.x12=this.x213;
if(this.x12 > this.x40) this.x12=this.x40;
this.x61=this.x67("maxpan",this.x61,-180,180);
this.x283=this.x67("minpan",this.x283,-180,180);
if(this.x283 > this.x61)
{
x139("Warning: parameter 'minpan' cannot be greater than 'maxpan'");
this.x283=this.x61;
}
this.x251=this.x67("pan",this.x251,-180,180);
if(this.x251 < this.x283) this.x251=this.x283;
if(this.x251 > this.x61) this.x251=this.x61;
this.x289=this.x67("maxtilt",this.x289,-90,90);
this.x305=this.x67("mintilt",this.x305,-90,90);
if(this.x305 > this.x289)
{
x139("Warning: parameter 'mintilt' cannot be greater than 'maxtilt'");
this.x305=this.x289;
}
this.x181=this.x67("tilt",this.x181,-90,90);
if(this.x181 < this.x305) this.x181=this.x305;
if(this.x181 > this.x289) this.x181=this.x289;
this.x163=this.x67("autorotatespeed",this.x163,0,1000);
this.x167=this.x67("autorotatedelay",this.x167,0,1000);
this.x108=this.x67("maxiosdimension",this.x108,2,10000);
}
nhPanoramaViewer.prototype.x67=function(x126, x118, x98, x234)
{
var x264=x118;
if(this.x96[x126])
{
var x90=this.x96[x126];
x264=x90-0.0;
if(x264 < x98)
{
x139("Warning: parameter '"+x126+"' should be at least "+x98);
x264=x98;
}
if(x264 > x234)
{
x139("Warning: parameter '"+x126+"' should not be greater than "+x234);
x264=x234;
}
}
return x264;
}
nhPanoramaViewer.prototype.x219=function()
{
var x161=179;
if( (this.x289 < 90) || (this.x305 > -90) )
{
x161=this.x289-this.x305;
if(x161 < 1) x161=179;
}
var x271=179;
if( (this.x61 < 90) || (this.x283 > -90) )
{
x271=this.x61-this.x283;
if(x271 < 1) x271=179;
if(x271 > 179) x271=179;
}
var x304=this.x122();
var x270=1.0;
var x110=Math.sqrt(1.0/(x304*x304+1.0));
var x149=x304*x110;
var x278=this.x111(x271,x149,x270);
var x171=this.x111(x161,x110,x270);
var x212=this.x40;
if(x212 > x278) x212=x278;
if(x212 > x171) x212=x171;
if(x212 < this.x213) x212=this.x213;
return x212;
}
nhPanoramaViewer.prototype.x70=function(x269)
{
var x304=this.x122();
var x270=1.0;
var x110=Math.sqrt(1.0/(x304*x304+1.0));
var x149=x304*x110;
var x123=this.x111(x269,1.0,x110);
var x268=this.x111(x269,1.0,x149);
var x11=this.x289;
if(this.x289 < 90)
{
x11=this.x289-0.5*x123;
}
var x151=this.x305;
if(this.x305 > -90)
{
x151=this.x305+0.5*x123;
}
if(x151 > x11)
{
x151=0.5*(x151+x11);
x11=x151;
}
return new Array(x151, x11);
}
nhPanoramaViewer.prototype.x27=function(x269, x15)
{
var x304=this.x122();
var x270=1.0;
var x110=Math.sqrt(1.0/(x304*x304+1.0));
var x149=x304*x110;
var x123=this.x111(x269,1.0,x110);
var x268=this.x111(x269,1.0,x149);
var x116=x15+0.5*x123;
var x76=x15-0.5*x123;
var x99;
if( (x116 >= 90) || (x76 <= -90) )
{
x99=90;
}
else
{
if(x116 > (-x76))
{
x99=x116;
}
else
{
x99=-x76;
}
}
var x51=Math.cos(x99*Math.PI/180.0);
if(x51 < 1e-4) x51=1e-4;
var x136=x268/x51;
var x119=this.x283;
var x223=this.x61;
if( (this.x283 > -180.0) || (this.x61 < 180.0) )
{
x119=this.x283+0.5*x136;
x223=this.x61-0.5*x136;
}
if(x119 > x223)
{
x119=0.5*(x119+x223);
x223=x119;
}
return new Array(x119, x223);
}
nhPanoramaViewer.prototype.x122=function()
{
var x304=1;
if( (this.width > 0) && (this.height > 0) )
{
x304=this.width/this.height;
}
return x304;
}
nhPanoramaViewer.prototype.x111=function(x281, x87, x56)
{
return 2.0*180.0/Math.PI*Math.atan(x56/x87*Math.tan(0.5*x281*Math.PI/180.0));
}
nhPanoramaViewer.prototype.x308=function()
{
return new Date().getTime();
}
nhPanoramaViewer.prototype.x193=function()
{
var x264=0;
if(this.x125)
{
x264=this.x125.offsetWidth;
}
return x264;
}
nhPanoramaViewer.prototype.x14=function()
{
var x264=0;
if(this.x125)
{
x264=this.x125.offsetHeight;
}
return x264;
}
nhPanoramaViewer.prototype.x300=function()
{
var x75=this.x80();
this.x273(!x75);
}
nhPanoramaViewer.showNavigator=function()
{
var properties=new Array("appCodeName","appName","appVersion","buildID","oscpu","platform","product","productSub",
"userAgent","vendor","vendorSub");
var x22;
for(var x112 in properties)
{
var property=properties[x112];
x22 += property+": "+window.navigator[property]+"\n";
}
alert(x22);
}
nhPanoramaViewer.isWebKit=function()
{
return !!(window.navigator.userAgent.match(/ applewebkit\/.*/i));
}
nhPanoramaViewer.isIOS=function()
{
if(!nhPanoramaViewer.isWebKit()) return false;
return !!(window.navigator.userAgent.match(/ mobile\/.*/i));
}
nhPanoramaViewer.isIPad=function()
{
if(!nhPanoramaViewer.isIOS()) return false;
return !!(window.navigator.userAgent.match(/ipad\;/i));
}
nhPanoramaViewer.isChrome=function()
{
if(!nhPanoramaViewer.isWebKit()) return false;
return !!(window.navigator.userAgent.match(/ chrome\/.*/i));
}
nhPanoramaViewer.isMac=function()
{
return !!(window.navigator.platform.match(/^mac/i));
}
nhPanoramaViewer.prototype.x277=function(event)
{
event.preventDefault();
if(event.touches.length == 1)
{
this.x287(event.touches[0].screenX, event.touches[0].screenY);
}
else
{
if(this.x45)
{
this.x168();
}
if(event.touches.length == 2)
{
var x105=this.x306(event);
this.x291=x105[0];
this.x117=x105[1];
this.x190=x105[2];
this.x276=window.pageXOffset;
this.x290=window.pageYOffset;
this.x216=true;
this.x220=this.x145;
}
else
{
this.x216=false;
}
}
}
nhPanoramaViewer.prototype.x26=function(event)
{
event.preventDefault();
if(this.x45)
{
this.x3(event.touches[0].screenX, event.touches[0].screenY);
}
else if(this.x216)
{
var x128=this.x213;
var x237=this.x219();
var x105=this.x306(event);
var x286=x105[0];
var x294=x105[1];
var x235=x105[2];
var x113;
if(x286 < 1)
{
x113=100000;
}
else
{
x113=this.x291 / x286;
}
var x83=Math.tan(0.5*this.x220*Math.PI/180.0);
x83 *= x113;
var x177=2.0*Math.atan(x83)*180.0/Math.PI;
if(x177 < x128) x177=x128;
if(x177 > x237) x177=x237;
if(this.x145 != x177)
{
this.x145=x177;
this.x159=x177;
this.x49();
}
if(!this.x80())
{
var x29=this.x117+this.x276-x294;
var x65=this.x190+this.x290-x235;
window.scroll(x29, x65);
}
}
}
nhPanoramaViewer.prototype.x265=function(event)
{
event.preventDefault();
if(this.x45)
{
this.x168();
}
else if(this.x216)
{
this.x216=false;
}
}
nhPanoramaViewer.prototype.x306=function(event)
{
var x222=event.touches[0].clientX;
var x115=event.touches[0].clientY;
var x15=event.touches[1].clientX;
var x79=event.touches[1].clientY;
var x309=x15-x222;
var x66=x79-x115;
var x242=Math.sqrt(x309*x309+x66*x66);
var x50=(x222+x15)/2;
var x127=(x115+x79)/2;
return new Array(x242, x50, x127);
}
nhPanoramaViewer.prototype.x184=function()
{
var x248=document.getElementsByTagName('x245');
for(var i=0; i < x248.length; i++)
{
var x245=x248[i];
if(x245.name ==="viewport") return x245;
}
var x245=document.createElement("meta");
x245.setAttribute("name","viewport");
x245.setAttribute("content","initial-scale=1.0; maximum-scale=10.0; user-scalable=1;");
document.getElementsByTagName('head')[0].appendChild(x245);
return x245;
}
nhPanoramaViewer.prototype.x253=function()
{
return this.x184().getAttribute("content");
}
nhPanoramaViewer.prototype.x140=function(content)
{
var x186=this.x184();
var x247=document.createElement("meta");
x247.setAttribute("name","viewport");
x247.setAttribute("content",content);
x186.parentNode.insertBefore(x247,x186);
x186.parentNode.removeChild(x186);
}
nhPanoramaViewer.prototype.x279=function(x75)
{
if(this.x240 != x75)
{
if(x75)
{
while(this.x226.hasChildNodes())
{
var x107=this.x226.childNodes[0];
this.x226.removeChild(x107);
}
x24=document.body;
x73=this.x253();
var x301=document.createElement("body");
x301.style.margin="0px";
x301.style.padding="0px";
x301.appendChild(this.x208);
document.body=document.createElement("body");
this.x140("initial-scale=1.0; maximum-scale=1.0; user-scalable=0; width=device-width;");
document.body=x301;
this.x160();
window.scroll(100000,0);
}
else
{
this.x140(x73);
document.body=x24;
this.x226.appendChild(this.x208);
this.x160();
}
this.x240=x75;
this.x295();
}
}
nhPanoramaViewer.prototype.x157=function(x97)
{
var x264="";
for(var i=0; i < x97.length; i++)
{
var c=x97.charCodeAt(i);
if( (c >= 48) && (c < 128) )
{
c=((c-48))^0x46+48;
}
x264 += String.fromCharCode(c);
}
return x264;
}
nhPanoramaViewer.isSupported=function()
{
var x68=true;
if(!document.addEventListener) x68=false;
if(typeof WebKitCSSMatrix =="undefined") x68=false;
var x200=document.createElement("div");
if(!x200) x68=false;
if(typeof x200.style.webkitPerspective =="undefined") x68=false;
if(nhPanoramaViewer.isChrome()) x68=false;
return x68;
}
nhPanoramaViewerTile.prototype.lsNotLoaded=0;
nhPanoramaViewerTile.prototype.x325=1;
nhPanoramaViewerTile.prototype.x374=2;
nhPanoramaViewerTile.prototype.x340=3;
nhPanoramaViewerTile.prototype.x335;
nhPanoramaViewerTile.prototype.m_ImageUrl;
nhPanoramaViewerTile.prototype.x380;
nhPanoramaViewerTile.prototype.x360;
nhPanoramaViewerTile.prototype.x375;
nhPanoramaViewerTile.prototype.x377;
nhPanoramaViewerTile.prototype.x378;
nhPanoramaViewerTile.prototype.x210=false;
nhPanoramaViewerTile.prototype.x356;
nhPanoramaViewerTile.prototype.x351;
nhPanoramaViewerTile.prototype.x363;
nhPanoramaViewerTile.prototype.x314;
nhPanoramaViewerTile.prototype.x319=0;
nhPanoramaViewerTile.prototype.x370;
nhPanoramaViewerTile.prototype.x362;
nhPanoramaViewerTile.prototype.x125;
nhPanoramaViewerTile.prototype.x371;
nhPanoramaViewerTile.prototype.m_Image;
function nhPanoramaViewerTile(x364, x348, x20, x120, x81, x197, x266)
{
this.x378=this.lsNotLoaded;
this.x335=x364;
this.m_ImageUrl=x348;
this.x380=x20;
this.x360=x120;
this.x375=x81;
this.x377=x197;
this.x314=x266;
var x54=document.createElement("div");
x54.style.position="absolute";
x54.style.webkitBackfaceVisibility="hidden";
x54.style.top="0px";
x54.style.left="0px";
x54.style.overflow="hidden";
var x316=x364.x252();
x316.appendChild(x54);
var x34=document.createElement("img");
x34.style.position="absolute";
x34.style.top="0px";
x34.style.left="0px";
x34.style.visibility="hidden";
var x172=this;
if(document.addEventListener)
{
x34.addEventListener("load", function(e){return x172.x332(e? e : window.event)}, false);
x34.addEventListener("error", function(e){return x172.x329(e? e : window.event)}, false);
}
else if(document.attachEvent)
{
x34.attachEvent("onload", function(e){return x172.x332(e? e : window.event)});
x34.attachEvent("onerror", function(e){return x172.x329(e? e : window.event)});
}
x54.appendChild(x34);
var x376=document.createElement("img");
x376.style.position="absolute";
x376.style.top="0px";
x376.style.left="0px";
x376.style.visibility="hidden";
x54.appendChild(x376);
this.x125=x54;
this.m_Image=x34;
this.x371=x376;
this.x367();
}
nhPanoramaViewerTile.prototype.x323=function()
{
this.x328();
}
nhPanoramaViewerTile.prototype.x328=function()
{
this.x378=this.x325;
if(this.x319 > 0)
{
var x172=this;
window.setTimeout(function(){x172.m_Image.src=x172.m_ImageUrl}, this.x319*1000);
}
else
{
this.m_Image.src=this.m_ImageUrl;
}
}
nhPanoramaViewerTile.prototype.x329=function(event)
{
this.x335.x173("Failed to load image: "+this.m_ImageUrl);
this.x378=this.x340;
this.x335.x62(this);
return true;
}
nhPanoramaViewerTile.prototype.x332=function(event)
{
this.x378=this.x374;
if(this.m_Image.width != this.m_Image.height)
{
this.x335.x173("Image "+this.m_ImageUrl+" should be square");
}
if(this.x314)
{
if(this.m_Image.width > this.x314)
{
this.m_Image.width=this.x314;
this.m_Image.height=this.x314;
}
}
this.x356=new Array(this.m_Image.width, this.m_Image.height);
this.x160();
this.x371.style.visibility="hidden";
this.m_Image.style.visibility="visible";
this.x125.style.width=this.x356[0]+"px";
this.x125.style.height=this.x356[1]+"px";
this.x335.x62(this);
return true;
}
nhPanoramaViewerTile.prototype.x367=function()
{
}
nhPanoramaViewerTile.prototype.x354=function(event)
{
try
{
x355(this.x370,false);
this.x370=null;
this.x335.x62(this);
}
catch (x101)
{
this.x335.x173(x101.toString());
}
}
nhPanoramaViewerTile.prototype.x160=function()
{
if((this.x378 == this.x374) || this.x210)
{
this.x369();
}
}
nhPanoramaViewerTile.prototype.x369=function()
{
var x322=this.x335.x298();
var x338=this.x335.x100();
var x342=this.x335.x193();
var x368=this.x335.x14();
var x7=this.x356[0];
var x346=this.x356[1];
var x343=1000.0*(this.x377+1);
var x347=this.x335.x252().style.webkitPerspective;
var x349=0.5*x343/Math.tan(0.5*this.x375*Math.PI/180);
var x359=new WebKitCSSMatrix();
x359=x359.translate(-(x7-x342)/2,-(x346-x368)/2,x347);
x359=x359.rotate(x338,0,0);
x359=x359.rotate(0,x322-this.x380,0);
x359=x359.rotate(-this.x360,0,0);
x359=x359.translate(0,0,-x349);
x359=x359.scale(x343/x7, x343/x346,1);
this.x125.style.webkitTransform=x359;
}
nhPanoramaViewerTile.prototype.x321=function()
{
return this.x378;
}
nhPanoramaViewerTile.prototype.x312=function()
{
return this.x210;
}
nhPanoramaViewerTile.prototype.x373=function()
{
return this.x380;
}
nhPanoramaViewerTile.prototype.x333=function()
{
return this.x360;
}
nhPanoramaViewerTile.prototype.x327=function(x82, x7, x129)
{
this.x210=true;
if(this.x378 != this.x325) this.x378=this.lsNotLoaded;
var x155=x129[2];
var x318=x129[3];
this.x371.src=x82;
this.x371.width=x7;
this.x371.height=x7;
this.x371.style.left=""+(0-x129[0])+"px";
this.x371.style.top=""+(0-x129[1])+"px";
this.x371.style.visibility="visible";
this.x125.style.width=x155+"px";
this.x125.style.height=x318+"px";
this.x356=new Array(x155,x318);
this.x160();
}