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