/* krpano 1.16.9 combobox plugin (build 2013-10-28) */
var krpanoplugin=function(){function A(a,b,g,c,e){var d=null;e=(!0===e?"remove":"add")+"EventListener";var h=k.browser.events;if(h.touch&&("down"==b?d=h.touchstart:"move"==b?d=h.touchmove:"up"==b&&(d=h.touchend),d))a[e](d,g,c);if(h.mouse&&("down"==b?d="mousedown":"move"==b?d="mousemove":"up"==b&&(d="mouseup"),d))a[e](d,g,c)}function ua(a){for(;0<F.length&&!(100>=a-F[0].time);)F.shift()}function Oa(a){A(window,"up",va,!0);A(window,"move",wa,!0);F=[];var b=a.changedTouches&&0<a.changedTouches.length?
a.changedTouches[0].pageY:a.pageY;O=!1;ba=b;ga=q;a.preventDefault();a.stopPropagation();setTimeout(function(){if(!1==O&&a.target){var b=a.target._krpcbitemindex;if(void 0!==b&&(xa(),0<=b&&b<z.count&&(b=z.getItem(b))&&b._htmlid)){var c=document.getElementById(b._htmlid);c&&(P=b,Q=c,c.style.color=ya,c.style.backgroundImage=k.safari||k.chrome||k.androidstock?"-webkit-gradient(linear, 0% 5%, 0% 80%, from(rgba("+W+",1.0)), to(rgba("+X+",1.0)))":k.ie?"-ms-linear-gradient(top, rgba("+W+",1.0), rgba("+X+
",1.0))":k.firefox?"-moz-linear-gradient(top, rgba("+W+",1.0), rgba("+X+",1.0))":"linear-gradient(to bottom, rgba("+W+",1.0), rgba("+X+",1.0))")}}},100);return!1}function xa(){Q&&(Q.style.color=ha,Q.style.backgroundImage="");Q=P=null}function wa(a){var b=a.changedTouches&&0<a.changedTouches.length?a.changedTouches[0].pageY:a.pageY;!1==O&&5<Math.abs(b-ba)&&(null!=R&&(clearInterval(R),R=null),O=!0,xa(),ba=b,ga=q);if(O){var c=a.timeStamp;ua(c);F.push({time:c,y:b});q=ga+(b-ba);b=-(ia-(n-S));q-=(0<q?q:
q<b?q-b:0)/2;k.android&&k.firefox?t.style.top=q-2+"px":t.style[L]="translate3d(0px, "+(q-2)+"px, 0px)"}a.preventDefault();a.stopPropagation();return!1}function va(a){A(window,"up",va,!0,!0);A(window,"move",wa,!0,!0);if(O){ua(a.timeStamp);if(1<F.length){a=F[0];var b=F[F.length-1];B=(b.y-a.y)/((b.time-a.time)/15)}else B=0;R=setInterval(Pa,1E3/60)}else setTimeout(function(){if(P){T=P.index;var a=P.onclick;ca();C();void 0!==a&&setTimeout(function(){j.call(a,c)},100)}},200)}function Pa(){q+=B;B*=0.95;
var a=0,b=-(ia-(n-S));q<b?a=q-b:0<q&&(a=q);0!=a&&(a*=-1,B=0>=a*B?B+0.08*a:0.15*a);0==a&&0.05>Math.abs(B)&&(B=0,clearInterval(R),R=null);k.android&&k.firefox?t.style.top=q-2+"px":t.style[L]="translate3d(0px, "+(q-2)+"px, 0px)"}function Qa(){za()}function za(){if(1==U)C();else{void 0!=j._opencombobox_singleton_cb&&j._opencombobox_singleton_cb();j._opencombobox_singleton_cb=C;var a,b;U=1;Y();Q=P=null;var g=j.stagescale;b=Z(0,0);var f=Z(c.pixelwidth*g,c.pixelheight*g);da=j.area.pixelheight*g-f.y>b.y?
0:1;r=document.createElement("div");r.style.position="absolute";r.style.zIndex=1E3;k.ie&&(r.style.zIndex=999999999);!0!=k.androidstock&&(r.style[L]="translateZ(+1000000000000px)");j.control.layer.appendChild(r);G=document.createElement("div");G.style.position="absolute";G.style.left="0px";G.style.top="0px";G.style.overflow="hidden";G.onselectstart=function(){return!1};ja=Array(15);for(a=0;15>a;a++){var e=document.createElement("div");e.style.position="absolute";e.style.overflow="hidden";ja[a]=e;r.appendChild(e)}r.appendChild(G);
r.style.opacity=0;a=j.device.mobile?0.5:1;D=Aa(ka)*a+1*(la[1]-la[0]-ea);100>D&&(D=100);M=(b.x+f.x)/2-D/2;0>M&&(M=0);M+D>j.area.pixelwidth*g&&(D=j.area.pixelwidth*g-M);t=document.createElement("div");t.style.position="absolute";t.style.left="0px";t.style.top="0px";t.style.width=(D-1*ea-2*N|0)+"px";k.android&&k.firefox?t.style.top=q-2+"px":(t.style[L+"Style"]="preserve-3d",t.style[L]="translate3d(0px, "+(q-2)+"px, 0px)");var d,h=(99999*Math.random()).toFixed(0),l="font-family:"+ma+";font-size:"+V*ka+
"px;color:"+ha+";padding:"+N+"px;";0<=fa.indexOf("bold")&&(l+="font-weight:bold;");0<=fa.indexOf("italic")&&(l+="font-style:italic;");d="";b=z.count;for(a=0;a<b;a++)if((e=z.getItem(a))&&e.caption){var m=e.caption,u="_krpcbx_"+h+"_"+c.name+"_item"+a,p=T==a?"color:"+Ba+";text-shadow:0px 0px 1px "+Ca+";":"";e._htmlid=u;d+="<div id='"+u+"' style='width:100%;border-bottom:1px solid "+na+";"+(0==a?"border-top:1px solid "+na+";":"")+l+p+"'>"+m+"</div>"}t.innerHTML=d+"";t.style.visibility="hidden";r.appendChild(t);
n=oa+t.offsetHeight+pa;n<S&&(n=oa+50*z.count+pa,n<S&&(n=S));120>n&&(n=120);ia=n-S;r.removeChild(t);t.style.visibility="visible";0==da?(I=f.y-4,I+n-10>j.area.pixelheight*g&&(n=j.area.pixelheight*g-I+10)):(I=f.y-24*v*g-n,-15>I&&(n+=I+15,I=-15));G.style.width=D+"px";G.style.height=n+"px";r.style.left=M+"px";r.style.top=I+"px";y=document.createElement("div");y.style.position="absolute";y.style.left=0.5*ea+"px";y.style.top=0.5*Da+"px";y.style.width=(D-1*ea-1|0)+"px";y.style.height=(n-1*Da|0)+"px";y.style.overflow=
"hidden";y.style.color="#000";y.style[L+"Style"]="preserve-3d";A(y,"down",Oa,!0);k.topAccess&&A(top,"down",C,!1);r.appendChild(y);y.appendChild(t);b=z.count;for(a=0;a<b;a++)if((e=z.getItem(a))&&e.caption)if(g=document.getElementById(e._htmlid))g._krpcbitemindex=a,0<g.childNodes.length&&(g.childNodes[0].id=e._htmlid+"_text",g.childNodes[0]._krpcbitemindex=a);h=j.stagescale;a=la;g=Ra;f=[];b=[];for(e=0;6>e;e++)f[e]=a[e+1]-a[e];for(d=0;3>d;d++)b[d]=g[d+1]-g[d];d=D|0;e=n|0;h=Z(0.5*c.pixelwidth*h,0).x-
M;m=l=0;l=((d-0.5*(f[0]+f[2]+f[4]))/2|0)-(d-0.5*(f[0]+f[4]))/2+Math.floor(h-0.25*f[2]);0>l&&(l=0);m=d-l-0.5*(f[0]+f[2]+f[4])|0;0>m&&(m=0,l=d-m-0.5*(f[0]+f[2]+f[4])|0,0>l&&(l=0));h=[0.5*f[0]|0,l,0.5*f[2]|0,m,0.5*f[4]|0];l=[0.5*b[0]|0,e-(0.5*(b[0]+b[2])|0),0.5*b[2]|0];m=[0,h[0],h[0]+h[1],h[0]+h[1]+h[2],h[0]+h[1]+h[2]+h[3]];u=[0,l[0],l[0]+l[1]];p=null;for(d=0;3>d;d++)for(e=0;5>e;e++){var p=ja[5*d+e],s=e,Ea=d;if((0==d||2==d)&&2==e)if(0==d&&1==da||2==d&&0==da)s=e-1;var x=h[e]/f[s],w=l[d]/b[Ea];p.style.backgroundImage=
'url("'+J.src+'")';p.style[Fa]=J.naturalWidth*x+"px "+J.naturalHeight*w+"px";p.style.backgroundPosition=-a[s]*x+"px "+-g[Ea]*w+"px";p.style.left=m[e]+"px";p.style.top=u[d]+"px";p.style.width=h[e]+"px";p.style.height=l[d]+"px"}Ga(r,1,0.1);A(j.control.layer,"down",C,!1)}}function C(){1==U&&(U=0,null==j||null==c||(Y(),k.topAccess&&A(top,"down",C,!1,!0),A(j.control.layer,"down",C,!1,!0),Ga(r,0,0.1,function(){j.control.layer.removeChild(r)})))}function Ga(a,b,c,f){c*=1E3;var e=0,d=a.style.opacity,h=!1,
j=setInterval(function(){e+=1E3/60;e>c&&(e=c,h=!0);var m=e/c;0>m?m=0:1<m&&(m=1);a.style.opacity=Math.round(256*(d*(1-m)+b*m))/256;h&&(clearInterval(j),void 0!==f&&f())},1E3/60)}function Z(a,b){var g;if("undefined"!=typeof WebKitPoint)g=new WebKitPoint,g.x=a,g.y=b,g=window.webkitConvertPointFromNodeToPage(c.sprite,g),g=window.webkitConvertPointFromPageToNode(j.control.layer,g);else{g={};var f=c.sprite,e=f.getBoundingClientRect(),d=j.control.layer,h=d.getBoundingClientRect();g.x=Math.round(a+e.left+
f.clientLeft+f.scrollLeft-h.left-d.clientLeft+d.scrollLeft);g.y=Math.round(b+e.top+f.clientTop+f.scrollTop-h.top-d.clientTop+d.scrollTop)}return{x:g.x,y:g.y}}function Y(){s?Ha():ca()}function $(a){return"rgb("+(a>>16&255)+","+(a>>8&255)+","+(a&255)+")"}function Aa(a){var b=qa,c=0,f=z.count,e;if(0==f)return 0;for(e=0;e<f;e++){var d=z.getItem(e);if(d&&d.caption){var d=d.caption,h=""+E*v*a+"px "+aa;0<=K.indexOf("italic")&&(h="Italic "+h);0<=K.indexOf("bold")&&(h="Bold "+h);b.font=h;d=b.measureText(d).width;
d>c&&(c=d)}}return c=u*v+c+u*v/2+(u+E+u)*v+3*Ia}function H(a){if(!(s||null==x)){var b=0,g=(u+E+u)*v*p,f=j.stagescale;if(null==c.width){ra=!0;b=Aa(1);if(!0==a){c.scale=1;c.registercontentsize(b,null);c.updatepluginpos();c.width=null;var e=Z(0,0);e.x/=f;e.y/=f;var d=Z(b*f,g*f);d.x/=f;d.y/=f;0>e.x&&(b-=0-e.x);d.x>j.area.pixelwidth&&(b-=d.x-j.area.pixelwidth)}if(0>=b)return}else b=c.pixelwidth;b=Math.floor(b);g=Math.floor(g);Ja=b*p;Ka=g;x.width=b*p;x.height=g;x.style.width="100%";x.style.height="100%";
c.registercontentsize(b,a?g/p:null);!0==a&&c.updatepluginpos();ca()}}function ca(){var a=j.stagescale;if(J&&J.complete){var b=qa,g=Ja,f=Ka,e="";if(0<z.count){var d=z.getItem(T);d&&d.caption&&(e=d.caption)}d=""+E*v*p+"px "+aa;0<=K.indexOf("italic")&&(d="Italic "+d);0<=K.indexOf("bold")&&(d="Bold "+d);var h=0.5*v*p,a=80>g*a/p;if(1>=v*p||!1==sa)a=!1;a&&(d=""+E*v*p/2+"px "+aa,0<=K.indexOf("italic")&&(d="Italic "+d),0<=K.indexOf("bold")&&(d="Bold "+d));b.clearRect(0,0,g,f);var l,m,k=Sa,q=Ta,t=70*U,n=[],
r=[];for(l=0;5>l;l++)n[l]=k[l+1]-k[l];for(m=0;3>m;m++)r[m]=q[m+1]-q[m];var w=a?2:f-n[4]*h-n[2]*h/2-2|0,w=[n[0]*h|0,g-(n[0]+n[2]+n[4])*h-w|0,n[2]*h|0,w,n[4]*h|0],s=[r[0]*h|0,f-((r[0]+r[2])*h|0),r[2]*h|0],x=[0,w[0],w[0]+w[1],w[0]+w[1]+w[2],w[0]+w[1]+w[2]+w[3]],y=[0,s[0],s[0]+s[1]];for(m=0;3>m;m++)for(l=0;5>l;l++)b.drawImage(J,k[l]+t,q[m],n[l],r[m],x[l],y[m],w[l],s[m]);k=a?14*h|0:22*h|0;b.drawImage(J,140,0,22,22,(x[2]+w[2]/2+(x[4]+w[4]-Ia*h))/2-k/2|0,y[1]+s[1]/2-k/2+h|0,k,k);b.font=d;b.fillStyle=La;
b.strokeStyle="#FFF";b.textAlign="left";b.textBaseline="middle";b.save();b.beginPath();b.rect(u*v*p/2,u*v*p/2-1,g-(a?36:74)*h-u*v*p,f-u*v*p/2);b.clip();b.scale(c.scale,1);b.fillText(e,u*v*p,f/2+1);b.restore()}}function Ha(){var a=c.name+"_cb"+j.timertick,b="",g;if(c.hasOwnProperty("item")&&(g=c.item,g.hasOwnProperty("getArray"))){var f=g.getArray();g=f.length;var e="";Ma&&(e="background: -webkit-gradient(linear, 0% 5%, 0% 80%, from(rgba(250,250,250,1.0)), to(rgba(220,220,220,0.9))); border-radius:4px; border:1px solid rgba(100,100,100,1.0);");
c.html5style&&(e+=c.html5style);b+="<select name='"+a+" size='1' style='margin:0;padding:0;"+e+"'>";for(a=0;a<g;a++)e=f[a],b+="<option name='"+e.name+"'>"+e.caption+"</option>";c.sprite.innerHTML=b+"</select>";setTimeout(function(){var a,b,e=c.sprite.childNodes[0];e.onchange=function(){var a=c.item.getItem(this.selectedIndex);a&&j.call(a.onclick,c)};a=c.sprite.childNodes[0].offsetWidth;b=c.sprite.childNodes[0].offsetHeight;a/=j.stagescale;b/=j.stagescale;0<c.pixelwidth&&(a=c.pixelwidth,e.style.width=
a+"px");c.registercontentsize(a,b);c.updatepluginpos()},0)}}function Ua(a,b){ta(null,a,b)}function ta(a,b,g){if(null==a||""==a)a=Number(j.get(c.getfullpath()+".item.count")),a=isNaN(a)?"item1":"item"+(a+1);j.set(c.getfullpath()+".item["+a+"].caption",b);j.set(c.getfullpath()+".item["+a+"].onclick",g);ra&&(c._width=null);1==z.count&&(T=0);H(!0);s&&Ha()}function Va(){j.set(c.getfullpath()+".item.count",0);H()}function Wa(a){a=String(a).toLowerCase();var b=Number(j.get(c.getfullpath()+".item.count"));
if(!isNaN(b)){var g=c.item.getArray(),f;for(f=0;f<b;f++)if(String(g[f].caption).toLowerCase()==a)if(s){var e=c.sprite.childNodes[0];e&&(e.selectedIndex=f)}else T=f,Y()}}function Na(a){a=String(a).toLowerCase();var b=Number(j.get(c.getfullpath()+".item.count"));if(!isNaN(b)){var g=c.item.getArray(),f;for(f=0;f<b;f++)if(g[f].name==a)if(s){var e=c.sprite.childNodes[0];e&&(e.selectedIndex=f)}else T=f,Y()}}function Xa(){!1==s&&0==U&&za()}function Ya(){!1==s&&C()}var j=null,c=null,k=null,s=!1,p=1,ka=1,
x=null,Sa=[0,20,32,38,50,70],Ta=[0,20,44,64],Ia=6,La="#000000",qa=null,Ja=0,Ka=0,J=null,T=0,z=null,U=0,da=0,ra=!1,r=null,la=[0,38,50,134,146,184],Ra=[64,134,160,234],ea=28,Da=64,oa=30,pa=30,S=oa+pa,ha="#000000",Ba="rgba(27,82,225,1.0)",Ca="rgba(68,137,246,0.7)",ya="#FFFFFF",na="lightgray",W="68,137,246",X="27,82,225",G=null,ja=null,D=0,n=0,M=0,I=0,y=null,t=null,ia=0,aa="Arial",E=0,K="normal",u=0,v=0,sa=!0,ma="Arial",V=16,fa="normal",N=10,Ma=!1,L="webkitTransform",Fa="-webkit-background-size";this.registerplugin=
function(a,b,g){j=a;c=g;if("1.16">j.version)j.trace(3,"Combobox Plugin - too old krpano version (min. version 1.16)"),c=j=null;else{k=j.device;k.realDesktop&&(a=navigator.userAgent,0<a.indexOf("Safari/")&&0<a.indexOf("Version/")&&(Ma=!0));L=k.browser.css.transform;Fa=k.browser.css.backgroundsize;a=window.devicePixelRatio;k.pixelratio&&(a=k.pixelratio);p=k.tablet&&1<a?2:1;k.androidstock&&(ka=a);k.realDesktop&&(p=2);c.registerattribute("native","false");c.registerattribute("customstyle",null);c.registerattribute("cbfont",
"auto",function(a){aa="auto"==String(a).toLowerCase()?"Arial":a;H()},function(){return aa});c.registerattribute("cbfontsize","auto",function(a){E=parseInt(a);if(isNaN(E)||0>=E)E=j.isphone?16:14;H()},function(){return E});c.registerattribute("cbfontstyle","normal",function(a){K=String(a).toLowerCase()},function(){return K});c.registerattribute("cbpadding","auto",function(a){u=parseInt(a);if(isNaN(u)||0>=u)u=8;H()},function(){return u});c.registerattribute("cbdesignscale","auto",function(a){v=parseInt(a);
if(isNaN(v)||0>=v)v=j.device.mobile?2:1;H()},function(){return v});c.registerattribute("cbtoosmallfix",!0,function(a){sa="true"==String(a).toLowerCase()},function(){return sa});c.registerattribute("itemfont","Arial",function(a){ma="auto"==String(a).toLowerCase()?"Arial":a},function(){return ma});c.registerattribute("itemfontsize",16,function(a){V=parseInt(a);if(isNaN(V)||0>=V)V=16},function(){return V});c.registerattribute("itemfontstyle","normal",function(a){fa=String(a).toLowerCase()},function(){return fa});
c.registerattribute("itempadding",10,function(a){N=parseInt(a);if(isNaN(N)||0>N)N=10},function(){return N});z=c.createarray("item");c.additem=Ua;c.addiditem=ta;c.addnameditem=ta;c.removeall=Va;c.selectitem=Wa;c.selectiditem=Na;c.selectnameditem=Na;c.openlist=Xa;c.closelist=Ya;a=String(c["native"]).toLowerCase();s="auto"==a?k.desktop:"true"==a;if(!1==s){var f=new Image;a=!1;f.addEventListener("load",function(){J=f;ca()},!1);null!=c.customstyle&&""!=c.customstyle&&(b=c.customstyle.split("|"),8==b.length&&
(a=!0,f.src=j.parsePath(b[0]),La=$(Number(b[1])),ha=$(Number(b[2])),Ba=$(Number(b[3])),Ca="rgba("+(Number(b[3])>>16&255)+","+(Number(b[3])>>8&255)+","+(Number(b[3])&255)+",0.3)",ya=$(Number(b[4])),W=""+(Number(b[5])>>16&255)+","+(Number(b[5])>>8&255)+","+(Number(b[5])&255),X=""+(Number(b[6])>>16&255)+","+(Number(b[6])>>8&255)+","+(Number(b[6])&255),na=$(Number(b[7]))));!1==a&&(f.src=Za);x=document.createElement("canvas");x.onselectstart=function(){return!1};A(x,"down",Qa,!0);qa=x.getContext("2d");
c.sprite.appendChild(x);H(!0)}else Y();j.set("events[_combobox_"+c.name+"].keep",!0);j.set("events[_combobox_"+c.name+"].onresize",function(){!1==s&&(C(),ra&&(c._width=null,H(!0)))})}};var O=!1,ba=0,q=0,ga=0,R=null,F=[],B=0,P=null,Q=null;this.unloadplugin=function(){j&&c&&(C(),s&&x&&c.sprite.removeChild(x),j.set("events[_combobox_"+c.name+"].name",null),j=c=null)};this.onresize=function(a){if(s){if(c.sprite&&c.sprite.childNodes&&1<=c.sprite.childNodes.length){var b=c.sprite.childNodes[0];b&&(b.style.width=
a+"px");c.registercontentsize(a,null)}}else H();return!1};var Za="data:image/png;base64,[encoded data, 20980 characters]"};
