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