var m=!0,p=null,r=!1; function N(k,q,h,G,B){var n=this;n.x=k;n.y=q;n.e=h;n.H=G;n.n=B;n.q=function(k,h,q){n.x=k;n.y=h;n.e=q;n.H=void 0;n.n=void 0};n.toString=function(){return"("+n.x+","+n.y+","+n.e+") - ("+n.H+","+n.n+")"};n.k=function(k){var h=Math.sin(k),k=Math.cos(k),q=n.y,B=n.e;n.y=k*q-h*B;n.e=h*q+k*B};n.l=function(k){var h=Math.sin(k),k=Math.cos(k),q=n.x,B=n.e;n.x=k*q+h*B;n.e=-h*q+k*B};n.fa=function(k){var h=Math.sin(k),k=Math.cos(k),q=n.x,B=n.y;n.x=k*q-h*B;n.y=h*q+k*B};n.Ka=function(){return new N(n.x,n.y,n.e,n.H, n.n)};n.length=function(){return Math.sqrt(n.x*n.x+n.y*n.y+n.e*n.e)};n.va=function(k){return n.x*k.x+n.y*k.y+n.e*k.e};n.Na=function(k,h){var q;q=Math.cos(h*Math.PI/180);n.x=q*Math.sin(k*Math.PI/180);n.y=Math.sin(h*Math.PI/180);n.e=q*Math.cos(k*Math.PI/180)};n.ab=function(k,h,q){n.x=k.x*q+h.x*(1-q);n.y=k.y*q+h.y*(1-q);n.e=k.e*q+h.e*(1-q);n.H=k.H*q+h.H*(1-q);n.n=k.n*q+h.n*(1-q)}}glMatrixArrayType="undefined"!=typeof Float32Array?Float32Array:"undefined"!=typeof WebGLFloatArray?WebGLFloatArray:Array; function Aa(k){k[0]=1;k[1]=0;k[2]=0;k[3]=0;k[4]=0;k[5]=1;k[6]=0;k[7]=0;k[8]=0;k[9]=0;k[10]=1;k[11]=0;k[12]=0;k[13]=0;k[14]=0;k[15]=1} function Fb(k,q,h){var G,B=h[0],n=h[1],h=h[2],W=Math.sqrt(B*B+n*n+h*h);if(W){1!=W&&(W=1/W,B*=W,n*=W,h*=W);var ta=Math.sin(q),Ua=Math.cos(q),ja=1-Ua,q=k[0],W=k[1],rb=k[2],Va=k[3],Ba=k[4],Wa=k[5],ea=k[6],Xa=k[7],Ca=k[8],Ya=k[9],Za=k[10],$a=k[11],Ma=B*B*ja+Ua,ab=n*B*ja+h*ta,bb=h*B*ja-n*ta,Na=B*n*ja-h*ta,cb=n*n*ja+Ua,db=h*n*ja+B*ta,eb=B*h*ja+n*ta,B=n*h*ja-B*ta,n=h*h*ja+Ua;G?k!=G&&(G[12]=k[12],G[13]=k[13],G[14]=k[14],G[15]=k[15]):G=k;G[0]=q*Ma+Ba*ab+Ca*bb;G[1]=W*Ma+Wa*ab+Ya*bb;G[2]=rb*Ma+ea*ab+Za*bb;G[3]= Va*Ma+Xa*ab+$a*bb;G[4]=q*Na+Ba*cb+Ca*db;G[5]=W*Na+Wa*cb+Ya*db;G[6]=rb*Na+ea*cb+Za*db;G[7]=Va*Na+Xa*cb+$a*db;G[8]=q*eb+Ba*B+Ca*n;G[9]=W*eb+Wa*B+Ya*n;G[10]=rb*eb+ea*B+Za*n;G[11]=Va*eb+Xa*B+$a*n}}function Yb(k,q,h){var k=0.1*Math.tan(k*Math.PI/360),q=k*q,G=-q,B=-k;h||(h=new glMatrixArrayType(16));var n=q-G,W=k-B;h[0]=0.2/n;h[1]=0;h[2]=0;h[3]=0;h[4]=0;h[5]=0.2/W;h[6]=0;h[7]=0;h[8]=(q+G)/n;h[9]=(k+B)/W;h[10]=-100.1/99.9;h[11]=-1;h[12]=0;h[13]=0;h[14]=-20/99.9;h[15]=0} function Ic(){var k="perspective",q=["Webkit","Moz","O","ms","Ms"],h;h=r;for(h=0;ha.loop&&(a.obj.ib="none"));a.obj.volume=a.j*X;0==a.loop&&(a.obj.r=1E7);1<=a.loop&&(a.obj.r=a.loop-1);if((1==a.mode||2==a.mode||3==a.mode||5==a.mode)&&0<=a.loop)a.obj.autoplay=m;y.push(a);a.obj.style.position="absolute"; a.z&&(a.obj.width=a.z);a.B&&(a.obj.height=a.B);s.appendChild(a.obj);a.o&&(a.obj.onclick=a.o);a.Qa=m;a.obj.addEventListener("ended",function(){if(0b;)b+=360;for(;180l&&(l=A);c.n||(c.n=new N,c.n.Na(c.pan,c.tilt));if(3==c.mode){b=Math.abs(b);b=bl||0>o)c.obj.volume=la*f*X;else{var k=1-Math.abs(b/l);c.obj.volume=la*(f+(1-f)*o*k)*X}}4==c.mode&&c.gb==p&&(Math.abs(b)Math.abs(U-A)/A&&(wb=r),b.update());if(dc&&(0!=ma||0!=na)&&0>O)ma*=0.9,na*=0.9,0.1>ma*ma+na*na?na=ma=0:(Kc(ma,na),b.update());if(0!=Pa){var e=fb/8;switch(Pa){case 37:b.changePan(e*ea(),m);break;case 38:b.changeTilt(e*ea(),m);break;case 39:b.changePan(-e*ea(),m);break;case 40:b.changeTilt(-e*ea(),m);break;case 43:case 107:case 16:b.changeFovLog(-e,m);break;case 17:case 18:case 109:case 45:case 91:b.changeFovLog(e,m)}b.update()}if(!b.isLoaded&&b.hasConfig){var c=0,g=b.checkLoaded.length; if(Hb)g=50,ecx;)x+=360;if(hb){F=fc-x;if(360==ib-jb){for(;-180>F;)F+=360;for(;1805*e?e/c:0.2,F*=c,M*=c,L*=c;x+=F;u+=M;A+=L;ic=a.getTime();b.update()}else if(da)if(e=a.getTime()-kb,0=1E3*jc){if(1=sa.length&&(e=0),c=sa[e];kb=a.getTime();b.openNext("{"+c+"}")}}else M=Kb*(0-u)/100,L=Kb*(Lb-A)/100,F=0.95*F+0.05*-Qa*ea(),x+=F,u+=M,A+=L,b.update();else{if(gb&& 0>O&&a.getTime()-ic>1E3*kc&&(Jb&&b.isLoaded||!Jb))da=m,kb=a.getTime(),L=M=F=0;if(dc&&0==Pa&&0>O&&(0!=F||0!=M||0!=L))F*=0.9,M*=0.9,L*=0.9,x+=F,u+=M,b.changeFovLog(L),1.0E-4>F*F+M*M+L*L&&(L=M=F=0),b.update()}Nc&&(Mb?a.getTime()-lc>=1E3*Oc&&(Mb=r):(Ra+=lb,0>Ra&&(Ra=0,lb=-lb,Mb=m,lc=a.getTime()),1a.p?(a.p+=0.05,a.Aa.p&&(a.p=a.A)),b.update());3==P&&va!=fa&&(va>fa?(fa+=0.05,vafa&&(fa=va)),b.update())}rb();b.dirty&&(0oa&&(U=oa),Uoa&&(U=oa),Ue){a.preventDefault();if(Fa(b.m)&&(g=nc(b.mouse.x,b.mouse.y)))b.hotspot=g;if(b.m){e=b.m;for(d=r;e&&e!=b.control;)e.onclick&&!d&&(e.onclick(),d=m,f=r),e=e.parentNode}e=Math.abs(Uc-xb)+Math.abs(Vc-yb);if(700>c-b.da&&0<=e&&20>e){a.preventDefault();Fa(b.m)&&oc&&setTimeout(function(){b.toggleFullscreen()},1);if(b.m){e=b.m;for(d=r;e&&e!=b.control;)e.ondblclick&& !d&&(e.ondblclick(),d=m,f=r),e=e.parentNode}b.da=0}else b.da=c;Uc=xb;Vc=yb}if(b.m){a.preventDefault();e=b.m;for(d=r;e&&e!=b.control;){if(e.onmouseout)e.onmouseout();e.onmouseup&&!d&&(e.onmouseup(),d=m);e=e.parentNode}}b.m=p;O=-11;g&&f&&Xa(g);b.hotspot=b.emptyHotspot}}function Id(a){a||(a=window.event);var e=a.touches,c=zb();b.mouse.x=e[0].pageX-c.x;b.mouse.y=e[0].pageY-c.y;if(!ba){e[0]&&(xb=e[0].pageX,yb=e[0].pageY);if(0<=O){a.preventDefault();for(c=0;coa&&(U=oa),UO&&e[0]){pc=(new Date).getTime();Sc=e[0].pageX;Tc=e[0].pageY;xb=e[0].pageX;yb=e[0].pageY;b.m=e[0].target;if(Fa(a.target)){if((c=Zc(b.mouse.x, b.mouse.y))&&c.o)c.o();else{var c=e[0].pageX,g=e[0].pageY;qc=c;rc=g;Da=c;Ea=g;sb=c;tb=g;O=e[0].identifier}a.preventDefault();I()}if(b.m){c=b.m;for(flag=r;c&&c!=b.control;){if(c.onmouseover)c.onmouseover();c.onmousedown&&!flag&&(c.onmousedown(),flag=m);c=c.parentNode}flag&&a.preventDefault()}}1a-pc&&0<=e&&20>e&&((e=nc(b.mouse.x,b.mouse.y))&&Xa(e),e=Math.abs(cd-Da)+Math.abs(dd-Ea),700>a-b.da&&0<=e&&20>e?(oc&&setTimeout(function(){b.toggleFullscreen()}, 10),b.da=0):b.da=a,cd=Da,dd=Ea);I()}}function ed(a){var a=a?a:window.event,e=zb();Nb()?(b.mouse.x=a.screenX-Y,b.mouse.y=a.screenY-aa):(b.mouse.x=a.pageX-e.x,b.mouse.y=a.pageY-e.y);if(!ba&&(0<=O&&(a.preventDefault(),(a.which||0==a.which||1==a.which)&&Wc(a.pageX,a.pageY),I()),b.hotspot==b.emptyHotspot||"poly"==b.hotspot.type)){var c=b.emptyHotspot;0la;la++){switch(la){case 0:l.q(-o,-k,-1);break;case 1:l.q(o,-k,-1);break;case 2:l.q(o,k,-1);break;case 3:l.q(-o,k,-1)}l.k(-d.tilt*Math.PI/180);l.l(d.pan*Math.PI/180);l.l(-x*Math.PI/180);l.k(u*Math.PI/180);f.push(l.Ka())}f=Sb(f);if(0l.e){var n=-c/l.e;px=z/2+l.x*n;py=t/2+l.y*n}else py=px=0;l.Z=px;l.F=py}if(gd(f,a,e))return d}}}function Fa(a){return a==b.control||a&&a.ggType&&"container"==a.ggType?m:r}function I(){da&&(da=r,L=M=F=0);hb&&(hb=r,L=M=F=0);ic=(new Date).getTime()}function Wc(a,e){uc=a;vc=e;ub=uc-Da;vb=vc-Ea;Oa&&(Da=uc,Ea=vc,b.update())}function Kc(a,e){var c=b.getVFov();x+=a*c/t;u+=e*c/t;Ta()}function hd(a){wc=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,wc);var e=[-1,-1,1,1,-1,1,1,1,1,-1,1,1];for(i=0;12> i;i++)2>i%3&&(e[i]*=a);f.bufferData(f.ARRAY_BUFFER,new Float32Array(e),f.STATIC_DRAW);Tb=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,Tb);f.bufferData(f.ARRAY_BUFFER,new Float32Array([1,0,0,0,0,1,1,1]),f.STATIC_DRAW);Ub=f.createBuffer();f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,Ub);f.bufferData(f.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),f.STATIC_DRAW)}function id(){var a,e;if(ca)for(;0c;c++)e=f.createTexture(),e.ua=p,e.qa=p,e.Pa=r,f.bindTexture(f.TEXTURE_2D, e),f.texImage2D(f.TEXTURE_2D,0,f.RGB,1,1,0,f.RGB,f.UNSIGNED_BYTE,p),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),nb[c]&&(a=new Image,a.crossOrigin="anonymous",a.src=ka(nb[c]),e.ua=a,a.addEventListener&&a.addEventListener("load",xc(e),r),b.checkLoaded.push(a)),ca.push(e);for(c=0;6>c;c++)Vb[c]&&(a=new Image,a.crossOrigin="anonymous",a.src=ka(Vb[c]),a.addEventListener? a.addEventListener("load",xc(ca[c]),r):a.onload=xc(ca[c]),ca[c].qa=a,b.checkLoaded.push(a));for(c=0;ck;k++)f=Ha(f,"c",e),f=Ha(f,"s",l),f=Ha(f,"r",a),f=Ha(f,"l",d),f=Ha(f,"x",c),f=Ha(f,"y",b),f=Ha(f,"v",b),f=Ha(f,"h",c);return ka(f)}function Ha(a,e,c){var b=RegExp("%0*"+e,"i").exec(a.toString());if(b){var b=b.toString(),d=c.toString();for(b.charAt(b.length-1)!=e&&(d=(1+c).toString());d.length=a+2&&!D[a+1].Sa&&D[a+1].width>c;)a++;return a}function od(){for(var a=0;aa;a++){var e;e=b.f.i[a];if(e.C){var c;c=[];c.push(new N(-1,-1,-1,0,0));c.push(new N(1,-1,-1,1,0));c.push(new N(1,1,-1,1,1));c.push(new N(-1,1,-1,0,1));for(var g=0;ga?c[g].l(a*(-Math.PI/2)):c[g].k((4==a?-1:1)*(Math.PI/2)),c[g].l(-x* Math.PI/180),c[g].k(u*Math.PI/180);c=Sb(c);for(var d={la:1,ma:1,oa:0,pa:0},g=0;goa&&(A=oa);e=b.getVFov()/2;a=180*Math.atan(z/t*Math.tan(e*Math.PI/180))/Math.PI;2*e>Ia-Ja&&(e=(Ia-Ja)/2);b.setVFov(2*e);90>Ia?u+e>Ia&&(u=Ia-e):u>Ia&&(u=Ia);-90 ib-jb){var c=0;if(0!=u){var g,d=t/2;g=d*Math.tan(e*Math.PI/180);d/=Math.tan(Math.abs(u)*Math.PI/180);d-=g;0ib&&(x=ib-(a+c),da&&(Qa=-Qa,F=0));x-(a+c)u-e&&(u=-90+e)}}function nc(a,e){var c=-1;if(0<=P)for(var b=0;bc!=d.F>c&&e<(d.Z-l.Z)*(c-l.F)/(d.F-l.F)+l.Z&&(f=!f)}return f}function Ga(a,e){a=Number(a);return"rgba("+(a>>16&255)+","+(a>>8&255)+","+(a&255)+","+e+")"}function ld(a){!pa&&b.bb!=a&&(b.bb=a,Q.style[wa]=a+"px",Q.style[wa+"Origin"]=Y+z/2+"px "+(aa+t/2)+"px ",s.style[wa]=a+"px",s.style[wa+"Origin"]=Y+z/2+"px "+(aa+t/2)+"px ")}function Sb(a){a=Bb(a,td);a=Bb(a,ud);a=Bb(a,vd);a=Bb(a,wd);return a=Bb(a,xd)}function Bb(a,e){if(0==a.length)return a;var c,b,d,f,l,k,o,n=[];c=e.va(a[0])-0;for(f= 0;fd&&(d=0),1c||n.push(a[k]),n.push(l);c=b}return n}function zb(){var a={x:0,y:0},e=s;if(e.offsetParent){do a.x+=e.offsetLeft,a.y+=e.offsetTop;while(e=e.offsetParent)}return a}function xa(){cc=m}function yd(a){if(debug=document.getElementById("debug"))debug.innerHTML=a+"
";window.console&&window.console.log(a)}var Rb,P,fa,va,zc,Ac,Bc,Cc,Dc; function Hd(a){var e="",c,b,d="",f,l="",k=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");do c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)),c=c<<2|b>>4,b=(b&15)<<4|f>>2,d=(f&3)<<6|l,e+= String.fromCharCode(c),64!=f&&(e+=String.fromCharCode(b)),64!=l&&(e+=String.fromCharCode(d));while(ki;i++)a.i[i]={C:m};a.ya=function(b,c){for(var g= 0;6>g;g++){var d;if(d=a.i[g]){var f;f=[];f.push(new N(-1,-1,-1,0,0));f.push(new N(1,-1,-1,1,0));f.push(new N(1,1,-1,1,1));f.push(new N(-1,1,-1,0,1));for(var l=0;lg?f[l].l(g*(-Math.PI/2)):f[l].k((4==g?-1:1)*(Math.PI/2)),f[l].l(-b*Math.PI/180),f[l].k(c*Math.PI/180);f=Sb(f);d.C=0c||10>g)){s.style.width=c+"px";s.style.height=g+"px";s.style.left=Y+"px";s.style.top=aa+"px";if(za)try{ya&&(ya.width=c,ya.height=g,console.log("Change Canvas size: "+c+","+g)),f&&(f.Ia=c,f.Ha=g,f.viewport(0,0,c,g))}catch(d){alert(d)}ha&&(ha.style.width=a+"px",ha.style.height=e+"px",ha.width=a,ha.height=e);Q&&(Q.style.width=a+"px",Q.style.height=e+"px",Z.style.width=a+"px",Z.style.height=e+"px", Z.width=a,Z.height=e,Z.style.left=Y+"px",Z.style.top=aa+"px",b.divSkin&&b.divSkin!=Q&&(b.divSkin.style.width=a+"px",b.divSkin.style.height=e+"px"));b.hasConfig&&b.updatePanorama();b.divSkin&&b.divSkin.ggUpdateSize&&b.divSkin.ggUpdateSize(a,e)}};var cc=r;b.setMargins=function(a,b,c,g){Y=a;aa=b;$b=c;ac=g;xa()};b.changeViewMode=function(a){0==a&&(Oa=r);1==a&&(Oa=m);2==a&&(Oa=Oa?r:m)};b.changePolygonMode=function(a,e){P=1==e&&0z?A/2:180*Math.atan(4*t/(3*z)*Math.tan(A/2*Math.PI/180))/Math.PI}return 2*a};b.setVFov=function(a){var a=a/2,b;switch(Gc){case 0:A=2*a;break;case 1:a=180*Math.atan(z/t*Math.tan(a*Math.PI/180))/Math.PI;A=2*a;break;case 2:b=Math.sqrt(z*z+t*t);a=180*Math.atan(b/t*Math.tan(a*Math.PI/180))/ Math.PI;A=2*a;break;case 3:4*t/3>z||(a=180*Math.atan(3*z/(4*t)*Math.tan(a*Math.PI/180))/Math.PI),A=2*a}};b.update=function(a){b.dirty=m;a&&(b.ja=a)};b.updatePanorama=function(){var a=b.R(),e=Math.atan2(z/2+1,a),c=Math.atan2(t/2+1,a),a=Math.sin(e),g=Math.sin(c),e=Math.cos(e),c=Math.cos(c);td.q(0,0,-1);ud.q(e,0,-a);vd.q(-e,0,-a);wd.q(0,c,-g);xd.q(0,-c,-g);a=new N(0,0,-100);g=b.R();for(e=0;ea.e?(k=-g/a.e,d=a.x*k,k*=a.y,Math.abs(d)a.e?(k=-g/a.e,d=z/2+a.x*k,k=t/2+a.y*k):k=d=0,a.Z=d,a.F=k;c.ta=n}}if(Z&&(Dc!=P&&(Dc=P,Z.style.visibility=0=o;){level=D[h];a=1;h==D.length-1&&0==qa&&(a=J/(J-0.5));for(curCfNr=0;6>curCfNr;curCfNr++)if(g= b.f.i[curCfNr],e=g.sa,Aa(ia),Fb(ia,-u*Math.PI/180,[1,0,0]),Fb(ia,(180-x)*Math.PI/180,[0,1,0]),4>curCfNr?Fb(ia,-Math.PI/2*curCfNr,[0,1,0]):Fb(ia,Math.PI/2*(5==curCfNr?1:-1),[1,0,0]),g.C&&e&&0i;i++)l[i]=0==i%3?d*(l[i]/level.width+1):1== i%3?d*(l[i]/level.height+1):d;f.bufferData(f.ARRAY_BUFFER,new Float32Array(l),f.STATIC_DRAW)}f.vertexAttribPointer(E.Ga,3,f.FLOAT,r,0,0);f.bindBuffer(f.ARRAY_BUFFER,Tb);f.vertexAttribPointer(E.Ea,2,f.FLOAT,r,0,0);f.activeTexture(f.TEXTURE0);f.bindTexture(f.TEXTURE_2D,e.L);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.bindBuffer(f.ELEMENT_ARRAY_BUFFER,Ub);f.uniform1i(E.Ta,0);f.uniformMatrix4fv(E.Ra,r,ia);f.uniformMatrix4fv(E.ra,r,La);f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0)}e.ia=g.C}}h--}for(o=0;ov;v++)Aa(ia),Fb(ia,-u*Math.PI/180,[1,0,0]),Fb(ia,(180-x)*Math.PI/180,[0,1,0]),4>v?Fb(ia,-Math.PI/2*v,[0,1,0]):Fb(ia,Math.PI/2*(5==v?1:-1),[1,0,0]),f.bindBuffer(f.ARRAY_BUFFER,wc),f.vertexAttribPointer(E.Ga,3,f.FLOAT,r,0,0),f.bindBuffer(f.ARRAY_BUFFER,Tb),f.vertexAttribPointer(E.Ea,2,f.FLOAT,r,0,0),6<=ca.length&&ca[v].loaded&&(f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D, ca[v]),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,Ub),f.uniform1i(E.Ta,0),f.uniformMatrix4fv(E.Ra,r,ia),f.uniformMatrix4fv(E.ra,r,La),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0))}}else if(Ka)if(0curCfNr;curCfNr++)a=b.f.i[curCfNr],a.C&&(g=Math.max(g,a.sa.scale),l=l+curCfNr+",");g=md();for(e=D.length-1;e>=g;){level=D[e];c=1;e==D.length-1&&0==qa&&(c=J/(J-2));for(curCfNr=0;6>curCfNr;curCfNr++)if(a=b.f.i[curCfNr],d=a.sa,a.C&&d&&0=e);)l=l.nextSibling;s.insertBefore(d.b,l);d.d=d.b.Wa}else if(Ad=e);)l=l.nextSibling;s.insertBefore(d.b,l)}d.b&&(Bd++,d.a=new Image,d.a.style[R+"Origin"]="0% 0%", d.a.style.position="absolute",d.a.style.overflow="hidden",d.b.J=e,q&&(d.b.id="tile"+curCfNr+"_"+e+"___"+ty+"_"+tx),d.a.onload=Kd(d),d.a.onerror=rd(d),d.a.onabort=rd(d),d.a.setAttribute("src",jd(e)),level.t&&b.checkLoaded.push(d.a),0==S&&b.divSkin&&b.divSkin.ggReLoadedLevels&&b.divSkin.ggReLoadedLevels(),S++,b.dirty=m)}d.b&&(l="",pa?(l+="translate3d("+z/2+"px,"+t/2+"px,0px) ",l+=" perspective("+h+"px) ",l+="translate3d(0px,0px,"+h+"px) "):l+="translate3d("+z/2+"px,"+t/2+"px,"+h+"px) ",l+="rotateX("+ Number(u).toFixed(10)+"deg) rotateY("+Number(-x).toFixed(10)+"deg) ",l=4>curCfNr?l+("rotateY("+-90*curCfNr+"deg)"):l+("rotateX("+(4==curCfNr?-90:90)+"deg)"),k=1,Eb?(k=(2*e+1)*J/level.width*(Db/J),k=Ed?2/Math.tan(A*Math.PI/360)*k:2*k,l+=" scale("+k*c*c+")"):k=1/(c*c),l+=" translate3d("+(1/c*tx*J-qa-level.width/2)+"px,"+(1/c*ty*J-qa-level.width/2)+"px,"+-level.width*k/2+"px)",q&&(d.b.id="rtile_"+Gd+"_"+curCfNr+"_"+e+"___"+ty+"_"+tx),a.C&&(d.ia=m,d.b?d.b.style[R]=l:d.a&&(d.a.style[R]=l)))}}e--}for(h= 0;hq;q++)if(h=b.f.i[q])a="",pa?(a+="translate3d("+z/2+"px,"+t/2+"px,0px) ",a+="perspective("+o+"px) ",a+="translate3d(0px,0px,"+o+"px) "):a+="translate3d("+z/2+"px,"+t/2+"px,"+o+"px) ",a+="rotateX("+Number(u).toFixed(10)+"deg) rotateY("+ Number(-x).toFixed(10)+"deg) ",h.Oa&&(a+=h.Oa,h.C||(a="translate3d(-10px,-10px,0px) scale(0.001,0.001)"),h.style[R]=a)}else if(Hb){Ta();ha&&(h=ha.getContext("2d"));if(z!=s.offsetWidth||t!=s.offsetHeight)z=parseInt(s.offsetWidth),t=parseInt(s.offsetHeight);h&&(o=h.canvas.width/2,q=h.canvas.height/2,a=h.createRadialGradient(o,q,5,o,q,Math.max(o,q)),a.addColorStop(0,"#333"),a.addColorStop(1,"#fff"),h.rect(0,0,h.canvas.width,h.canvas.height),h.fillStyle=a,h.fill(),h.fillStyle="#f00",h.font="20px Helvetica", h.textAlign="center",h.fillText("Pan: "+x.toFixed(1),o,q-30),h.fillText("Tilt: "+u.toFixed(1),o,q),h.fillText("Fov: "+A.toFixed(1),o,q+30))}Zb()};var pa=r,Eb=r;b.setRenderFlags=function(a){a=Math.round(a);pa=a&1;Eb=a&2;4096<=a&&(Ka=a&4096,za=a&8192,Hb=a&32768)};var Gd=1,E;b.initWebGL=function(a){Hc=r;try{if(ya=a?a:document.createElement("canvas"),ya.width=100,ya.height=100,s.appendChild(ya),(f=ya.getContext("webgl"))||(f=ya.getContext("experimental-webgl")),f){f.Ia=500;f.Ha=500;f.clearColor(0,0,0, 0);if(qb&&6>16&255)/255,(b>>8&255)/255,(b>>0&255)/255,1)}f.enable(f.DEPTH_TEST);f.viewport(0,0,500,500);f.clear(f.COLOR_BUFFER_BIT|f.DEPTH_BUFFER_BIT);var c=f.createShader(f.FRAGMENT_SHADER);f.shaderSource(c,"#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nvoid main(void) {\n\tgl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n}\n"); f.compileShader(c);f.getShaderParameter(c,f.COMPILE_STATUS)||(alert(f.getShaderInfoLog(c)),c=p);var g=f.createShader(f.VERTEX_SHADER);f.shaderSource(g,"attribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\nvarying vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n");f.compileShader(g);f.getShaderParameter(g,f.COMPILE_STATUS)||(alert(f.getShaderInfoLog(g)), g=p);E=f.createProgram();f.attachShader(E,g);f.attachShader(E,c);f.linkProgram(E);f.getProgramParameter(E,f.LINK_STATUS)||alert("Could not initialise shaders");f.useProgram(E);E.Ga=f.getAttribLocation(E,"aVertexPosition");f.enableVertexAttribArray(E.Ga);E.Ea=f.getAttribLocation(E,"aTextureCoord");f.enableVertexAttribArray(E.Ea);E.ra=f.getUniformLocation(E,"uPMatrix");E.Ra=f.getUniformLocation(E,"uMVMatrix");E.Ta=f.getUniformLocation(E,"uSampler");hd(Cb);id()}}catch(d){}f?za=m:alert("Could not initialise WebGL!")}; var ca=[],ia=new glMatrixArrayType(16),La=new glMatrixArrayType(16),wc,Tb,Ub;b.getPan=function(){return x};b.getPanDest=function(){return fc};b.getPanN=function(){for(var a=x;-180>a;)a+=360;for(;180a;)a+=360;for(;180a){var e=A;A=Number(a);Ta();e!=A&&b.update()}};b.changeFov=function(a,e){b.setFov(b.getFov()+a);e&&(L=a)};b.changeFovLog=function(a,e){if(!isNaN(a)){var c;c=a/90*Math.cos(A*Math.PI/ 360);c=A*Math.exp(c);b.setFov(c);e&&(L=a)}};b.setPanTilt=function(a,e){I();isNaN(a)||(x=a);isNaN(e)||(u=e);b.update()};b.setPanTiltFov=function(a,e,c){I();isNaN(a)||(x=a);isNaN(e)||(u=e);!isNaN(c)&&0c&&(A=c);b.update()};b.setDefaultView=function(){b.setPanTiltFov(Ec,Fc,Lb)};b.setLocked=function(a){b.setLockedMouse(a);b.setLockedWheel(a);b.setLockedKeyboard(a)};b.setLockedMouse=function(a){ba=a};b.setLockedKeyboard=function(a){Ob=a};b.setLockedWheel=function(a){tc=a};b.moveTo=function(a,b, c,g){I();hb=m;var d=a.toString().split("/");1c?c:A;Lc=!isNaN(g)&&0>","U"!=a.charAt(2))? (ja(),r):m}};b.addHotspotElements=function(){for(var a=0;ac&&(c=0);if("_main"==a){X=c;for(c=0;cc&&(c=0);X=c;for(c=0;cc&&(c=0),g.j=c,g.obj.volume=c*X)}}; b.removeHotspots=function(){for(var a;0d&&(d=ob);for(g=0;6>g;g++){a?(c={},c.width=Db,c.height=Db):(c=document.createElement("canvas"),c.width=ob,c.height=ob,c.d=c.getContext("2d"));e="position:absolute;";e+="left: 0px;";e+="top: 0px;";e+="width: "+d+"px;";e+="height: "+d+"px;";a&&(e+="outline: 1px solid transparent;");e+=T+"transform-origin: 0% 0%;";e+="-webkit-user-select: none;";e+=T+"transform: ";var f;f="";var l=1;Eb&&(l=100);f=4>g? f+("rotateY("+-90*g+"deg)"):f+("rotateX("+(4==g?-90:90)+"deg)");Eb&&(f+=" scale("+l+")");f+=" translate3d("+-d/2+"px,"+-d/2+"px,"+-d*l/(2*Cb)+"px)";e+=f+";";c.Oa=f;a||(c.setAttribute("style",e),s.insertBefore(c,s.firstChild));b.f.i[g]=c}if(!a){for(g=0;6>g;g++)c=b.f.i[g],""!=nb[g]&&(c.D=new Image,c.D.onload=G(c),c.D.setAttribute("src",ka(nb[g])),b.checkLoaded.push(c.D));for(g=0;6>g;g++)c=b.f.i[g],c.loaded=r,c.a=new Image,c.a.onload=G(c),c.a.setAttribute("src",ka(Vb[g])),b.checkLoaded.push(c.a)}};b.setOverlayOpacity= function(a){var e;if(Ka)for(e=0;6>e;e++)b.f.ka[e]&&b.f.ka[e].style&&(b.f.ka[e].style.opacity=a)};b.removePanorama=function(){var a;if(Ka){for(a=0;aa.h?a.w:a.h};b.readConfigString=function(a,e){window.DOMParser?(parser=new DOMParser,xmlDoc=parser.parseFromString(a,"text/xml")):(xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),xmlDoc.async="false",xmlDoc.loadXML(a));b.readConfigXml(xmlDoc, e)};b.readConfigUrl=function(a,e,c){try{var f;f=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");f.open("GET",a,r);f.send(p);if(f.responseXML){var d=a.lastIndexOf("/");0<=d&&(Ab=a.substr(0,d+1));2<=arguments.length&&e!=p&&(Ab=e);b.readConfigString(f.responseText,c)}else alert("Error loading panorama XML")}catch(k){alert("Error:"+k)}};var Xb=m;b.getCurrentNode=function(){return Gb};b.readConfigXml=function(a,e){var c=a.firstChild;pb=[];sa=[];if("tour"==c.nodeName){var f= "",d;(d=c.getAttributeNode("start"))&&(f=d.nodeValue.toString());""!=b.startNode&&(f=b.startNode,b.startNode="");for(c=c.firstChild;c;){d="";if("panorama"==c.nodeName&&(d=c.getAttributeNode("id")))d=d.nodeValue.toString(),""==f&&(f=d),pb[d]=c,sa.push(d);c=c.nextSibling}b.Ba(pb[f],e);h("{"+f+"}");b.Aa=m}else b.Aa=r,b.Ba(c,e),h(""),sa.push("")};b.Ba=function(a,e){b.removeHotspots();b.hotspot=b.emptyHotspot;b.removePanorama();b.ea=0;for(var c=a.firstChild,g,d,k,l=0;c;){if("view"==c.nodeName){(d=c.getAttributeNode("fovmode"))&& (Gc=Number(d.nodeValue));d=c.getAttributeNode("pannorth");zd=1*(d?d.nodeValue:0);for(g=c.firstChild;g;)"start"==g.nodeName&&(d=g.getAttributeNode("pan"),Ec=x=Number(d?d.nodeValue:0),d=g.getAttributeNode("tilt"),Fc=u=Number(d?d.nodeValue:0),d=g.getAttributeNode("fov"),Lb=A=Number(d?d.nodeValue:70)),"min"==g.nodeName&&(d=g.getAttributeNode("pan"),jb=1*(d?d.nodeValue:0),d=g.getAttributeNode("tilt"),Ja=1*(d?d.nodeValue:-90),d=g.getAttributeNode("fov"),ga=1*(d?d.nodeValue:5),1.0E-20>ga&&(ga=1.0E-20),d= g.getAttributeNode("fovpixel"),yc=1*(d?d.nodeValue:0)),"max"==g.nodeName&&(d=g.getAttributeNode("pan"),ib=1*(d?d.nodeValue:0),d=g.getAttributeNode("tilt"),Ia=1*(d?d.nodeValue:90),d=g.getAttributeNode("fov"),oa=1*(d?d.nodeValue:120),180<=oa&&(oa=179.9)),g=g.nextSibling}if("autorotate"==c.nodeName&&((d=c.getAttributeNode("speed"))&&(Qa=1*d.nodeValue),(d=c.getAttributeNode("delay"))&&(kc=1*d.nodeValue),(d=c.getAttributeNode("returntohorizon"))&&(Kb=1*d.nodeValue),(d=c.getAttributeNode("nodedelay"))&& (jc=1*d.nodeValue),(d=c.getAttributeNode("noderandom"))&&(Mc=1==d.nodeValue),Xb&&(da=gb=m,kb=(new Date).getTime()),d=c.getAttributeNode("startloaded")))(Jb=1==d.nodeValue)&&(da=r);"input"==c.nodeName&&(k||(k=c));if(k)for(g=0;6>g;g++)d=k.getAttributeNode("prev"+g+"url"),nb[g]=d?new String(d.nodeValue):"";"altinput"==c.nodeName&&(g=0,(d=c.getAttributeNode("screensize"))&&(g=1*d.nodeValue),0l&&(l=g,k=c));if("control"==c.nodeName&&Xb){(d=c.getAttributeNode("simulatemass"))&& (dc=1==d.nodeValue);(d=c.getAttributeNode("locked"))&&(ba=1==d.nodeValue);d&&(Ob=1==d.nodeValue);(d=c.getAttributeNode("lockedmouse"))&&(ba=1==d.nodeValue);(d=c.getAttributeNode("lockedkeyboard"))&&(Ob=1==d.nodeValue);(d=c.getAttributeNode("lockedwheel"))&&(tc=1==d.nodeValue);(d=c.getAttributeNode("invertwheel"))&&($c=1==d.nodeValue);(d=c.getAttributeNode("speedwheel"))&&(ad=1*d.nodeValue);(d=c.getAttributeNode("invertcontrol"))&&(Oa=1==d.nodeValue);if(d=c.getAttributeNode("sensitivity"))fb=1*d.nodeValue, 1>fb&&(fb=1);(d=c.getAttributeNode("dblclickfullscreen"))&&(oc=1==d.nodeValue)}"overlay"==c.nodeName&&((d=c.getAttributeNode("blendspeed"))&&(lb=1*d.nodeValue),(d=c.getAttributeNode("auto"))&&(Nc=1==d.nodeValue),(d=c.getAttributeNode("delay"))&&(Oc=1*d.nodeValue));"userdata"==c.nodeName&&(b.userdata=q(c));if("hotspots"==c.nodeName)for(g=c.firstChild;g;){if("label"==g.nodeName){var h=Rb;if(d=g.getAttributeNode("enabled"))h.enabled=1==d.nodeValue;if(d=g.getAttributeNode("width"))h.width=1*d.nodeValue; if(d=g.getAttributeNode("height"))h.height=1*d.nodeValue;if(d=g.getAttributeNode("textcolor"))h.Da=1*d.nodeValue;if(d=g.getAttributeNode("textalpha"))h.Ca=1*d.nodeValue;if(d=g.getAttributeNode("background"))h.background=1==d.nodeValue;if(d=g.getAttributeNode("backgroundalpha"))h.N=1*d.nodeValue;if(d=g.getAttributeNode("backgroundcolor"))h.O=1*d.nodeValue;if(d=g.getAttributeNode("border"))h.xa=1*d.nodeValue;if(d=g.getAttributeNode("bordercolor"))h.Q=1*d.nodeValue;if(d=g.getAttributeNode("borderalpha"))h.P= 1*d.nodeValue;if(d=g.getAttributeNode("borderradius"))h.wa=1*d.nodeValue;if(d=g.getAttributeNode("wordwrap"))h.wordwrap=1==d.nodeValue}"polystyle"==g.nodeName&&((d=g.getAttributeNode("mode"))&&(P=1*d.nodeValue),(d=g.getAttributeNode("bordercolor"))&&(zc=1*d.nodeValue),(d=g.getAttributeNode("backgroundcolor"))&&(Bc=1*d.nodeValue),(d=g.getAttributeNode("borderalpha"))&&(Ac=1*d.nodeValue),(d=g.getAttributeNode("backgroundalpha"))&&(Cc=1*d.nodeValue));"hotspot"==g.nodeName&&(h={type:"point",pan:0,tilt:0, url:"",target:"",id:"",skinid:"",w:100,h:20,wordwrap:r,obj:p,ha:p},d=g.getAttributeNode("pan"),h.pan=1*(d?d.nodeValue:0),d=g.getAttributeNode("tilt"),h.tilt=1*(d?d.nodeValue:0),(d=g.getAttributeNode("url"))&&(h.url=d.nodeValue.toString()),(d=g.getAttributeNode("target"))&&(h.target=d.nodeValue.toString()),(d=g.getAttributeNode("title"))&&(h.title=d.nodeValue.toString()),(d=g.getAttributeNode("id"))&&(h.id=d.nodeValue.toString()),(d=g.getAttributeNode("skinid"))&&(h.skinid=d.nodeValue.toString()), (d=c.getAttributeNode("width"))&&(h.w=d.nodeValue.toString()),(d=c.getAttributeNode("height"))&&(h.h=d.nodeValue.toString()),(d=c.getAttributeNode("wordwrap"))&&(h.wordwrap=1==d.nodeValue),H.push(h));if("polyhotspot"==g.nodeName){h={type:"poly",url:"",target:"",id:"",skinid:"",w:100,h:20,wordwrap:r,obj:p,ha:p,p:0,A:0};(d=g.getAttributeNode("url"))&&(h.url=d.nodeValue.toString());(d=g.getAttributeNode("target"))&&(h.target=d.nodeValue.toString());(d=g.getAttributeNode("title"))&&(h.title=d.nodeValue.toString()); (d=g.getAttributeNode("id"))&&(h.id=d.nodeValue.toString());h.Q=zc;h.O=Bc;h.P=Ac;h.N=Cc;if(d=g.getAttributeNode("bordercolor"))h.Q=1*d.nodeValue;if(d=g.getAttributeNode("backgroundcolor"))h.O=1*d.nodeValue;if(d=g.getAttributeNode("borderalpha"))h.P=1*d.nodeValue;if(d=g.getAttributeNode("backgroundalpha"))h.N=1*d.nodeValue;h.ha=[];for(var o=g.firstChild;o;){if("vertex"==o.nodeName){var t={pan:0,tilt:0};d=o.getAttributeNode("pan");t.pan=1*(d?d.nodeValue:0);d=o.getAttributeNode("tilt");t.tilt=1*(d?d.nodeValue: 0);h.ha.push(t)}o=o.nextSibling}H.push(h)}g=g.nextSibling}if("sounds"==c.nodeName||"media"==c.nodeName)for(g=c.firstChild;g;){if("sound"==g.nodeName){o={id:"",url:"",loop:0,j:1,aa:0,mode:1,field:10,pan:0,tilt:0,s:0,M:0,url:[]};if(d=g.getAttributeNode("id"))o.id=d.nodeValue.toString();(d=g.getAttributeNode("url"))&&o.url.push(d.nodeValue.toString());if(d=g.getAttributeNode("level"))o.j=Number(d.nodeValue);if(d=g.getAttributeNode("loop"))o.loop=Number(d.nodeValue);if(d=g.getAttributeNode("mode"))o.mode= Number(d.nodeValue);if(d=g.getAttributeNode("field"))o.field=Number(d.nodeValue);if(d=g.getAttributeNode("ambientlevel"))o.aa=Number(d.nodeValue);if(d=g.getAttributeNode("pan"))o.pan=Number(d.nodeValue);if(d=g.getAttributeNode("tilt"))o.tilt=Number(d.nodeValue);if(d=g.getAttributeNode("pansize"))o.s=Number(d.nodeValue);if(d=g.getAttributeNode("tiltsize"))o.M=Number(d.nodeValue);for(h=g.firstChild;h;)"source"==h.nodeName&&(d=h.getAttributeNode("url"))&&o.url.push(d.nodeValue.toString()),h=h.nextSibling; Ua(o)}if("video"==g.nodeName){o={id:"",url:"",poster:"",loop:0,j:1,aa:0,mode:1,field:10,pan:0,tilt:0,s:0,M:0,k:0,l:0,fa:0,I:50,u:0,url:[]};if(d=g.getAttributeNode("id"))o.id=d.nodeValue.toString();(d=g.getAttributeNode("url"))&&o.url.push(d.nodeValue.toString());if(d=g.getAttributeNode("poster"))o.poster=""+d.nodeValue;if(d=g.getAttributeNode("level"))o.j=Number(d.nodeValue);if(d=g.getAttributeNode("loop"))o.loop=Number(d.nodeValue);if(d=g.getAttributeNode("mode"))o.mode=Number(d.nodeValue);if(d= g.getAttributeNode("field"))o.field=Number(d.nodeValue);if(d=g.getAttributeNode("ambientlevel"))o.aa=Number(d.nodeValue);if(d=g.getAttributeNode("pan"))o.pan=Number(d.nodeValue);if(d=g.getAttributeNode("tilt"))o.tilt=Number(d.nodeValue);if(d=g.getAttributeNode("pansize"))o.s=Number(d.nodeValue);if(d=g.getAttributeNode("tiltsize"))o.M=Number(d.nodeValue);if(d=g.getAttributeNode("rotx"))o.k=Number(d.nodeValue);if(d=g.getAttributeNode("roty"))o.l=Number(d.nodeValue);if(d=g.getAttributeNode("rotz"))o.fa= Number(d.nodeValue);if(d=g.getAttributeNode("fov"))o.I=Number(d.nodeValue);if(d=g.getAttributeNode("width"))o.z=Number(d.nodeValue);if(d=g.getAttributeNode("height"))o.B=Number(d.nodeValue);d=g.getAttributeNode("stretch");o.K=d?Number(d.nodeValue):1;if(d=g.getAttributeNode("clickmode"))o.u=Number(d.nodeValue);for(h=g.firstChild;h;)"source"==h.nodeName&&(d=h.getAttributeNode("url"))&&o.url.push(d.nodeValue.toString()),h=h.nextSibling;W(o)}if("image"==g.nodeName){o={id:"",url:"",loop:0,j:1,aa:0,mode:1, field:10,pan:0,tilt:0,s:0,M:0,k:0,l:0,fa:0,I:50,u:0};if(d=g.getAttributeNode("id"))o.id=d.nodeValue.toString();if(d=g.getAttributeNode("url"))o.url=d.nodeValue.toString();if(d=g.getAttributeNode("pan"))o.pan=Number(d.nodeValue);if(d=g.getAttributeNode("tilt"))o.tilt=Number(d.nodeValue);if(d=g.getAttributeNode("rotx"))o.k=Number(d.nodeValue);if(d=g.getAttributeNode("roty"))o.l=Number(d.nodeValue);if(d=g.getAttributeNode("rotz"))o.fa=Number(d.nodeValue);if(d=g.getAttributeNode("fov"))o.I=Number(d.nodeValue); if(d=g.getAttributeNode("width"))o.z=Number(d.nodeValue);if(d=g.getAttributeNode("height"))o.B=Number(d.nodeValue);d=g.getAttributeNode("stretch");o.K=d?Number(d.nodeValue):1;if(d=g.getAttributeNode("clickmode"))o.u=Number(d.nodeValue);for(h=g.firstChild;h;){if("source"==h.nodeName&&(d=h.getAttributeNode("url")))o.url=d.nodeValue.toString();h=h.nextSibling}n(o)}g=g.nextSibling}c=c.nextSibling}e&&""!=e&&(d=e.toString().split("/"),0g;g++)(d=k.getAttributeNode("tile"+g+"url"))&&(Vb[g]=new String(d.nodeValue));for(g=0;6>g;g++)(d=k.getAttributeNode("prev"+g+"url"))&&(nb[g]=new String(d.nodeValue));(d=k.getAttributeNode("tilesize"))&&(ob=1*d.nodeValue);(d=k.getAttributeNode("canvassize"))&&(Db=Number(d.nodeValue));(d=k.getAttributeNode("tilescale"))&&(Cb=1*d.nodeValue);if(d=k.getAttributeNode("leveltileurl"))kd=d.nodeValue;(d=k.getAttributeNode("leveltilesize"))&&(J=Number(d.nodeValue)); (d=k.getAttributeNode("levelbias"))&&(nd=Number(d.nodeValue));(d=k.getAttributeNode("overlap"))&&(qa=Number(d.nodeValue));D=[];for(g=k.firstChild;g;){if("preview"==g.nodeName&&(d=g.getAttributeNode("color")))qb=d.nodeValue;"level"==g.nodeName&&(k={},d=g.getAttributeNode("width"),k.width=1*(d?d.nodeValue:1),k.height=1*(d?d.nodeValue:1),d=g.getAttributeNode("preload"),k.t=r,d&&(k.t=1==d.nodeValue),d=g.getAttributeNode("preview"),k.Sa=r,d&&(k.Sa=1==d.nodeValue),k.G=Math.floor((k.width+J-1)/J),k.$=Math.floor((k.height+ J-1)/J),k.g={},D.push(k));g=g.nextSibling}}Hb&&(za=Ka=r,ha=document.createElement("canvas"),ha.width=100,ha.height=100,ha.id="dummycanvas",s.appendChild(ha),xa());za&&f&&(hd(Cb),id());Ka&&(0