/*
	krpano Flash/HTML5 Embedding script
	krpano 1.0.8.15 (build 2012-08-10)

	Usage informations:
		http://krpano.com/docu/html/

	This script has the SWFObject v1.5 script embedded:
		SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
		SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
		http://www.opensource.org/licenses/mit-license.php
*/
if(typeof deconcept=="undefined")var deconcept={};if(typeof deconcept.util=="undefined")deconcept.util={};if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil={};
deconcept.SWFObject=function(a,b,c,e,f,g){this.params={};this.variables={};this.attributes=[];this.vchk=function(d){d=(""+d).toLowerCase();return d!="menu"};a&&this.setAttribute("swf",a);b&&this.setAttribute("id",b);c&&this.setAttribute("width",c);e&&this.setAttribute("height",e);f&&this.setAttribute("version",new deconcept.PlayerVersion(f.toString().split(".")));this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7)deconcept.SWFObject.doPrepUnload=
true;g&&this.addParam("bgcolor",g)};
deconcept.SWFObject.prototype={setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(a,b){this.params[a]=b},getParams:function(){return this.params},addVariable:function(a,b){this.variables[a]=b},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var a=[],b,c=this.getVariables();for(b in c)if(this.vchk(b))a[a.length]=b+"="+c[b];return a},getSWFHTML:function(){var a=
"";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){a='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';a+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var b=this.getParams();for(var c in b)if(this.vchk(c))a+=[c]+'="'+b[c]+'" ';b=this.getVariablePairs().join("&");if(b.length>0)a+='flashvars="'+b+'"';a+=
"/>"}else{a='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';a+='<param name="movie" value="'+this.getAttribute("swf")+'" />';b=this.getParams();for(c in b)if(this.vchk(c))a+='<param name="'+c+'" value="'+b[c]+'" />';b=this.getVariablePairs().join("&");if(b.length>0)a+='<param name="flashvars" value="'+b+'" />';a+="</object>"}return a},
write:function(a){if(this.installedVer.versionIsValid(this.getAttribute("version"))){(typeof a=="string"?document.getElementById(a):a).innerHTML=this.getSWFHTML();return true}return false}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){var a=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var b=navigator.plugins["Shockwave Flash"];if(b&&b.description)a=new deconcept.PlayerVersion(b.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}else{try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(c){}if(b!=null)a=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}return a};
deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major)return false;if(this.major>a.major)return true;if(this.minor<a.minor)return false;if(this.minor>a.minor)return true;if(this.rev<a.rev)return false;return true};
deconcept.util={getRequestParameter:function(a){var b=document.location.search||document.location.hash;if(a==null)return b;if(b){b=b.substring(1).split("&");for(var c=0;c<b.length;c++)if(b[c].substring(0,b[c].indexOf("="))==a)return b[c].substring(b[c].indexOf("=")+1)}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){for(var a=document.getElementsByTagName("OBJECT"),b=a.length-1;b>=0;b--){a[b].style.display="none";for(var c in a[b])if(typeof a[b][c]=="function")a[b][c]=function(){}}};
if(deconcept.SWFObject.doPrepUnload)if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}var getQueryParamValue=deconcept.util.getRequestParameter,SWFObject=deconcept.SWFObject;
function SWFkrpanoMouseWheel(a){SWFkrpanoMouseWheel.isMac=navigator.appVersion.toLowerCase().indexOf("mac")!=-1;var b=String(a.params.wmode).toLowerCase();this.wmodefix=b=="opaque"||b=="transparent"||!!window.chrome;this.so=a;this.init()}
SWFkrpanoMouseWheel.prototype={init:function(){if(!SWFkrpanoMouseWheel.instances){SWFkrpanoMouseWheel.instances=[];window.addEventListener&&window.addEventListener("DOMMouseScroll",SWFkrpanoMouseWheel_wheelEvent,false);if(window.opera)window.attachEvent("onmousewheel",SWFkrpanoMouseWheel_wheelEvent);else window.onmousewheel=document.onmousewheel=SWFkrpanoMouseWheel_wheelEvent;if(SWFkrpanoMouseWheel.isMac||this.wmodefix){document.onmouseup=SWFkrpanoMouseWheel_upEvent;var a=window.onload;window.onload=
typeof window.onload!="function"?SWFkrpanoMouseWheel_registerEvents_delayed:function(){a();SWFkrpanoMouseWheel_registerEvents_delayed()}}}SWFkrpanoMouseWheel.instances.push(this)},handleMacWheel:function(a){var b=document[this.so.getAttribute("id")];b&&b.externalMouseEvent&&b.externalMouseEvent(a)},hasWheelEvent:function(){var a=document[this.so.getAttribute("id")];if(a&&a.get)return a.get("has_mousewheel_event()")=="true";return false}};
function SWFkrpanoMouseWheel_registerEvents_delayed(){setTimeout(SWFkrpanoMouseWheel_registerEvents,1E3)}
function SWFkrpanoMouseWheel_registerEvents(){var a=0,b=SWFkrpanoMouseWheel.instances.length;for(a=0;a<b;a++){var d=SWFkrpanoMouseWheel.instances[a].so,c=d.getAttribute("id");if(c=document[c]){c.wmodefix=SWFkrpanoMouseWheel.instances[a].wmodefix;if(window.opera&&SWFkrpanoMouseWheel.isMac)if(b==1)SWFkrpanoMouseWheel.overobj=d.getAttribute("id");c.onclick=SWFkrpanoMouseWheel_overEvent;c.onmouseover=SWFkrpanoMouseWheel_overEvent;c.onmouseout=SWFkrpanoMouseWheel_outEvent;if(c.wmodefix)if(c.enable_mousewheel_js_bugfix){c.enable_mousewheel_js_bugfix();
c.jsmwfix_on=true}}}}function SWFkrpanoMouseWheel_overEvent(a){if(a=a&&a.target&&a.target.id?a.target.id:this.id){var b=document[a];SWFkrpanoMouseWheel.overobj=a;if(b.wmodefix)if(b.jsmwfix_on!=true)if(b.enable_mousewheel_js_bugfix){b.enable_mousewheel_js_bugfix();b.jsmwfix_on=true}}}function SWFkrpanoMouseWheel_outEvent(){SWFkrpanoMouseWheel.overobj=null}
function SWFkrpanoMouseWheel_upEvent(){var a=0,b=SWFkrpanoMouseWheel.instances.length;for(a=0;a<b;a++){var d=SWFkrpanoMouseWheel.instances[a].so.getAttribute("id");if((d=document[d])&&(SWFkrpanoMouseWheel.isMac||d.wmodefix))d.externalMouseEvent2&&d.externalMouseEvent2(0,"mouseUp")}}
function SWFkrpanoMouseWheel_wheelEvent(a){if(!a)a=window.event;var b=0;if(a.wheelDelta)b=a.wheelDelta/120;else if(a.detail)b=-a.detail;var d=false;if(b){var c=0,f=SWFkrpanoMouseWheel.instances.length;for(c=0;c<f;c++){var e=SWFkrpanoMouseWheel.instances[c].so.getAttribute("id"),g=document[e];if(SWFkrpanoMouseWheel.isMac||g.wmodefix)if(SWFkrpanoMouseWheel.overobj==e){SWFkrpanoMouseWheel.instances[c].handleMacWheel(b);document[e].focus();d=true;break}if(SWFkrpanoMouseWheel.instances[c].hasWheelEvent()){d=
true;break}}}if(SWFkrpanoMouseWheel.overobj)d=true;if(d){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();a.cancelBubble=true;a.cancel=true;a.returnValue=false}};
function createkrpanoJSviewer(c,b,a,e,d,i,l){function m(){var h=null;if(typeof krpanoJS==="undefined")h=l?"ERROR:<br/><br/>Adobe Flashplayer 10 or higher needed!<br/><br/><br/><br/>":"ERROR:<br/><br/>HTML5 Version not available!<br/><br/><br/><br/>";else if(krpanojs_init(f)==false)h="LICENSE ERROR";if(h)document.getElementById(f.htmltarget).innerHTML='<table width="100%" height="100%"><tr valign="middle"><td><center>'+h+"</center></td></tr></table>"}if(e===undefined)e="";var j=false;if(d===undefined||
d==true){if(!window.krpanoreg||!window.krpanokey){document.write('<script src="'+e+'krpanoiphone.license.js" type="text/javascript" charset="UTF-8"><\/script>');j=true}if(typeof krpanoJS==="undefined"){document.write('<script src="'+e+'krpanoiphone.js" type="text/javascript"><\/script>');j=true}}var f={};f.params={};f.params.id=c?c:"krpanoSWFObject";f.params.width=b?b:"100%";f.params.height=a?a:"100%";f.params.basepath=e;f.params.bgcolor=i;f.vars={};f.addVariable=function(h,n){f.vars[String(h).toLowerCase()]=
n};f.addParam=function(h,n){f.params[String(h).toLowerCase()]=n};f.passQueryParameters=function(){var h=document.location.search||document.location.hash;if(h){h=h.substring(1).split("&");for(var n=0;n<h.length;n++){var o=h[n],g=o.indexOf("=");if(g==-1)g=o.length;var k=o.substring(0,g);o=o.substring(g+1);f.addVariable(k,o)}}};f.embed=function(h){f.htmltarget=h;j?window.addEventListener("load",m,false):m(null)};return f}
function createkrpanoSWFviewer(c,b,a,e,d,i,l){if(typeof b==="undefined")b="krpanoSWFObject";if(typeof a==="undefined")a="100%";if(typeof e==="undefined")e="100%";if(typeof d==="undefined")d="#000000";var m=navigator.userAgent,j=m.toLowerCase(),f=false,h=0,n="",o=false;if(j.indexOf("ipad")>=0||j.indexOf("iphone")>=0||j.indexOf("ipod")>=0)f=true;else{h=deconcept.SWFObjectUtil.getPlayerVersion().major;if(h==0){f=createPanoViewer().isHTML5possible();o=true}}if(i===false)f=false;if(f){i="./";m=c.lastIndexOf("/");
if(m>=0)i=c.slice(0,m+1);c=true;if(l&&l.html5licenseload===false)c=false;return createkrpanoJSviewer(b,a,e,i,c,d,o)}if(h>=9){var g=new SWFObject(c,b,a,e,"9.0.28",d);g.addParam("allowFullScreen","true");g.addParam("allowScriptAccess","always");g.setAttribute("style","outline:none;");g.addVariable("browser.useragent",m);g.embed=function(k){g.write(k)&&new SWFkrpanoMouseWheel(g)};g.passQueryParameters=function(){var k=document.location.search||document.location.hash;if(k){k=k.substring(1).split("&");
for(var r=0;r<k.length;r++){var p=k[r],q=p.indexOf("=");if(q==-1)q=p.length;var s=p.substring(0,q);p=p.substring(q+1);g.addVariable(s,p)}}};return g}else n='Adobe Flashplayer 10 or higher needed<br/><br/><br/><a href="http://www.adobe.com/go/getflashplayer/" target="_blank" style="text-decoration:none;"><small>...click here to download...</small></a><br/><br/>';g={};g.addVariable=function(){};g.addParam=function(){};g.passQueryParameters=function(){};g.embed=function(k){document.getElementById(k).innerHTML=
'<table width="100%" height="100%"><tr valign="middle"><td><center>ERROR:<br/><br/>'+n+"<br/><br/></center></td></tr></table>"};return g}var createswf=createkrpanoSWFviewer;
function embedpano(c){c||(c={});var b=c.swf?c.swf:"krpano.swf",a=c.xml?c.xml:b.split(".swf").join(".xml"),e=c.id?c.id:"krpanoSWFObject",d=c.target?c.target:null,i=c.width?c.width:"100%",l=c.height?c.height:"100%",m=c.bgcolor?c.bgcolor:"#000000";if(d){b=createPanoViewer({swf:b,id:e,width:i,height:l,bgcolor:m});b.addVariable("xml",a);c.useHTML5&&b.useHTML5(c.useHTML5);c.html5&&b.useHTML5(c.html5);c.wmode&&b.addParam("wmode",c.wmode);c.passQueryParameters&&b.passQueryParameters();if(c.vars)for(var j in c.vars)typeof c.vars[j]!=
"function"&&b.addVariable(j,c.vars[j]);b.embed(d)}else alert("ERROR: embedpano() - target needed")}var embedPanoViewer=embedpano;
function createPanoViewer(c){c||(c={});var b={};b.pswfpath=c.swf?c.swf:"krpano.swf";b.pxml=c.xml?c.xml:b.pswfpath.split(".swf").join(".xml");b.pid=c.id?c.id:"krpanoSWFObject";b.ptarget=c.target?c.target:null;b.pwidth=c.width?c.width:"100%";b.pheight=c.height?c.height:"100%";b.bgcolor=c.bgcolor?c.bgcolor:"#000000";b.pvars=[];b.pparams=[];b.HTML5="auto";if(c.useHTML5)b.HTML5=c.useHTML5;if(c.html5)b.HTML5=c.html5;b.useHTML5=function(a){b.HTML5=a};b.isFlashpossible=function(){return deconcept.SWFObjectUtil.getPlayerVersion().major>=
9};b.isHTML5possible=function(){var a,e=navigator.userAgent,d=e.toLowerCase();if(d.indexOf("ipad")>=0||d.indexOf("iphone")>=0||d.indexOf("ipod")>=0)return true;if(d.indexOf("safari")>0){a=d.indexOf("version");if(a>0){a=parseInt(d.slice(a+8));if(a>=5)return true}a=d.indexOf("chrome");if(a>0){a=parseInt(d.slice(a+7));if(a>=20)return true}a=d.indexOf("android");if(a>0){a=parseInt(d.slice(a+8));if(a>=4)return true}}else{a=d.indexOf("firefox");if(a>0){a=parseInt(d.slice(a+8));if(a>=10)return true}a=e.indexOf("MSIE ");
if(a>0){a=parseInt(e.slice(a+5));if(a>=10)return true}}return false};b.setSWFPath=function(a){b.pswfpath=a;if(b.pxml=="krpano.swf")b.pxml=b.pswfpath.split(".swf").join(".xml")};b.setViewerID=function(a){b.pid=a};b.setSize=function(a,e){b.pwidth=a;b.pheight=e};b.isDevice=function(a){var e="all",d=navigator.userAgent.toLowerCase();if(d.indexOf("ipad")>=0)e+="|ipad";if(d.indexOf("iphone")>=0)e+="|iphone";if(d.indexOf("ipod")>=0)e+="|ipod";if(d.indexOf("android")>=0)e+="|android";a=String(a).toLowerCase().split("|");
if(a==null)return true;var i=a.length;for(d=0;d<i;d++)if(e.indexOf(a[d])>=0)return true;return false};b.addVariable=function(a,e){a=String(a).toLowerCase();if(a=="xml"||a=="pano")b.pxml=e;else b.pvars[a]=e};b.addParam=function(a,e){b.pparams[a]=e};b.passQueryParameters=function(){var a=document.location.search||document.location.hash;if(a){a=a.substring(1).split("&");for(var e=0;e<a.length;e++){var d=a[e],i=d.indexOf("=");if(i==-1)i=d.length;var l=d.substring(0,i);d=d.substring(i+1);if(l=="useHTML5"||
l.toLowerCase()=="html5")b.HTML5=d;else b.addVariable(l,d)}}};b.embed=function(a){if(a)b.ptarget=a;if(b.ptarget){a=null;a=String(b.HTML5).toLowerCase();if(a=="always"||a=="force"||(a=="whenpossible"||a=="prefer")&&b.isHTML5possible()){a="./";var e=b.pswfpath.lastIndexOf("/");if(e>=0)a=b.pswfpath.slice(0,e+1);e=true;if(c.html5licenseload===false)e=false;a=createkrpanoJSviewer(b.pid,b.pwidth,b.pheight,a,e,b.bgcolor)}else a=createkrpanoSWFviewer(b.pswfpath,b.pid,b.pwidth,b.pheight,b.bgcolor,a!="never"&&
a!="no"&&a!="false",c);for(var d in b.pparams)typeof b.pparams[d]!="function"&&a.addParam(d,b.pparams[d]);for(var i in b.pvars)typeof b.pvars[i]!="function"&&a.addVariable(i,b.pvars[i]);a.addVariable("xml",b.pxml);a.embed(b.ptarget)}else alert("ERROR: createPanoViewer.embed() - target needed")};c.wmode&&b.addParam("wmode",c.wmode);c.passQueryParameters&&b.passQueryParameters();return b};
