var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(m){var P=0;return function(){return P<m.length?{done:!1,value:m[P++]}:{done:!0}}};$jscomp.arrayIterator=function(m){return{next:$jscomp.arrayIteratorImpl(m)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(m,P,N){m!=Array.prototype&&m!=Object.prototype&&(m[P]=N.value)};$jscomp.getGlobal=function(m){m=["object"==typeof globalThis&&globalThis,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,m];for(var P=0;P<m.length;++P){var N=m[P];if(N&&N.Math==Math)return N}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.SymbolClass=function(m,P){this.$jscomp$symbol$id_=m;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:P})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};
$jscomp.Symbol=function(){function m(N){if(this instanceof m)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(N||"")+"_"+P++,N)}var P=0;return m}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var m=$jscomp.global.Symbol.iterator;m||(m=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[m]&&$jscomp.defineProperty(Array.prototype,m,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var m=$jscomp.global.Symbol.asyncIterator;m||(m=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(m){$jscomp.initSymbolIterator();m={next:m};m[$jscomp.global.Symbol.iterator]=function(){return this};return m};
$jscomp.iteratorFromArray=function(m,P){$jscomp.initSymbolIterator();m instanceof String&&(m+="");var N=0,X={next:function(){if(N<m.length){var Eb=N++;return{value:P(Eb,m[Eb]),done:!1}}X.next=function(){return{done:!0,value:void 0}};return X.next()}};X[Symbol.iterator]=function(){return X};return X};
$jscomp.polyfill=function(m,P,N,X){if(P){N=$jscomp.global;m=m.split(".");for(X=0;X<m.length-1;X++){var Eb=m[X];Eb in N||(N[Eb]={});N=N[Eb]}m=m[m.length-1];X=N[m];P=P(X);P!=X&&null!=P&&$jscomp.defineProperty(N,m,{configurable:!0,writable:!0,value:P})}};$jscomp.polyfill("Array.prototype.fill",function(m){return m?m:function(m,N,X){var P=this.length||0;0>N&&(N=Math.max(0,P+N));if(null==X||X>P)X=P;X=Number(X);0>X&&(X=Math.max(0,P+X));for(N=Number(N||0);N<X;N++)this[N]=m;return this}},"es6","es3");
function PEvs(m,P,N,X,Eb,bh,If){var ya,tc,$a,De,Td,Jf,ob,Sb,uc,ja,jb,Fb=0,Tb=0,Ud,Ma=!1,vc=!1,Ub=0,kb=0,Vb=0,pb=0,md,nd,Vd=3,Wb=function(k){ob=k.target;for(uc=Sb=0;ob;)Sb+=ob.offsetLeft-ob.scrollLeft,uc+=ob.offsetTop-ob.scrollTop,ob=ob.offsetParent;Fb=(Ma?md:k.pageX)-Sb-document.body.scrollLeft;Tb=(Ma?nd:k.pageY)-uc-document.body.scrollTop};this.getX=function(){return Fb};this.getY=function(){return Tb};this.setHysteresis=function(k){Vd=k};var F=function(k){k.preventDefault();k.stopImmediatePropagation?
k.stopImmediatePropagation():k.stopPropagation()},Wd=function(k){Wb(k);Ud=Fb;za=Tb;U=!0;null!=da&&(De=(new Date).getTime());null!=oa&&oa(k)},I=function(k){U&&(Wb(k),U=!1,null!=Gb&&Gb(k),null!=da&&(Td=(new Date).getTime(),Jf=Td-De,300>Jf&&da(k)))},Ea=function(k){Wb(k);Math.abs(Fb-Ud)<Vd&&Math.abs(Tb-za)<Vd||(za=Ud=-9999,U?null!=Ta&&Ta(k):null!=lb&&lb(k),null!=Xd&&Ee())};this.touchDown=function(k){$a=!0;if(1<k.targetTouches.length)return Ma=!0,jb&&(kb=-1,F(k)),!1;ya=k.changedTouches;tc=ya[0];Wd(tc)};
this.touchUp=function(k){0==k.targetTouches.length&&(Ma=$a=!1);F(k);if(Ma||vc)return Ma||(vc=!1),!1;ya=k.changedTouches;tc=ya[0];I(tc)};this.touchMove=function(k){$a=!0;F(k);if(Ma)return jb&&(ya=k.targetTouches,md=(ya[0].pageX+ya[1].pageX)/2,nd=(ya[0].pageY+ya[1].pageY)/2,vc=!0,Vb=ya[0].pageX-ya[1].pageX,pb=ya[0].pageY-ya[1].pageY,Ub=Vb*Vb+pb*pb,Wb(k),jb&&0<kb&&30<Math.abs(Ub-kb)&&jb(0<Ub-kb?1:-1),kb=Ub),!1;ya=k.changedTouches;tc=ya[0];Ea(tc)};this.pointUp=function(k){F(k);for(var m=0;m<ua.length;m++)if(ua[m].pointerId==
k.pointerId){ua.splice(m,1);break}0==ua.length&&($a=Ma=!1);if(Ma||vc)return Ma||(vc=!1),!1;I(k);return!1};this.pointDown=function(k){F(k);ua.push(k);kb=-1;$a=!0;1<ua.length?Ma=!0:Wd(k);return!1};this.pointMove=function(k){F(k);for(var m=0;m<ua.length;m++)ua[m].pointerId==k.pointerId&&(ua[m]=k);if(Ma||!vc){if(Ma)return md=(ua[0].pageX+ua[1].pageX)/2,nd=(ua[0].pageY+ua[1].pageY)/2,Wb(k),jb&&(vc=!0,Vb=ua[0].pageX-ua[1].pageX,pb=ua[0].pageY-ua[1].pageY,Ub=Vb*Vb+pb*pb,jb&&0<kb&&30<Math.abs(Ub-kb)&&jb(0<
Ub-kb?1:-1),kb=Ub),!1;Ea(k);return!1}};this.mouseDown=function(k){$a||(F(k),Wd(k))};this.clearDown=function(){U=!1};this.mouseUp=function(k){$a||(F(k),I(k))};this.useWheel=function(k){m.addEventListener("wheel",this.mouseWheel,!0);jb=k};this.mouseWheel=function(k){Wb(k);var m=Math.max(-1,Math.min(1,-k.deltaY||-k.detail));F(k);jb&&jb(m)};this.mouseClick=function(k){F(k);U=!1};this.mouseMove=function(k){$a||(F(k),Ea(k))};this.mouseDragged=function(k){$a||(F(k),Wb(k),null!=Ta&&Ta(k),null!=Xd&&Ee())};
var Ee=function(){clearTimeout(ja);ja=setTimeout(function(){Xd()},600)};var za=Ud=Tb=Fb=0;var oa=P;var Gb=N;var lb=X;var Ta=Eb;var da=bh;var Xd=If;var U=$a=!1;var ua=[];m.addEventListener("mousedown",this.mouseDown,!1);m.addEventListener("mouseup",this.mouseUp,!1);m.addEventListener("mousemove",this.mouseMove,!1);m.addEventListener("click",this.mouseClick,!1);m.addEventListener("touchstart",this.touchDown,!1);m.addEventListener("touchend",this.touchUp,!1);m.addEventListener("touchmove",this.touchMove,
!1);m.addEventListener("touchleave",this.touchUp,!1);m.addEventListener("touchcancel",this.touchUp,!1);m.addEventListener("contextmenu",function(k){k.preventDefault()},!1);m.style["touch-action"]="none";m.addEventListener("mouseout",function(k){U||(Tb=Fb=-1,null!=lb&&lb(k));U=!1})};var HAniSF=function(){function m(b){var a,d;od=!0;if(b instanceof Array)for(e={},null!=ch&&(b=b.concat(ch)),a=0;a<b.length;a++){if(!(2>b[a].length)){var c=b[a].trim();if(0!=c.indexOf("#")){var h=c.indexOf("=");if(!(1>h)){var K=c.substr(0,h).trim().toLowerCase();e[K]=c.substr(h+1).trim()}}}}else e=b;Fe=!1;a=e.debug;null!=a&&("true"==a?(Kf=window.open("","HAniSDebugInfo","scrollbars=yes,width=400,height=200"),Fe=!0,ea("HAniS Version 4.41")):Fe=!1);a=e.no_initial_focus;null!=a&&"false"!=a||A.focus();
mb=!0;y(e.set_className,"f")&&(mb=!1);ea("Is type of param an array = "+(b instanceof Array));a=e.divalign;null!=a&&(Yd=a.trim(),A.align=Yd);y(e.prevent_shortcuts,"t")&&(Ge=!0);a=e.initial_message;null!=a&&(b=e.initial_message_style,null==b&&(b="background-color:red;top:10px;left:10px;height:100px;width:200px"),b="z-index:99;position:absolute;"+b,wc=q("div"),wc.setAttribute("style",b),wc.innerHTML=a,wc.addEventListener("click",function(){wc.style.visibility="hidden"},!1),wc.style.visibility="visible",
Ua.appendChild(wc),b=e.initial_message_timeout,null!=b&&("auto"==b?Lf=!0:(Lf=!1,b=parseInt(e.initial_message_timeout,10),2>b&&(b=2),setTimeout(function(){wc.style.visibility="hidden"},1E3*b))));pd=null;a=e.initial_enhancement;null!=a&&(pd=parseInt(a,10)-1);qd=!1;He="X = ";Ie=" Y = ";a=e.coordinates;null!=a&&(Eb(a),qd=!0,He="Lat = ",Ie=" Lon = ");c="green";h="white";K="12px Arial";var g=null,l=d=10,f=10;Mf=2;a=e.keyboard_propagate;null!=a&&y(a,"t")&&(Je=!1);a=e.coordinates_display_style;null!=a&&(b=
a.split(","),c=b[0].trim(),h=b[1].trim(),K=b[2].trim(),3<b.length&&(He=b[3],Ie=b[4],Mf=parseInt(b[5],10),6<b.length&&(g=b[6].trim(),d=parseInt(b[7],10),l=parseInt(b[8],10),f=parseInt(b[9],10))));dh=new lb(c,h,K,g,d,l,f);Ke=Kc=null;null!=e.map_scale&&(Le=Xb=!0,b=e.map_scale.split(","),Kc=parseFloat(b[0]),Ke=1<b.length?parseFloat(b[1]):Kc);rd=qd?"km":" ";Me=1;a=e.distance_unit;null!=a&&(rd=a.trim(),y(rd,"mi")&&(Me=.621371192),y(rd,"nm")&&(Me=.539956803),y(rd,"na")&&(Me=.539956803));Zd=null;a=e.show_bearing;
null!=a&&(Zd=a.trim());a=e.divcan_style;null!=a&&a.trim();Nf="default";a=e.distance_cursor;null!=a&&(Nf=a.trim());Ne="default";a=e.location_cursor;null!=a&&(Ne=a.trim());Oe="default";a=e.probe_cursor;null!=a&&(Oe=a.trim());Of="default";a=e.mark_cursor;null!=a&&(Of=a.trim());a=e.imagecan_style;null!=a&&(b=a.trim()+";position:absolute;top:0;left:0;",qb.setAttribute("style",b+"z-index:1;"),xc.setAttribute("style",b+"z-index:12;"));c="blue";h="white";K="12px Arial";g=null;f=l=d=10;Pf=1;eh="white";a=e.distance_display_style;
null!=a&&(b=a.split(","),c=b[0].trim(),h=b[1].trim(),eh=5<=b.length?b[4].trim():h,K=b[2].trim(),Pf=parseInt(b[3],10),5<b.length&&(g=b[5].trim(),d=parseInt(b[6],10),l=parseInt(b[7],10),f=parseInt(b[8],10)));Ci=new lb(c,h,K,g,d,l,f);c="black";h="white";K="12px Arial";g=null;f=l=d=10;a=e.probe_display_style;null!=a&&(b=a.split(","),c=b[0].trim(),h=b[1].trim(),K=b[2].trim(),3<b.length&&(g=b[3].trim(),d=parseInt(b[4],10),l=parseInt(b[5],10),f=parseInt(b[6],10)));Di=new lb(c,h,K,g,d,l,f);fh="Undefined";
gh=!1;$d=0;a=e.probe_undefined;null!=a&&(b=a.split(","),fh=b[0].trim(),1<b.length&&($d=parseInt(b[1],10)+1),2<b.length&&(gh=!0));Qf=!1;e.probe_base_image&&(Qf=!0);a=e.active_probe;null!=a&&(Yb=!0);a=e.pause;null!=a&&(hh=parseInt(a,10));a=e.auto_refresh;null!=a&&(Rf=6E4*parseInt(a,10),Lc=setInterval("HAniS.reloadFOF();",Rf),ae=!0);Pe=!1;ih="#FFFFFF80";a=e.show_hotspots;null!=a&&(b=a.split(","),y(b[0],"t")&&(Pe=!0),1<b.length&&(ih=b[1]));Sf=!1;y(e.center_hotspots,"t")&&(Sf=!0);sd=!1;y(e.enable_smoothing,
"t")&&(sd=!0);jh="low";a=e.smoothing_quality;null!=a&&(jh=a);Qe=!0;y(e.check_image_size,"f")&&(Qe=!1);kh=!1;a=e.sprites;if(null!=a){b=a.split(",");Tf=new Image;Uf=[];Vf=[];Zb=[];$b=[];if("row"==b[1].trim().toLowerCase())for(l=h=c=0,a=2;a<b.length;)for("row"==b[a].trim().toLowerCase()&&(c=0,h+=l,l=0,a+=1),d=parseInt(b[a],10),a+=1,K=parseInt(b[a],10),a+=1,g=parseInt(b[a],10),g>l&&(l=g),a+=1,f=0;f<d;f++)Uf.push(c),Vf.push(h),Zb.push(K),$b.push(g),c+=K;else for(h=!1,a=1;a<b.length;)Uf.push(parseInt(b[a],
10)),a+=1,Vf.push(parseInt(b[a],10)),a+=1,a>=b.length?(c=0,h=!0):c=parseInt(b[a],10),0>c?(h=!0,Zb.push(Math.abs(c)),a+=1,c=parseInt(b[a++],10),$b.push(Math.abs(c))):h?(Zb.push(Zb[Zb.length-1]),$b.push($b[$b.length-1])):(Zb.push(parseInt(b[a],10)),a+=1,$b.push(parseInt(b[a],10)),a+=1);Tf.onload=function(){kh=!0};Tf.src=b[0]}a=e.overlay_labels;null!=a&&(ac=a.split(","));Wf=null;a=e.auto_enhance_background;null!=a&&(Wf=parseInt(a,10)-1);Mc=null;a=e.auto_enhance;if(null!=a)for(c=e.overlay_probe_table,
b=a.split(","),Mc=Array(b.length),a=0;a<b.length;a++)"x"==b[a].trim().toLowerCase()?Mc[a]=-1:Mc[a]=parseInt(b[a].trim(),10)-1,null==c&&(yc[a]=Mc[a]);Nc=!1;rb=-1;a=e.overlay_enhance;null!=a&&(Nc=!0,rb=parseInt(a,10)-1);zc=null;td=!0;a=e.overlay_allow_hoverzones;if(null!=a)for(b=a.split(","),zc=Array(b.length),a=0;a<b.length;a++)if(zc[a]=!0,y(b[a],"n")||y(b[a],"f"))zc[a]=!1;Y=aa=null;Xf=lh=!1;a=e.window_size;null!=a&&(b=a.split(","),"div"==b[0]?Xf=!0:(Y=parseInt(b[0],10),aa=parseInt(b[1],10)),lh=!0);
Yf=[];a=e.framenumber_index_values;null!=a&&(Yf=a.split(","));Hb=[];a=e.use_for_all_frames;if(null!=a)for(b=a.split(","),a=0;a<b.length;a+=2)Hb[parseInt(b[a],10)]=parseInt(b[a+1],10)-1;be=-1;a=e.skip_missing;null!=a&&(be=parseInt(a,10));mh="#00000000";a=e.skip_missing_color;null!=a&&(mh=a);Re=null;a=e.overlay_spacer;if(null!=a)for(b=a.split(","),Re=Array(b.length),a=0;a<b.length;a++)Re[a]=parseInt(b[a],10);a=e.overlay_probe_table;if(null!=a)for(b=a.split(","),a=0;a<b.length;a++)"x"==b[a].trim().toLowerCase()?
yc[a]=-1:yc[a]=parseInt(b[a],10)-1;Zf=[];a=e.overlay_ontop;if(null!=a)for(b=a.split(","),a=0;a<b.length;a++)Zf[parseInt(b[a],10)-1]=!0;Oc=null;a=e.overlay_order;null==a&&(a=e.overlay_zorder);if(null!=a)for(b=a.split(","),Oc=Array(b.length),a=0;a<b.length;a++)Oc[parseInt(b[a],10)-1]=a;bc=null;a=e.overlay_links;if(null!=a)for(b=a.split(","),bc=Array(b.length),a=0;a<b.length;a++)bc[a]=parseInt(b[a],10);nh=[];O=null;a=e.overlay_slice;if(null!=a)for(b=a.split(","),a=0;a<b.length;a++)nh[parseInt(b[a],10)-
1]=!0;oh=!0;y(e.slice_smoothing,"f")&&(oh=!1);ud=null;a=e.overlay_clear;if(null!=a)for(b=a.split(","),ud=Array(b.length),a=0;a<b.length;a++)ud[a]=b[a].trim().toLowerCase();ph=!1;a=e.transparency;null!=a&&(b=a.split(","),1==b.length?qh=rh=sh=parseInt(b[0],10):(qh=parseInt(b[0],10),rh=parseInt(b[1],10),sh=parseInt(b[2],10)),ph=!0);$f=!1;a=e.transparency_list;if(null!=a){b=a.split(",");th=[];for(a=0;a<b.length;a++)th[parseInt(b[a].trim(),10)-1]=!0;$f=!0}Se=null;a=e.overlay_transparent_amount;if(null!=
a)for(b=a.split(","),Se=Array(b.length),a=0;a<b.length;a++)Se[a]=parseFloat(b[a])/100;Pc=null;a=e.overlay_zoom;if(null!=ac&&null!=a)for(b=a.split(","),Pc=Array(b.length),a=0;a<b.length;a++)if(Pc[a]=1,y(b[a],"n")||y(b[a],"f"))Pc[a]=0;else if(y(b[a],"d")||y(b[a],"h"))Pc[a]=-1;sb=null;uh=[];a=e.overlay_preserve_list;if(null!=ac&&null!=a)for(b=a.split(","),sb=Array(b.length),a=0;a<b.length;a++){sb[a]=!0;if(y(b[a],"n")||y(b[a],"f"))sb[a]=!1;if(y(b[a],"a")||y(b[a],"A"))uh[a]=!0}ka=null;if(null!=ac&&null!=
sb)for(b=e.overlay_preserve.replace(/&/g,",&,").split(","),c=e.overlay_preserve_position,null!=c&&(c=c.split(",")),h=0,ka=Array(sb.length),a=K=0;a<sb.length;a++)if(sb[a]){ka[a]=[];g=0;do{ka[a][g]=[];for(d=0;4>d;d++)ka[a][g][d]=parseInt(b[K].trim(),10),K+=1;ka[a][g][2]=ka[a][g][2]-ka[a][g][0]+1;ka[a][g][3]=ka[a][g][3]-ka[a][g][1]+1;null!=c?(ka[a][g][4]=parseInt(c[h],10),ka[a][g][5]=parseInt(c[h+1],10),h+=2):(ka[a][g][4]=ka[a][g][0],ka[a][g][5]=ka[a][g][1]);K<b.length&&"&"==b[K].trim()?(K+=1,g+=1,d=
!0):d=!1}while(d)}Te=0;vh=" ";Ac="white";ce="transparent";de="14pt arial";wh=!1;a=e.times_label_style;null!=a&&(b=a.split(","),Ac=b[0].trim(),1<b.length&&(Te=Math.floor(60*parseFloat(b[1]))),1<b.length&&(Te="?"==b[1].trim()||"auto"==b[1].trim().toLowerCase()?-Math.floor((new Date).getTimezoneOffset()):Math.floor(60*parseFloat(b[1]))),2<b.length&&(vh=b[2].trim()),3<b.length&&(ce=b[3].trim()),4<b.length&&(de=b[4].trim()),5<b.length&&-1!=b[5].trim().indexOf("t")&&(wh=!0));0==Ac.indexOf("0x")&&(Ac="#"+
Ac.substring(2));0==ce.indexOf("0x")&&(ce="#"+ce.substring(2));vd=parseInt(de,10);Ei=new lb("black","white",de,"black",20,5,5);xh=!1;xh=y(e.to_from_lock,"t")?!0:!1;a="black";d="white";l="14px arial";c=null;g=K=h=10;yh=zh=" ";ag=wd=null;a=e.dirspd_display_style;null!=a&&(b=a.split(","),a=b[0].trim(),d=b[1].trim(),l=b[2].trim(),yh=b[3],zh=b[4],5<b.length&&(c=b[5].trim(),h=parseInt(b[6],10),K=parseInt(b[7],10),g=parseInt(b[8],10)),ag=new lb(a,d,l,c,h,K,g));c="black";h="white";K="14px arial";g=null;f=
l=d=10;a=e.tipbox_display_style;null!=a&&(b=a.split(","),c=b[0].trim(),h=b[1].trim(),K=b[2].trim(),3<b.length&&(g=b[3].trim(),d=parseInt(b[4],10),l=parseInt(b[5],10),f=parseInt(b[6],10)));Ah=new lb(c,h,K,g,d,l,f);xd=null;fa=e.image_base;null!=fa?xd=fa=fa.trim():fa=null!=e.image_only_base?e.image_only_base.trim():null;Bh=fa;a=e.overlay_base;null!=a&&(tb=a.trim());Ue=!0;y(e.zip_only,"f")&&(Ue=!1);Qc=!1;a=e.zip_filename;null!=a&&(Qc=!0,bg=a.trim());od=!0;a=e.filenames;null==a&&(a=e.background_filenames);
null!=a&&Fi(a);a=e.basename;null!=a&&(c=e.base_starting_number,h=0,K=1,null!=c&&(b=c.split(","),h=parseInt(b[0],10),1<b.length&&(K=parseInt(b[1],10))),t=e.num_frames,null==t&&(t=e.num_images),t=parseInt(t,10),Gi(a,h,K));cg=!0;b=e.zip_static;if(y(b,"f")||y(b,"n"))cg=!1;dg=!0;b=e.background_static;if(y(b,"f")||y(b,"n"))dg=!1;a=e.overlay_filenames;null!=a&&Hi(a);Na=null;a=e.image_preserve;if(null!=a)for(b=a.split(","),Na=[],a=0;a<b.length;a++)Na[a]=parseInt(b[a].trim(),10),1<a%4&&(Na[a]=Na[a]-Na[a-2]+
1);Ch=!1;y(e.keep_enhancement,"t")&&(Ch=!0);Dh=!0;y(e.keep_zoom,"f")&&(Dh=!1);yd=eg=0;Eh=!1;a=e.hide_bottom;null!=a&&(b=a.split(","),eg=parseInt(b[0].trim(),10),1<b.length&&y(b[1],"t")&&(Eh=!0));zd=fg=0;Fh=!1;a=e.hide_top;null!=a&&(b=a.split(","),fg=parseInt(b[0].trim(),10),1<b.length&&y(b[1],"t")&&(Fh=!0));Ad=gg=0;Gh=!1;a=e.hide_left;null!=a&&(b=a.split(","),gg=parseInt(b[0].trim(),10),1<b.length&&y(b[1],"t")&&(Gh=!0));Bd=hg=0;Hh=!1;a=e.hide_right;null!=a&&(b=a.split(","),hg=parseInt(b[0].trim(),
10),1<b.length&&y(b[1],"t")&&(Hh=!0));Ih=!1;y(e.hide_background,"t")&&(Ih=!0);Jh="<div>";Kh=300;Lh=500;a=e.popup_style;null!=a&&(Jh='<div style="'+a+'">');a=e.popup_window_size;null!=a&&(b=a.split(","),Lh=b[0],Kh=b[1]);Mh=!1;a=e.wheel_frames;null!=a&&(Mh=!0,la.useWheel(E.wheel));Nh=Ca=!1;y(e.active_zoom,"t")&&(null==Fa&&(Ca=!0),la.useWheel(E.wheel));ig=!1;y(e.cycle_zoom,"t")&&(ig=!0);a=e.initial_zoom;null!=a&&(b=a.split(","),Bc="auto"!=b[0].toLowerCase()?parseFloat(b[0]):"auto",1<b.length?(ee=parseInt(b[1],
10),Oh=parseInt(b[2],10)):ee=-1,Ph=!0);Cd=1;Dd=!1;pa=null;a=e.zoom_scale;if(null!=a)if(b=a.split(","),1===b.length)y(a,"hi_res")?(Dd=!0,Cd=0):Cd=parseFloat(a);else{pa=Array(b.length);for(a=0;a<b.length;a++)pa[a]=parseFloat(b[a]);Dd=!0}Rc=9999999;a=e.maximum_zoom;null!=a&&(Rc=parseFloat(a));Ve=!0;y(e.use_progress_bar,"f")&&(Ve=!1);a=e.dwell;null!=a&&(b=a.split(","),Ga=parseInt(b[0].trim(),10),1<b.length&&(cc=parseInt(b[1].trim(),10),10>cc&&(cc=10),Sc=parseInt(b[2].trim(),10),jg=parseInt(b[3].trim(),
10)));a=e.rate;null!=a&&(b=a.split(","),Ga=Math.round(1E4/parseFloat(b[0].trim())),1<b.length&&(cc=Math.round(1E4/parseFloat(b[2].trim())),10>cc&&(cc=10),Sc=Math.round(1E4/parseFloat(b[1].trim()))));a=e.frame_times_template;null!=a&&(b=a.split(","));ub=null;a=e.times;if(null!=a){b=a.split(",");ub=Array(b.length);for(a=0;a<b.length;a++)ub[a]=parseInt(b[a].trim(),10);ya(ub)}a=e.extrap_times_filename;if(null!=a){ub=[];var k=new XMLHttpRequest;k.open("get",a,!0);k.onload=function(){for(var a=k.responseText.split("\n"),
b=0;b<a.length;b++){var c=a[b].split(" ");if(3==c.length){c[2].trim();var d=parseInt(c[0],10)-1;ub[d]=100*parseInt(c[2].substring(0,2),10)+parseInt(c[2].substring(3,5),10)+parseInt(c[2].substring(6,8),10)/30}}ya(ub)};k.send()}fe=null;a=e.extrap_times_template;null!=a&&(fe=RegExp(a));Qh=["Click on target's initial position","Click on target's final position","Move pointer around or click here to select target"];Rh=10;y(e.extrap_prompts_position,"bot")&&(Rh=9999);a=e.extrap_prompts;null!=a&&(Qh=a.split(","));
We=["Click on first point to mark","Save points","Remove last point"];a=e.mark_prompts;null!=a&&(We=a.split(","));Xe=!0;y(e.mark_close,"f")&&(Xe=!1);kg="12pt Arial";Sh="white";a=e.mark_prompts_style;null!=a&&(b=a.split(","),kg=b[0].trim(),1<b.length&&(Sh=b[1].trim()));Th=e.controls;ea("controls = "+e.controls);ea("bottom_controls = "+e.bottom_controls);Tc=Ye=dc=ec=vb=wb=Ze=Ib=null;null!=Th&&jb(Th,!0);Uh=e.bottom_controls;null!=Uh&&jb(Uh,!1);Uc=!1;a=e.probe_table;null!=a&&X(a);b=e.enhance_filename;
null==b&&(b=e.enhance_table);if(null!=b){ea("Reading enhancement table...");Uc=!1;k=new XMLHttpRequest;xb=[];Vc=[];$e=[];Wc=[];fc=[];var Vh,Cc,m;ab=[];bb=[];cb=[];ge=[];u=-1;Wh=!0;var lg=!1,n,x,p,z,D,v,F,Q,B,r,G,C,I;k.onload=function(){for(var a=this.responseText.split("\n"),b=0;b<a.length;b++)if(!(2>a[b].length)){var c=a[b].replace(/\s+/g," ").trim(),d=c.indexOf("#");if(0!=d)if(0<d&&(c=c.substring(0,d)),d=c.split(","),0==d[0].indexOf("*"))u++,xb[u]=Array(256),Wc[u]=Array(256),Vc[u]=Array(256),fc[u]=
Array(256),ab[u]=Array(256),bb[u]=Array(256),cb[u]=Array(256),ge[u]=Array(256),xb[u]=Array(256),$e[u]=1<d.length?d[1].trim():"None",Vh=" ",Cc="Value =",m=1,c=q("option"),c.innerHTML=d[0].substring(1),c.value=u,null!=Aa&&Aa.add(c);else{var h=c.indexOf("value");0>h&&(h=c.indexOf("probe"));lg=!1;r=G=0;0<h&&(d=c.substring(h+1),c=c.substring(0,h),h=d.indexOf("="),d=d.substring(h+1),d=d.split(","),1==d.length?(Cc=d[0].trim(),m=-1,lg=!1):(r=parseFloat(d[0].trim()),G=parseFloat(d[1].trim()),2<d.length&&(m=
parseInt(d[2],10)),3<d.length&&(Vh=Ii(d[3].trim())),4<d.length&&(Cc=d[4].trim()),lg=!0));c=c.split(" ");n=parseInt(c[0].trim(),10);x=parseInt(c[1].trim(),10);p=x-n;z=parseFloat(c[2].trim());D=parseFloat(c[3].trim());v=parseFloat(c[4].trim());F=parseFloat(c[5].trim());Q=parseFloat(c[6].trim());B=parseFloat(c[7].trim());C=I=255;9<c.length&&(C=parseFloat(c[8].trim()),I=parseFloat(c[9].trim()));for(c=n;c<=x;c++)0===p?(ab[u][n]=z,bb[u][n]=v,cb[u][n]=Q,ge[u][n]=C):(ab[u][c]=Math.round(z+(D-z)*(c-n)/p),
bb[u][c]=Math.round(v+(F-v)*(c-n)/p),cb[u][c]=Math.round(Q+(B-Q)*(c-n)/p),ge[u][c]=Math.round(C+(I-C)*(c-n)/p)),Wc[u][c]=Cc,Vc[u][c]=Vh,fc[u][c]=m,lg&&(xb[u][c]=r+(G-r)*(c-n)/p)}}-1!=rb&&w[rb].checked&&(Aa.disabled=!1);Uc=!0;P()};k.open("get",b,!0);k.send()}else P()}function P(){var b=e.sprite_filenames;if(null!=b){var a=b.split(",");mg=0;ma=[];b=e.sprite_images_offset;Xc=-1;null!=b&&(Xc=parseInt(b,10)-1);for(b=0;b<a.length;b++){ma[b]=new Image;ma[b].gotit=!1;ma[b].inx=b;ma[b].fromfile=!0;var d="/";
0<a[b].indexOf("?")&&(d="?");ma[b].zoomme=0<a[b].indexOf(d+"zoom");ma[b].anim=0<a[b].indexOf(d+"animate");d=a[b].indexOf(d);0<d&&(a[b]=a[b].substring(0,d));ma[b].onload=function(){ma[this.inx].gotit=!0;mg++;mg==a.length&&N()};ma[b].src=a[b].trim()}}else N()}function N(){for(var b=Object.keys(e),a=0;a<b.length;a++)y(b[a],"hotspot")&&Tb("hotspot="+e[b[a]]);od?E.getFOF():(Dc=!0,Sb())}function X(b){var a=new XMLHttpRequest;xb=[];$e=[];Vc=[];var d=" ";Wc=[];var c="Value=";fc=[];var h=1;Yc=[];ng=[];ab=
[];bb=[];cb=[];var e,g=-1;u=-1;var l=0;a.onload=function(){for(var a=this.responseText.split("\n"),b=0;b<a.length;b++)if(!(2>a[b].length)){var K=a[b].replace(/\s+/g," ").trim().split(","),f=K[0].split(" ");if(0==f[0].indexOf("*"))u++,xb[u]=[],Wc[u]=[],Vc[u]=[],fc[u]=[],ab[u]=[],bb[u]=[],cb[u]=[],ng[u]=[],Yc[u]=[],g=-1,$e[u]=1<K.length?K[1].trim():"None",l=1;else if(0!=l){g++;var k=Array(3);xb[u][g]=parseFloat(f[0]);ab[u][g]=parseInt(f[1].trim(),10);bb[u][g]=parseInt(f[2].trim(),10);cb[u][g]=parseInt(f[3].trim(),
10);0!=g&&(k[0]=ab[u][g]-ab[u][g-1],k[1]=bb[u][g]-bb[u][g-1],k[2]=cb[u][g]-cb[u][g-1],e=0,Math.abs(k[1])>Math.abs(k[e])&&(e=1),Math.abs(k[2])>Math.abs(k[e])&&(e=2),ng[u][g-1]=e,Yc[u][g-1]=k,0==Yc[u][g-1][e]&&(Yc[u][g-1][e]=1));1<K.length&&(0==K[1].trim().indexOf('"')?(h=-1,K=K[1].trim(),c=K.substr(1,K.length-2),d=""):(h=parseInt(K[1],10),2<K.length&&(d=Ii(K[2].trim())),3<K.length&&(c=K[3].trim())));Wc[u][g]=c;fc[u][g]=h;Vc[u][g]=d}}Uc=!0};a.open("get",b,!0);a.send()}function Eb(b){b=b.split(",");
var a=b[0].trim();"PS"===a?(gc=new $i,gc.init(b)):"CE"==a?(gc=new aj,gc.init(b)):"LCC"==a?(gc=new bj,gc.init(b)):(gc=null,og=parseFloat(b[0]),pg=parseFloat(b[1]),Ji=parseFloat(b[2]),qg=parseFloat(b[3]),0<pg&&0>qg&&(qg+=360));null==e.coordinates_display_style&&(He="Lat = ",Ie=" Lon = ");qd=!0}function bh(b){var a=new XMLHttpRequest;a.onload=function(){m(this.responseText.split("\n"))};a.open("get",b+"?"+Math.round(1E5*Math.random()),!0);a.send()}function If(b){var a;if(null!=ud){for(a=0;a<ud.length;a++)-1!=
ud[a].indexOf(b)&&(w[a].checked=!1);for(a=0;a<ud.length;a++)Fb(a)}}function ya(b){rg=Array(b.length);for(var a=0;a<b.length;a++){var d=60*Math.floor(b[a]/100)+Math.floor(b[a])%100;0===a&&(hc=d);var c=d-hc;0>c&&(c=d+1440-hc);rg[a]=c;ea("times s="+d+"  min="+rg[a])}hc+=Te;1440<=hc&&(hc-=1440);0>hc&&(hc+=1440);ea("Starting minute = "+hc)}function tc(b,a){if(0!=b&&!Zc)for(var d=0;d<b;d++)0==w[Oa[d].overlay].isGhost&&(w[Oa[d].overlay].parentNode.style.visibility=a)}function $a(){var b,a,d,c,h;if(sg){var e=
new XMLHttpRequest;var f=0;R=[];e.onload=function(){var e=this.responseText.split("\n");ea("Processing FoF-substitute: "+Xh);for(d=0;d<e.length;d++)if(!(2>e[d].length||0>e[d].indexOf(Ki))&&(R[f]=[],h=e[d].indexOf("overlay"),0<=h)){b=e[d].substring(h);h=b.indexOf("=");0>h&&ea("!! Cannot find a = sign in "+b);a=b.substring(h+1);b=a.trim();a=b.split(",");V=Math.max(V,a.length);ea("numOverlays reset in fof_substitute to "+V);for(c=0;c<a.length;c++)R[f][c]=a[c].trim(),null!=he&&tg[c]?R[f][c]=(he+R[f][c]).trim():
null!=tb?R[f][c]=(tb+R[f][c]).trim():null!=fa&&(R[f][c]=(fa+R[f][c]).trim());f+=1}ea("Number of frames "+t+"... number of fof_sub frames = "+f);De()};e.open("get",Xh+"?"+Math.round(1E5*Math.random()),!0);e.send()}else De()}function De(){0!=yb?tc(yb,"visible"):0!=Yh&&tc(Yh,"hidden");Dc=!0;Sb()}function Td(b,a){Ed||(qb.height=a,qb.width=b,xc.height=a,xc.width=b,ie.height=a,ie.width=b,af.height=a,af.width=b,je=af.getContext("2d"),Y=b,aa=a,bf=Y/2-100,cf=aa/2-10,B=1*qa/Y,r=1*ra/aa,Ua.style.height=aa+"px",
Ua.style.width=Y+"px",Ec.style.height=aa+"px",Ec.style.width=Y+"px",ke.style.height=aa+"px",ke.style.width=Y+"px",Ee(t,!1),Zh&&(Zh=!1,null!=le&&le()))}function Jf(){for(var b=0,a={},d=0;d<t;a={$jscomp$loop$prop$ii$2:a.$jscomp$loop$prop$ii$2},d++){a.$jscomp$loop$prop$ii$2=d;var c=null==fa?va[d]:va[d].substring(va[d].lastIndexOf("/")+1);(c=$h.file(c))?c.async("arraybuffer").then(function(a){return function(c){c=new Blob([c]);Fc[a.$jscomp$loop$prop$ii$2]=URL.createObjectURL(c);b++;b>=t&&ob()}}(a),function(a){return function(){Fc[a.$jscomp$loop$prop$ii$2]=
null;b++;b>=t&&ob()}}(a)):(Fc[a.$jscomp$loop$prop$ii$2]=null,b++,b>=t&&ob())}}function ob(){var b=0;if(0==V)uc();else for(var a=0;a<t;a++){Gc[a]=[];for(var d={},c=0;c<V;d={$jscomp$loop$prop$ii$6:d.$jscomp$loop$prop$ii$6,$jscomp$loop$prop$jj$7:d.$jscomp$loop$prop$jj$7},c++){d.$jscomp$loop$prop$ii$6=a;d.$jscomp$loop$prop$jj$7=c;var h=null==tb&&null==fa?R[a][c]:R[a][c].substring(R[a][c].lastIndexOf("/")+1);(h=$h.file(h))?h.async("arraybuffer").then(function(a){return function(c){c=new Blob([c]);Gc[a.$jscomp$loop$prop$ii$6][a.$jscomp$loop$prop$jj$7]=
URL.createObjectURL(c);b++;b>=t*V&&uc()}}(d),function(a){return function(){Gc[a.$jscomp$loop$prop$ii$6][a.$jscomp$loop$prop$jj$7]=null;b++;b>=t*V&&uc()}}(d)):(Gc[a][c]=null,b++,b>=t*V&&uc())}}}function Sb(){if(Qc){var b=new XMLHttpRequest,a=null==xd?bg:xd+bg;cg||(a=a+"?"+Math.round(1E5*Math.random()));b.open("GET",a,!0);b.responseType="arraybuffer";Fc=[];Gc=[];b.addEventListener("progress",function(a){a.lengthComputable&&ua("Loading ZIP file",a.total,a.loaded)});b.onload=function(a){(new JSZip).loadAsync(this.response).then(function(a){$h=
a;Jf()},function(){ea("Unable to read ZIP file: "+bg)})};b.send()}else uc()}function uc(){var b,a,d;void 0!=df&&df(!1);var c="?"+Math.round(1E4*Math.random()),h=[];h[0]=ic;null!=zb&&(zb.disabled=!0);for(b=1;b<t;b++)h[b]=b<=ic?b-1:b;Pa=Array(t);jc=Qa=0;ai=Ve;ug&&(Ha.max=t);Ed&&(Fd||Nc)&&(kc=[],Va=[],$c=[],vg=[],ef=[]);null!=Aa&&(Ch?null==pd&&(pd=Aa.value):Aa.selectedIndex=0);for(var e=0;e<t;e++){b=h[e];Ed&&(Fd||Nc)&&(kc[b]=q("canvas"),Va[b]=q("canvas"));Pa[b]=new Image;Pa[b].gotit=!1;Pa[b].frameNum=
b;Pa[b].onerror=function(){Qa++};Pa[b].onload=function(){Ed&&(ra=this.height,qa=this.width,Ia=ra,Ja=qa,Ed=!1,lh?Xf?E.setWindowSize(A.offsetWidth,A.offsetHeight):Td(Y,aa):Td(qa,ra),Ph&&("auto"==Bc&&(Bc=(B+r)/2,ee=-1),Ia/=Bc,Ja/=Bc,0>ee&&(ee=qa/2,Oh=ra/2),J=Math.round(ee-qa/2/Bc),L=Math.round(Oh-ra/2/Bc),G=C=Bc,1!=Bc&&(Ca=!1,E.toggleZooming()),yd=eg,zd=fg,Bd=hg,Ad=gg));Qc&&null!=Fc[this.frameNum]&&URL.revokeObjectURL(Fc[this.frameNum]);if(0<ff&&!Gd){wg.height=ra;wg.width=qa;me=wg.getContext("2d");me.clearRect(0,
0,Y,aa);for(var b=0;b<Wa.length;b++){for(var e=Wa[b].ctx.getImageData(0,0,Wa[b].width,Wa[b].height).data,K=me.getImageData(Wa[b].xmin,Wa[b].ymin,Wa[b].width,Wa[b].height),g=3;g<e.length;g+=4)0!=e[g]&&(K.data[g]=b+1);me.putImageData(K,Wa[b].xmin,Wa[b].ymin)}Ca||(nb=!0);G==gf&&(nb=!0);Gd=!0}if(Dc){Dc=!1;M=qb.getContext("2d");M.imageSmoothingEnabled=sd;M.imageSmoothingQuality=jh;M.fillStyle="blue";M.font="bold 20px Arial";f=xc.getContext("2d");f.imageSmoothingEnabled=sd;Xa=Array(t);Ee(t,!0);hf&&!Ka?
za(oa(ic)):za(oa(n));if(0<V)for(H=Array(t),g=0;g<t;g++)for(d=h[g],H[d]=Array(V),a=0;a<V;a++)if(void 0!=Hb[a+1]&&Hb[a+1]>=t&&(Hb[a+1]=t-1),void 0==Hb[a+1]||Hb[a+1]==d)H[d][a]=new Image,H[d][a].gotit=!1,H[d][a].frameNum=d,H[d][a].overlayNum=a,H[d][a].onerror=function(){Qa++},H[d][a].onload=function(){this.gotit=!0;var a=this.frameNum;Qa++;k();!Qe||this.height==ra&&this.width==qa?this.overlayNum==be-1&&(Xa[this.frameNum]=0):(this.gotit=!1,ea("Bad image size:"+this.src));if(Nc&&this.gotit&&this.overlayNum==
rb)kc[a].height=this.height,kc[a].width=this.width,ne=kc[a].getContext("2d"),ne.drawImage(this,0,0),vg[a]=ne.getImageData(0,0,this.width,this.height).data,Va[a].height=this.height,Va[a].width=this.width,$c[a]=Va[a].getContext("2d"),$c[a].drawImage(this,0,0),ef[a]=$c[a].getImageData(0,0,this.width,this.height),H[a][this.overlayNum]=null,H[a][this.overlayNum]=Va[a],H[a][this.overlayNum].gotit=!0;else if(this.gotit&&w[this.overlayNum].hotspotIndex){var b=q("canvas");b.height=this.height;b.width=this.width;
var c=b.getContext("2d");c.drawImage(this,0,0);var d=c.getImageData(0,0,this.width,this.height).data,h=d.length;var e=this.overlayNum;var g;for(g=0;g<h;g+=4)if(0!=d[g]){0==db&&(eb=[]);var K=d[g];var l=Math.floor(g/4/b.width);c=Math.floor(g/4%b.width);eb[db]=new kb(c,l,"spritefn",K,"pan",null,null,e,a,null,null);db++}}else if(this.gotit&&ph&&(!$f||$f&&th[this.overlayNum])){b=q("canvas");b.height=this.height;b.width=this.width;c=b.getContext("2d");c.drawImage(this,0,0);l=c.getImageData(0,0,this.width,
this.height);d=l.data;h=d.length;for(g=0;g<h;g+=4)d[g]===qh&&d[g+1]===rh&&d[g+2]===sh&&(d[g+3]=0);c.putImageData(l,0,0);H[a][this.overlayNum]=null;H[a][this.overlayNum]=b;H[a][this.overlayNum].gotit=!0}this.gotit&&Zf[this.overlayNum]?(xg.clearRect(0,0,Y,aa),xg.drawImage(H[a][this.overlayNum],0,0,Y,aa)):this.gotit&&nh[this.overlayNum]&&null!=O&&(b=q("canvas"),b.height=ra,b.width=qa,8>O.length&&(O[4]=0,O[5]=0,O[6]=qa,O[7]=ra),c=b.getContext("2d"),c.imageSmoothingEnabled=oh,c.drawImage(this,O[0],O[1],
O[2],O[3],O[4],O[5],O[6],O[7]),H[a][this.overlayNum]=null,H[a][this.overlayNum]=b,H[a][this.overlayNum].gotit=!0,null!=sb&&sb[this.overlayNum]&&(H[a][this.overlayNum].origImage=this));Qc&&null!=Gc[a][this.overlayNum]&&URL.revokeObjectURL(Gc[a][this.overlayNum]);if(void 0!=Hb[this.overlayNum+1]&&Hb[this.overlayNum+1]==a)for(b=0;b<t;b++)b!=a&&(H[b][this.overlayNum]=H[a][this.overlayNum],Qa++)},b=R[d][a],void 0==oe||oe[a]||(b+=c),H[d][a].src=Qc&&(Ue||Gc[d][a])?Gc[d][a]:b,jc++;if(null!=ad)for(lc=[],a=
0;a<ad.length;a++)lc[a]=new Image,lc[a].gotit=!1,lc[a].onerror=function(a){Qa++},lc[a].onload=function(a){a.currentTarget.gotit=!0;Qa++;k()},lc[a].src=ad[a],jc++;if(null!=Ra&&0<Ra.length)for(wa=[],a=0;a<Ra.length;a++)if(void 0!=Ra[a])for(wa[a]=[],d=0;d<Ra[a].length;d++)for(wa[a][d]=[],g=0;g<t;g++)Li(Ra[a][d],"/")?(b=R[g][a].lastIndexOf("/"),b=R[g][a].substring(0,b+1)+Ra[a][d]+R[g][a].substring(b+1),wa[a][d][g]=new Image,wa[a][d][g].gotit=!1,wa[a][d][g].onerror=function(a){Qa++;k()},wa[a][d][g].onload=
function(a){a.currentTarget.gotit=!0;Qa++;k()},wa[a][d][g].src=b,jc++):0===g?(wa[a][d][0]=new Image,wa[a][d][0].gotit=!1,wa[a][d][0].onerror=function(a){Qa++;k()},wa[a][d][0].onload=function(a){a.currentTarget.gotit=!0;Qa++;k()},wa[a][d][0].src=Ra[a][d],jc++):wa[a][d][g]=wa[a][d][0]}!Qe&&0!=this.height&&0!=this.width||this.height==ra&&this.width==qa?(this.gotit=!0,0==be&&(Xa[this.frameNum]=0)):(this.gotit=!1,ea("Image has invalid size:"+this.src));Fd&&this.gotit&&(g=this.frameNum,kc[g].height=this.height,
kc[g].width=this.width,ne=kc[g].getContext("2d"),ne.drawImage(this,0,0),vg[g]=ne.getImageData(0,0,this.width,this.height).data,Va[g].height=this.height,Va[g].width=this.width,$c[g]=Va[g].getContext("2d"),$c[g].drawImage(this,0,0),ef[g]=$c[g].getImageData(0,0,this.width,this.height),Pa[g]=null,Pa[g]=Va[g],Pa[g].gotit=!0);Qa++;k();Dh||E.resetZoom();bd=!0;Mi||(Mi=!0,Da=!1,Ni());F(Ka)};var g=va[b];void 0!=Hb[0]&&(g=Hb[0],g>=t&&(g=t-1),g=va[g]);dg||(g+=c);Pa[b].src=Qc&&(Ue||Fc[b])?Fc[b]:g;jc++}cd=Jb=!1;
da()}function ja(b,a,d,c,h,K){b.label_on=d;b.label_off=c;mb&&(b.className=K);d=null;c=e[a+"_labels"];null==c&&(c=e[a+"_label"]);null!=c&&(c=c.split(","),b.label_on=c[0].trim(),1<c.length&&(b.label_off=c[1].trim()),2<c.length&&(d="width:"+c[2].trim()+"px;"));null!=h&&(b.title=h);b.innerHTML=b.label_on;h=a=c=e[a+"_style"];null!=c&&(c=c.split("&"),1<c.length&&(a=c[0],h=c[1]));b.style_on=(null!=d?d:"")+Hc+a;b.style_off=(null!=d?d:"")+Hc+h;null!=b.style_on&&1<b.style_on.length?b.setAttribute("style",b.style_on):
(b.style_on=null,b.style_off=null)}function jb(b,a){Hc=e.buttons_style;null==Hc&&(Hc="");var d=null,c=null;d=a?e.controls_tooltip:e.bottom_controls_tooltip;var h=b.split(",");if(null!=d){var K=d.split(",");K.length!=h.length&&(ea("!!! Number of tooltips must equal number of controls!"),K=d=null)}var g={};for(b=0;b<h.length;g={$jscomp$loop$prop$sfbounds$11:g.$jscomp$loop$prop$sfbounds$11},b++){var l=null!=d?K[b]:null;var f=h[b].trim();c=f.indexOf("/");if(0===c||0===b){0===c&&(f=f.substring(1));D=q("div");
D.align=Yd;var k=e.controls_style;null!=k?D.setAttribute("style",k):D.setAttribute("style","position:relative;padding:2px;width:100%;");a?(A.insertBefore(D,Ua),jf=D,jf.id=kf+"-top-controls"):(k=e.bottom_controls_style,null!=k&&D.setAttribute("style",k),A.appendChild(D),lf=D,lf.id=kf+"-bottom-controls")}"enhance"==f.trim()&&(Aa=q("select"),c=e.enhance_style,null!=c&&Aa.setAttribute("style",c),null!=l&&(Aa.title=l),c=q("option"),c.innerHTML=void 0==e.enhance_prompt?"Pick Enhancement":e.enhance_prompt,
c.value=-1,Aa.add(c),Aa.addEventListener("change",E.doEnhance,!1),Fd=!Nc,Aa.disabled=Fd?!1:!0,D.appendChild(Aa));"custom"==f&&(Ze=q("button"),ja(Ze,"custom","On","Off",l,"custom"),D.appendChild(Ze));"anigif"==f&&(zb=q("button"),ja(zb,"anigif","Make GIF","Stop",l,"anigif"),zb.addEventListener("click",E.makeAniGIF,!1),D.appendChild(zb));"startstop"==f&&(Ib=q("button"),ja(Ib,"startstop","Start","Stop",l,"startstop start"),Ib.addEventListener("click",E.toggleIsLooping,!1),D.appendChild(Ib));"looprock"==
f&&(pe=q("button"),ja(pe,"looprock","Rock","Loop",l,"looprock rock"),mf=1,pe.addEventListener("click",E.toggleLoopRock,!1),D.appendChild(pe),y(e.start_rocking,"t")&&E.toggleLoopRock());"loophalt"==f&&(qe=q("button"),ja(qe,"loophalt","Halt","Loop",l,"loophalt halt"),Ab=!1,qe.addEventListener("click",E.toggleLoopHalt,!1),D.appendChild(qe));"extrap"==f&&(mc=q("button"),ja(mc,"extrap","Enable Extrap","Disable Extrap",l,"extrap"),mc.addEventListener("click",E.toggleExtrap,!1),D.appendChild(mc));y(f,"location")&&
(Hd=q("button"),ja(Hd,"location","Show Loc","Hide Loc",l,"location"),0<f.indexOf("/on")?(I(Hd,!1,"location off"),Id=!0,La.push(A.style.cursor),A.style.cursor=Ne):(Id=!1,A.style.cursor=La.pop()),Hd.addEventListener("click",function(){(Id=!Id)?(I(Hd,!1,"location off"),La.push(A.style.cursor),A.style.cursor=Ne):(I(Hd,!0,"location on"),A.style.cursor=La.pop());da()},!1),D.appendChild(Hd));"distance"==f&&(nc=q("button"),ja(nc,"distance","Show dist","Hide dist",l,"distance"),Xb=Le=!1,nc.addEventListener("click",
function(){(Xb=!Xb)?(I(nc,!1,"distance off"),La.push(A.style.cursor),A.style.cursor=Nf):(I(nc,!0,"distance on"),A.style.cursor=La.pop())},!1),D.appendChild(nc));y(f,"probe")&&(Jd=q("button"),ja(Jd,"probe","Show probe","Hide probe",l,"probe"),0<f.indexOf("/on")?(I(Jd,!1,"probe off"),Yb=!0,La.push(A.style.cursor),A.style.cursor=Oe):(Yb=!1,A.style.cursor=La.pop()),Jd.addEventListener("click",function(){(Yb=!Yb)?(I(Jd,!1,"probe off"),La.push(A.style.cursor),A.style.cursor=Oe):(I(Jd,!0,"probe on"),A.style.cursor=
La.pop())},!1),D.appendChild(Jd));"mark"==f&&(dd=q("button"),ja(dd,"mark","Mark","Stop Mark",l,"mark"),re=!0,dd.addEventListener("click",function(){Bb=!Bb;sa=[];Bb?(Kd=0,I(dd,!1,"mark off"),null!=Fa&&(Fa.disabled=!0),La.push(A.style.cursor),A.style.cursor=Of):(I(dd,!0,"mark on"),null!=Fa&&(Fa.disabled=!1),Kd=-1,A.style.cursor=La.pop());da()},!1),Oi=new lb("black","white",kg,"black",20,5,5),bi=new lb("black","white",kg,"black",20,5,5),D.appendChild(dd));"refresh"==f&&(Ye=q("button"),ja(Ye,"refresh",
"Refresh",null,l,"refresh"),Ye.addEventListener("click",E.reloadFOF,!1),D.appendChild(Ye));"restore"==f&&(yg=q("button"),ja(yg,"restore","Restore",null,l,"restore"),yg.addEventListener("click",function(a){for(a=0;a<w.length;a++)w[a].checked=w[a].restorableState;for(a=0;a<w.length;a++)Fb(a)},!1),D.appendChild(yg));"setframe"==f&&(g.$jscomp$loop$prop$sfbounds$11=function(){var a=parseInt(Ha.value,10)-1;if(nf||zg){for(var b=0;b<t;b++)Ea(b,0);of=0}else if(a!=ci&&Ag){if(0==of){for(b=0;b<t;b++)b>a?Ea(b,
0):Ea(b,-1);of=1}else{for(b=a+1;b<t;b++)Ea(b,-1);of=0;F(!0)}ci=a}},Ha=q("input"),mb&&(Ha.className="setframe"),Ha.type="range",Ha.min=1,Ha.max=100,Ha.value=1,pf="Frame #*",null!=l&&(Ha.title=l),k=e.setframe_label,null!=k&&(pf=k),se=q("span"),se.innerHTML=pf.replace("*",1),c="display:block;vertical-align:middle;"+e.setframe_style,Ha.setAttribute("style",c),c=q("span"),c.setAttribute("style","display:inline-block;vertical-align:top;"),se.setAttribute("style","display:block;vertical-align:middle;"+e.setframe_label_style),
c.appendChild(se),c.appendChild(Ha),D.appendChild(c),Ha.addEventListener("input",function(a){F(!1);a=parseInt(Ha.value,10)-1;0<=Xa[a]&&(za(a),se.innerHTML=pf.replace("*",n+1));U()},!1),of=0,ci=-1,Ha.addEventListener("pointerup",function(a){return function(b){b.stopPropagation();a.$jscomp$loop$prop$sfbounds$11()}}(g),!1),Ha.addEventListener("mouseup",function(a){return function(b){b.stopPropagation();a.$jscomp$loop$prop$sfbounds$11()}}(g),!1),Ha.addEventListener("change",function(a){return function(b){b.stopPropagation();
a.$jscomp$loop$prop$sfbounds$11()}}(g),!1),ug=!0);"framelabel"==f&&(Sa=q("button"),mb&&(Sa.className="framelabel"),Sa.innerHTML="",null!=l&&(Sa.title=l),fb=null,k=e.frame_labels,null!=k&&(fb=k.split(","),Sa.innerHTML=fb[0]),c=Hc+e.framelabel_style,null!=c&&Sa.setAttribute("style",c),c=e.framelabel_position,null!=c&&(c=c.split(","),Sa.style.position="absolute",Sa.style.left=A.offsetLeft+parseInt(c[0],10)+"px",Sa.style.top=A.offsetTop+parseInt(c[1],10)+"px"),D.appendChild(Sa));if("autorefresh"==f||
"autorefresh/off"==f)null!=Lc&&clearInterval(Lc),Tc=q("button"),ja(Tc,"autorefresh","Disable Auto Refresh","Enable Auto Refresh",l,"autorefresh"),Tc.addEventListener("click",E.toggleAutoRefresh,!1),ae=!1,D.appendChild(Tc),"autorefresh"==f?E.toggleAutoRefresh():I(Tc,!1,"autotoggle off");"backward"==f&&(vb=q("button"),ja(vb,"backward","<","<",l,"step back"),vb.addEventListener("click",function(){F(!1);Gb(-1);U()},!1),D.appendChild(vb));"forward"==f&&(wb=q("button"),ja(wb,"forward",">",">",l,"step forward"),
wb.addEventListener("click",function(){F(!1);Gb(1);U()},!1),D.appendChild(wb));if("step"==f){c=e.step_labels;var m=null!=c?c.split(","):["<",">"];vb=q("button");mb&&(vb.className="step back");vb.innerHTML=m[0];vb.addEventListener("click",function(){F(!1);Gb(-1);U()},!1);c=Hc+e.step_style;null!=c&&vb.setAttribute("style",c);null!=l&&(vb.title=l);D.appendChild(vb);wb=q("button");mb&&(wb.className="step forward");wb.innerHTML=m[1];wb.addEventListener("click",function(){F(!1);Gb(1);U()},!1);null!=c&&
wb.setAttribute("style",c);null!=l&&(wb.title=l);D.appendChild(wb)}"first"==f&&(Kb=q("button"),ja(Kb,"first","|<","|<",l,"firstlast first"),Kb.addEventListener("click",function(){F(!1);za(oa(0));U()},!1),D.appendChild(Kb));"last"==f&&(Lb=q("button"),ja(Lb,"last",">|",">|",l,"firstlast last"),Lb.addEventListener("click",function(){F(!1);za(oa(t-1));U()},!1),D.appendChild(Lb));"firstlast"==f&&(c=e.firstlast_labels,m=null!=c?c.split(","):["<<",">>"],Kb=q("button"),mb&&(Kb.className="firstlast"),Kb.innerHTML=
m[0],Kb.addEventListener("click",function(){F(!1);za(oa(0));U()},!1),c=Hc+e.firstlast_style,null!=c&&Kb.setAttribute("style",c),null!=l&&(Kb.title=l),D.appendChild(Kb),Lb=q("button"),mb&&(Lb.className="firstlast"),Lb.innerHTML=m[1],Lb.addEventListener("click",function(){F(!1);za(oa(t-1));U()},!1),null!=c&&Lb.setAttribute("style",c),null!=l&&(Lb.title=l),D.appendChild(Lb));"setspeed"==f?(Mb=q("input"),mb&&(Mb.className="setspeed"),Mb.type="range",Mb.min=cc,Mb.max=Sc,Mb.value=Sc-Ga,null!=l&&(Mb.title=
l),c="vertical-align:middle;"+e.setspeed_style,Mb.setAttribute("style",c),Mb.addEventListener("input",function(a){Ga=Sc-parseInt(Mb.value,10)+30;void 0!=Ld&&Ld(Ga);F(!0);U()},!1),D.appendChild(Mb)):"speed"==f&&(c=e.speed_labels,m=null!=c?c.split(","):["-","+"],dc=q("button"),mb&&(dc.className="speed slower"),dc.innerHTML=m[0],dc.addEventListener("click",function(){Ga+=jg;ec.disabled=!1;Ga>Sc&&(Ga=Sc,dc.disabled=!0);void 0!=Ld&&Ld(Ga)},!1),c=Hc+e.speed_style,null!=c&&dc.setAttribute("style",c),null!=
l&&(dc.title=l),D.appendChild(dc),ec=q("button"),mb&&(ec.className="speed faster"),ec.innerHTML=m[1],ec.addEventListener("click",function(){Ga-=jg;dc.disabled=!1;Ga<cc&&(Ga=cc,ec.disabled=!0);void 0!=Ld&&Ld(Ga)},!1),null!=c&&ec.setAttribute("style",c),null!=l&&(ec.title=l),D.appendChild(ec));"zoom"==f&&(Fa=q("button"),ja(Fa,"zoom","Zoom","Un-zoom",l,"zoom off"),Fa.addEventListener("click",E.toggleZooming,!1),D.appendChild(Fa),Ca=!1);if("annotate"==f){te=q("button");ja(te,"annotate","Annotate","Finished",
l,"annotate");na=q("div");na.setAttribute("style","position:absolute;box-sizing:content-box;height:120px;width:180px;top:20px;left:20px;z-index:15;visibility:hidden;background-color:lightgray;border-width:6px;border-style:solid;border-color:magenta;border-radius:25px;padding:10px;font:normal normal normal 16px Arial;color:black;");na.title="Drag this box around.  Select attributes, then go onto the image and click & drag";ed=fd=20;qf=Nb=!1;di=3;ei=11;gd=ue=0;x=[];na.style["touch-action"]="none";var Cc=
function(a){fd=a.clientX-gd;ed=a.clientY-ue;na.style.top=ed+"px";na.style.left=fd+"px"};na.addEventListener("mousedown",function(a){if(0!=a.clientX||0!=a.clientY)qf=!0,gd=a.clientX-fd,ue=a.clientY-ed},!1);na.addEventListener("mouseup",function(a){qf=!1},!1);na.addEventListener("mouseout",function(a){qf&&Cc(a)},!1);na.addEventListener("mousemove",function(a){qf&&Cc(a)},!1);window.PointerEvent?(na.addEventListener("pointerdown",function(a){"mouse"!=a.pointerType&&(gd=a.clientX-fd,ue=a.clientY-ed)},
!1),na.addEventListener("pointermove",function(a){"mouse"!=a.pointerType&&(0==gd&&(gd=a.clientX,ue=a.clientY),Cc(a))},!1)):na.addEventListener("touchmove",function(a){a=a.changedTouches[0];0==gd&&(gd=a.clientX,ue=a.clientY);Cc(a)},!1);te.addEventListener("click",function(){if(Nb=!Nb){x=[];fd=A.offsetLeft;ed=A.offsetTop;var a=e.annotate_position;null!=a&&(a=a.split(","),fd+=parseInt(a[0],10),ed+=parseInt(a[1],10));na.style.top=ed+"px";na.style.left=fd+"px";na.style.visibility="visible";I(te,!1,"annotate off");
Pi=Ca;Ca=!1;null!=Fa&&(Fa.disabled=!0)}else na.style.visibility="hidden",I(te,!0,"annotate on"),Ca=Pi,null!=Fa&&(Fa.disabled=!1);da()},!0);ve=fi("Color Black White Red Green Blue Yellow Orange Cyan Magenta".split(" "),"black black white red green blue yellow orange cyan magenta".split(" "),function(a){});Ic=fi("Width 1 2 3 4 5 6 7 8 10 12 14 16 18 20 24 28 32 36 38".split(" "),[1,1,2,3,4,5,6,7,8,10,12,14,16,18,20,24,28,32,36,38],function(a){6==we.selectedIndex?ei=Ic.selectedIndex:di=Ic.selectedIndex});
Ic.title="Select width or font size";we=fi("Type Arrow Circle Box Polygon Draw Text Line".split(" "),[-1,0,1,2,3,4,5,6],function(a){6==we.selectedIndex?(Ob.focus(),Ob.select(),Ic.selectedIndex=ei):Ic.selectedIndex=di;0==ve.selectedIndex&&(ve.selectedIndex=2)});c=q("button");c.style.width="70px";c.style.margin="5px";c.innerHTML="Erase";c.title="Erase last item";c.addEventListener("click",function(){0<x.length&&(x.pop(),da())},!1);Ob=q("input");Ob.type="text";Ob.style.width="150px";Ob.style.margin=
"5px";Ob.title="Enter your text here, then click where you want it";Ob.value="Text input";m=e.annotate_defaults;null!=m&&(m=m.split(","),we.selectedIndex=parseInt(m[0],10),1<m.length&&(ve.selectedIndex=parseInt(m[1],10)),2<m.length&&(Ic.selectedIndex=parseInt(m[2],10)),3<m.length&&(Ob.value=m[3].trim()));m=q("div");m.innerHTML="Annotation Tools";var p=q("div");p.appendChild(we);p.appendChild(ve);var u=q("div");u.appendChild(Ic);u.appendChild(c);c=q("div");c.appendChild(Ob);na.appendChild(m);na.appendChild(p);
na.appendChild(u);na.appendChild(c);D.appendChild(te);A.appendChild(na)}"saveall"==f&&(Bg=q("button"),ja(Bg,"saveall","SaveAll","SaveAll",l,"saveall"),gi=e.saveall_prompt,oc=e.saveall_filename,c=e.saveall_list,hi=null==c?["0"]:c.split(","),Bg.addEventListener("click",function(){for(var a=0;a<hi.length;a++)for(var b=parseInt(hi[a],10),c=0;c<va.length;c++){0===c&&null!=gi&&(oc=window.prompt(gi,oc),null!=oc&&1>oc.length&&(oc=null));var d=null==oc?"":-1!=oc.indexOf("#")?oc.replace("#",c.toString()):oc+
c;var h=document.createElement("a");h.href=0==b?va[c]:R[c][b-1];h.download=d;d=new MouseEvent("click");h.dispatchEvent(d)}},!1),D.appendChild(Bg));if("capture"==f){Cg=q("button");ja(Cg,"capture","Capture","Capture",l,"capture");var z=e.capture_prompt;Dg=e.capture_filename;null==Dg&&(Dg="haimage.png");Cg.addEventListener("click",function(){var a=Dg;if(null!=z&&(a=window.prompt(z,a),null==a))return;var b=q("canvas");b.height=qb.height;b.width=qb.width;var c=b.getContext("2d");re=!1;da();c.drawImage(qb,
0,0);c.drawImage(xc,0,0);re=!0;b.toBlob(function(b){var c=URL.createObjectURL(b),d=document.createElement("a");d.href=c;d.download=a;c=new MouseEvent("click");d.dispatchEvent(c);setTimeout(function(){URL.revokeObjectURL(b)},3E4)})},!1);D.appendChild(Cg)}"show"==f&&(Eg=q("button"),ja(Eg,"show","Show","Show",l,"show"),Fg=e.show_prompt,Qi=e.show_image_file,null==Fg&&(Fg="Right-click to save or copy the image<br> <font size='-1'>(to save in some browsers, you may need to first 'Open in New Tab')</font> <p>"),
Eg.addEventListener("click",function(){if(Qi)window.open(va[n]);else{var a=qb.toDataURL("image/png;base64;");var b=window.open();b.document.write(Fg+"<img src="+a+"></img>")}},!1),D.appendChild(Eg));"toggle"==f&&(Xa=[],c=e.toggle_size,null!=c?(c=c.split(","),Md=parseInt(c[0],10),rf=parseInt(c[1],10),sf=parseInt(c[2],10)):(rf=Md=10,sf=3),ii="red",ji="blue",ki="orange",li=!1,y(e.toggle_layout_width,"t")&&(li=!0),c=e.toggle_colors,null!=c&&(c=c.split(","),ji=c[0].trim(),ii=c[1].trim(),ki=c[2].trim()),
Cb=q("div"),Cb.setAttribute("style","position:relative;border:0px;margin:0px;padding:0px;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; -webkit-tap-heightlight-color:transparent;"),Cb.style.backgroundColor=D.style.backgroundColor,Cb.align=Yd,Gg=new PEvs(Cb,E.togdown,E.togup,null,E.togdown,null,null),Gg.setHysteresis(0),hd=q("canvas"),hd.height=2*rf,Hg=hd.getContext("2d"),Cb.appendChild(hd),a?A.insertBefore(Cb,Ua):A.appendChild(Cb),c=e.toggle_onoff,tf=null,
null!=c&&(tf=c.split(",")),Ig=!0,null!=l&&(Cb.title=l));if("overlay"==f||y(f,"menu")){0==Ba&&(w=[]);m=e.overlay_tooltip;c=null;null!=m&&(c=m.split(","));m=e.overlay_radio;p=null;null!=m&&(p=m.split(","));var r=e.overlay_menu_links;u=null;null!=r&&(u=r.split(","));var B=e.overlay_labels_color;r=null;null!=B&&(r=B.split(","));var C=e.overlay_smoothing;B=null;null!=C&&(B=C.split(","));uf=[];var G=C=Zc=!1;y(f,"menu")&&(Zc=!0,0<f.indexOf("/on")&&(C=!0),0<f.indexOf("/always")&&(G=!0));0==Ba&&(oe=[]);var v=
e.overlay_caching;f=null;null==v&&(v=e.overlay_static);null!=v&&(f=v.split(","));var M=!0;null!=e.overlay_nonewdiv&&(M=!1);Ba++;for(v=0;v<ac.length;v++){var Q=ac[v].trim();uf[v]=sd;null!=B&&(y(B[v],"t")||y(B[v],"y")?uf[v]=!0:uf[v]=!1);if(0==v||0==Q.indexOf("/")){0==Q.indexOf("/")&&(Q=Q.substr(1));if(Zc){gb[Ba]=q("div");gb[Ba].dropalways=G;var J="menu"+Ba+"_labels_style";gb[Ba].setAttribute("style","text-align:left;display:block;position:absolute;border-style:solid;border-width:2px;background:#ffffff;z-index:99;visibility:"+
(C||G?"visible":"hidden")+";"+(void 0==e[J]?e.overlay_labels_style:e[J]));Jg++}else M?(Pb=q("div"),Jg++,Pb.align="center",a?A.insertBefore(Pb,Ua):A.appendChild(Pb)):(Pb=q("span"),D.appendChild(Pb));k=e.overlay_labels_style;Zc||null==k||Pb.setAttribute("style",k)}if(null==u||null!=u&&u[v]==Ba){J=!1;-1!=Q.indexOf("<a href=")&&(J=!0);var L=!1,H=!1,N=!1,P=!1;k=Q.length;J||(0<Q.indexOf("/on")&&Q.indexOf("/on")==k-3&&(L=!0),0<Q.indexOf("/always")&&Q.indexOf("/always")==k-7&&(H=L=!0),0<Q.indexOf("/hidden")&&
(N=!0),0<Q.indexOf("/hotspots")&&(P=!0),-1!=Q.indexOf("/")&&(Q=Q.substr(0,Q.indexOf("/"))));null!=f?y(f[v],"y")||y(f[v],"t")?oe[v]=!0:oe[v]=!1:oe[v]=!0;w[v]=q("input");w[v].type="checkbox";w[v].value=Q;w[v].id=kf+Q;w[v].showMe=!(H&N)&!P;var O="vertical-align:middle;";k=e.checkbox_style;null!=k&&(O+=k);w[v].setAttribute("style",O);w[v].checked=L;w[v].restorableState=L;w[v].name=0;w[v].hotspotIndex=P;null!=Aa&&v==rb&&w[v].checked&&(Aa.disabled=!1);null!=zc&&!zc[v]&&L&&(td=!1);w[v].addEventListener("click",
E.overClick,!1);null!=m&&(k=p[v].indexOf("/"),-1!=k&&(w[v].name=p[v].substr(k+1).trim()),y(p[v],"t")&&(w[v].type="radio",-1==k&&(w[v].name="all")));w[v].isGhost=!0;H||N||(null!=c&&(w[v].title=c[v]),H=q("label"),H.htmlFor=kf+Q,null!=c&&(H.title=c[v]),H.innerHTML=Q,H.name=w[v].name,Q="vertical-align:middle;",null!=r&&(Q=Q+"color:"+r[v]+";"),H.setAttribute("style",Q),Q=q("span"),J||Q.appendChild(w[v]),Q.appendChild(H),Zc?(Q.setAttribute("style","display:block;margin-right:5px;"),gb[Ba].appendChild(Q)):
(J="10",null!=Re&&(J=10+Re[v]),Q.setAttribute("style","margin-left:"+J+"px;"),Pb.appendChild(Q)),w[v].isGhost=!1)}}Zc&&(id[Ba]=q("button"),ja(id[Ba],"menu"+Ba,"Show Overlay Menu","Hide Menu",l,"menu off"),id[Ba].menuInx=Ba,id[Ba].addEventListener("click",function(a){if("hidden"===gb[this.menuInx].style.visibility){for(a=1;a<gb.length;a++)gb[a].dropalways||"visible"!=gb[a].style.visibility||(gb[id[a].menuInx].style.visibility="hidden",I(id[a],!0,"menu off"));gb[this.menuInx].style.visibility="visible";
I(this,!1,"menu on")}else gb[this.menuInx].style.visibility="hidden",I(this,!0,"menu off")},!1),gb[Ba].dropalways||D.appendChild(id[Ba]),A.insertBefore(gb[Ba],Ua));if(null==bc)for(bc=Array(ac.length),v=0;v<ac.length;v++)bc[v]=0;else for(v=0;v<ac.length;v++)Fb(v)}}Ka=!0;hf=null;k=e.start_looping;null!=k&&(c=k.split(","),y(c[0],"f")&&(Ka=!1),1<c.length&&(ic=parseInt(c[1],10)-1,isNaN(ic)&&(ic=0),n=ic),2<c.length&&(y(c[2],"t")&&(hf=!0),y(c[2],"f")&&(hf=!1)));F(Ka)}function Fb(b){var a;if(0>bc[b]){var d=
!1;for(a=0;a<ac.length;a++)bc[a]!=-bc[b]||d||(d=w[a].checked);w[b].checked=d}}function Tb(b){0==db&&(eb=[]);b=b.substr(b.indexOf("=")+1).trim().split(",");var a=b[4].trim(),d=b[4].indexOf("/"),c=b[4].indexOf("?"),h=-1,e=-1;-1!=d&&(h=parseInt(b[4].substring(d+1),10)-1,a=a.substring(0,d));-1!=c&&(e=parseInt(b[4].substring(c+1),10)-1,c<d||-1==d)&&(a=a.substring(0,c));eb[db]=new kb(parseInt(b[0].trim(),10),parseInt(b[1].trim(),10),b[2].trim(),b[3].trim(),a.toLowerCase(),b[5].trim().toLowerCase(),b[6].trim(),
h,e,8<=b.length?b[7].trim():null,9==b.length?b[8].trim():null);db+=1}function Ud(b){0==ff&&(Wa=[],ta=null);var a=b.substr(b.indexOf("=")+1).trim().split("(");b=a[0].split(",");var d=b[0].trim();0==d.indexOf("0x")&&(d="#"+d.substring(2));Wa[ff]=new vc(d,b[1].trim(),b[2].trim(),b[3].trim(),a[1].trim());ff+=1}function Ma(b){0==yb&&(Oa=[]);b=b.substr(b.indexOf("=")+1).trim().split(",");Oa[yb]=new Ub(parseInt(b[0],10)-1,parseInt(b[1],16),b[2].trim(),b[3].trim(),5==b.length?b[4].trim():"Click for details");
yb+=1}function vc(b,a,d,c,h){this.color=b;this.alpha=1;7<this.color.length&&(this.alpha=parseInt(this.color.substring(7),16)/255,this.color=this.color.substring(0,7),.1>this.alpha&&(this.alpha=.1));this.action=a;this.value=d;this.tip=c;this.poly=h;b=h.split(",");this.xy=[];this.ymin=this.xmin=9999;for(a=this.ymax=this.xmax=0;a<b.length;a++)this.xy[a]=parseInt(b[a].trim(),10),0==a%2?(this.xy[a]<this.xmin&&(this.xmin=this.xy[a]),this.xy[a]>this.xmax&&(this.xmax=this.xy[a])):(this.xy[a]<this.ymin&&(this.ymin=
this.xy[a]),this.xy[a]>this.ymax&&(this.ymax=this.xy[a]));this.height=this.ymax-this.ymin+1;this.width=this.xmax-this.xmin+1;this.can=q("canvas");this.can.height=this.height;this.can.width=this.width;this.ctx=this.can.getContext("2d");this.ctx.imageSmoothingEnabled=!1;this.ctx.fillStyle=this.color;this.ctx.globalAlpha=this.alpha;this.ctx.beginPath();this.ctx.moveTo(this.xy[0]-this.xmin,this.xy[1]-this.ymin);for(a=2;a<this.xy.length;a+=2)this.ctx.lineTo(this.xy[a]-this.xmin,this.xy[a+1]-this.ymin);
this.ctx.closePath();this.ctx.fill()}function Ub(b,a,d,c,h){this.overlay=b;this.color=a;this.action=d;this.value=c;this.tip=h}function kb(b,a,d,c,h,e,f,l,k,m,q){this.x0=b;this.y0=a;this.icon=null;this.isIcon=!1;if("icon"==d)this.icon=new Image,this.icon.hotspot=this,Kg=!0,this.icon.onload=function(a){this.gotit=!0;this.hotspot.x1=this.hotspot.x0+this.width;this.hotspot.y1=this.hotspot.y0+this.height;this.hotspot.width=this.width;this.hotspot.height=this.height;this.hotspot.w2=this.width/2;this.hotspot.h2=
this.height/2;this.hotspot.isIcon=!0;this.hotspot.origX=0;this.hotspot.origY=0},this.y1=this.x1=-1,this.zoomme=this.fromfile=this.anim=!1,this.icon.gotit=!1,this.icon.src=c.trim();else if("sprite"==d||"spritefn"===d){this.x0=b;this.y0=a;this.inx=parseInt(c,10)-1;xe=!1;kh?null!=ma&&(-1!=Xc?this.inx>=Xc&&this.inx<=Xc+ma.length&&(xe=!0):"spritefn"===d&&(xe=!0)):xe=!0;if(xe){-1!=Xc&&(this.inx-=Xc);if(this.inx>=ma.length)return null;this.x1=ma[this.inx].width+b;this.y1=ma[this.inx].height+a;this.width=
ma[this.inx].width;this.height=ma[this.inx].height;this.w2=this.width/2;this.h2=this.height/2;this.origY=this.origX=0;this.icon=ma[this.inx].cloneNode();this.anim=ma[this.inx].anim;this.fromfile=ma[this.inx].fromfile;this.zoomme=ma[this.inx].zoomme;this.anim&&(this.icon.setAttribute("style","position:absolute;top:0px;left:0px;visibility:hidden;"),Ec.appendChild(this.icon))}else this.x1=Zb[this.inx]+b,this.y1=$b[this.inx]+a,this.width=Zb[this.inx],this.height=$b[this.inx],this.w2=Zb[this.inx]/2,this.h2=
$b[this.inx]/2,this.origX=Uf[this.inx],this.origY=Vf[this.inx],this.icon=Tf,this.zoomme=this.fromfile=this.anim=!1;Kg=this.isIcon=!0;this.icon.gotit=!0}else this.width=parseInt(d,10),this.height=parseInt(c,10),this.w2=this.width/2,this.h2=this.height/2,Sf&&(this.x0=b-this.w2,this.y0=a-this.h2),this.x1=this.width+this.x0,this.y1=this.height+this.y0;this.pan=h;this.isPan=!1;"pan"===this.pan&&(this.isPan=!0);this.action=e;this.value=f;this.overlay=l;this.frame=k;this.tip=m;this.target=q}function Vb(){if(Nd&&
!Dd){ba=-1;for(var b=0;b<pa.length;b++)G>=pa[b]&&(ba=b)}}function pb(){null!=gc?xa=gc.toLatLon(ha,ia):null!=og?(xa[0]=og+(Ji-og)*ia/ra,xa[1]=pg+(qg-pg)*ha/qa):(xa[0]=Math.round(ha),xa[1]=Math.round(ia))}function md(b,a){"popup"==b.action?(null!=Lg&&Lg.close(),Lg=window.open("","HAniSPopup","scrollbars=yes,width="+Lh+",height="+Kh),Lg.document.write(Jh+b.value+"</div>")):"link"==b.action?(a=b.value,pb(),a=a.replace("%LATITUDE%",xa[0].toFixed(4)),a=a.replace("%LONGITUDE%",xa[1].toFixed(4)),a=a.replace("%FRAMENUMBER%",
n+1),a=a.replace("%FRAMENUMBERINDEX%",Yf[n]),window.open(a,b.target?b.target:"_blank","")):"fof"==b.action&&(fa=Bh,E.resetZoom(),E.newFOF(b.value,!0),If(a))}function nd(){var b=Gh?Ad/G:0;J+b<Ad&&(J=Ad-b);b=Hh?Bd/G:0;J+Ja-b>qa-Bd&&(J=qa-Ja+b-Bd);b=Fh?zd/C:0;L+b<zd&&(L=zd-b);b=Eh?yd/C:0;L+Ia-b>ra-yd&&(L=ra-Ia-yd+b);L=Math.round(L);J=Math.round(J)}function Vd(b){var a=!1;b?Dd?(ba--,0>ba?a=!0:(G=pa[ba],C=pa[ba])):(G-=.1*Cd/B,C-=.1*Cd/r):Dd?(ba++,ba>=pa.length?(ba--,ig&&(a=!0)):(G=pa[ba],C=pa[ba])):(!ig||
G!==Rc&&C!==Rc||(a=!0),G+=.1*Cd/B,C+=.1*Cd/r,G>Rc&&(G=Rc),C>Rc&&(C=Rc));a||G<=gf||C<=vf?(G=gf,C=vf,ba=-1,ha=z,ia=p,L=J=0,Ia=ra,Ja=qa,Ad=Bd=zd=yd=0,Gd&&(nb=!0)):(yd=eg,zd=fg,Bd=hg,Ad=gg,J=ha-z/G,L=ia-p/C,Ia=Math.floor(ra/C),Ja=Math.floor(qa/G),nd(),Gd&&(nb=!1));Vb();void 0!=Od&&Od(["zoom",G,C,ha,ia,z,p,J,L,Ja,Ia])}function Wb(){wf=0;Qb=Array(2);Db=Array(2);Pd=Array(2);Ya=0;wd=null;za(oa(0))}function F(b){Da=!b;E.toggleIsLooping()}function Wd(b,a,d,c,h,e){je.clearRect(0,0,Y,aa);je.imageSmoothingEnabled=
sd;M.imageSmoothingEnabled=sd;je.drawImage(b,a,d,c,h,0,0,Y,aa);mi=je.getImageData(0,0,Y,aa);jd=mi.data;Mg=ab[e];Ng=bb[e];Og=cb[e];Pg=ge[e];Ri=4*Y*aa;for(pc=0;pc<Ri;pc+=4)hb=jd[pc],hb===jd[pc+1]&&hb===jd[pc+2]&&(jd[pc]=Mg[hb],jd[pc+1]=Ng[hb],jd[pc+2]=Og[hb],jd[pc+3]=Pg[hb]);je.putImageData(mi,0,0);M.drawImage(af,0,0,Y,aa)}function I(b,a,d){null!=b&&(a?(null!=b.style_on&&b.setAttribute("style",b.style_on),b.innerHTML=b.label_on):(null!=b.style_off&&b.setAttribute("style",b.style_off),b.innerHTML=b.label_off),
mb&&(b.className=d))}function Ea(b,a){if(!(b>=t)&&(-2==Xa[b]&&(a=-2),Xa[b]=a,ug&&1==a&&(Ha.value=b+1,se.innerHTML=pf.replace("*",b+1)),Ig)){b=ni+b*(Md+sf);var d=ki;0==a?d=ji:-1==a?d=ii:-2==a&&(d=mh);Hg.fillStyle=d;Hg.fillRect(b,rf/2,Md,rf)}}function Ee(b,a){Ig&&(hd.width=li?parseInt(A.style.width,10):Y,Hg.clearRect(0,0,hd.width,hd.height),ni=hd.width/2-b*(Md+sf)/2);for(var d=0;d<b;d++)a?-1!=be?Ea(d,-2):null!=tf&&"n"==tf[d].toLowerCase().trim()?Ea(d,-1):Ea(d,0):Ea(d,Xa[d])}function za(b){Ea(n,0);n=
b;Ea(n,1);null!=Sa&&null!=fb&&null!=fb[n]&&(Sa.innerHTML=fb[n]);void 0!=xf&&xf(n)}function oa(b){b>=t&&(b=t-1);if(0<=Xa[b])return b;var a=-1,d=b;0==d&&(a=1);for(var c=0;c<t-1;c++)if(d+=a,0<=Xa[d])return d;return b}function Gb(b){Ea(n,0);var a=b;do 0<a?(a=oa(t-1),n+=1,n>a&&(ye&&Da?(n=a,b=-b,Ab&&F(!1)):Ab?(n=a,F(!1)):n=oa(0))):(a=oa(0),--n,n<a&&(ye&&Da?(n=a,b=-b,Ab&&F(!1)):Ab?(n=a,F(!1)):n=oa(t-1))),a=b;while(0>Xa[n]);Ab=yf;void 0!=xf&&xf(n);mf=a;Ea(n,1);null!=Sa&&null!=fb&&null!=fb[n]&&(Sa.innerHTML=
fb[n])}function lb(b,a,d,c,h,e,f){this.bg=b;null!=b&&0==this.bg.indexOf("0x")&&(this.bg="#"+this.bg.substring(2));this.fg=a;null!=a&&0==this.fg.indexOf("0x")&&(this.fg="#"+this.fg.substring(2));this.font=d;this.fontHeight=Math.round(1.1*parseInt(d,10));this.scolor=c;null!=c&&0==this.scolor.indexOf("0x")&&(this.scolor="#"+this.scolor.substring(2));this.sblur=h;this.sxoff=e;this.syoff=f}function Ta(b,a,d,c,h){f.globalAlpha=1;f.font=b.font;var e=b.fontHeight;d=d-e-6;var g=f.measureText(c).width;1==h&&
(a-=g);0==h&&(a-=g/2);5>a&&(a=5);5>d&&(d=5);d+e+3>aa&&(d=aa-e-6);a+3+g>Y&&(a=Y-g-6);f.save();f.beginPath();f.fillStyle=b.bg;null!=b.scolor&&(f.shadowColor=b.scolor,f.shadowBlur=b.sblur,f.shadowOffsetX=b.sxoff,f.shadowOffsetY=b.syoff);zf=a-3;Qg=d;oi=g+6;Rg=e+6;f.fillRect(zf,Qg,oi,Rg);f.closePath();f.restore();f.textBaseline="bottom";f.fillStyle=b.fg;f.fillText(c,a,d+e+3)}function da(){f.clearRect(0,0,Y,aa);Sg=!1;if(ib){f.beginPath();f.lineWidth=2;f.strokeStyle="white";var b=Ya;1<b&&(b=2);for(var a=
0;a<b;a++)1<Ya&&(f.moveTo(Qb[0]/B,Db[0]/r),f.lineTo(Qb[1]/B,Db[1]/r)),f.moveTo(Qb[a]/B-15,Db[a]/r),f.lineTo(Qb[a]/B+15,Db[a]/r),f.moveTo(Qb[a]/B,Db[a]/r-15),f.lineTo(Qb[a]/B,Db[a]/r+15);f.closePath();f.stroke();if(3==Ya){var d=W,c=S;f.moveTo(d,c);f.fillStyle=Ac;f.fillRect(d-2,c-2,5,5);b=Qd;a=Math.round(d+Af/B*ze*(Qd-Pd[1]));for(var h=Math.round(c+Ae/r*ze*(Qd-Pd[1])),e=0;300>e;e++){f.beginPath();f.lineWidth=1;f.strokeStyle=Ac;f.moveTo(d,c);f.lineTo(a,h);f.stroke();f.beginPath();f.lineWidth=3;f.rect(a-
2,h-2,5,5);f.stroke();if(3>a||a+3>Y||3>h||h+3>aa)break;c=hc+b;c=100*Math.floor(c/60)+c%60;c%=2400;wh?(d="AM",1200<=c?(1300<=c&&(c-=1200),d="PM"):100>c&&(c+=1200),d=Math.floor(c/100)+":"+Math.floor(Math.floor(c%100)/10)+Math.floor(c%10)+" "+d):(d=c+" ",1E3>c&&(d="0"+c),100>c&&(d="00"+c),10>c&&(d="000"+c));c=0;Math.abs(Tg)<vd+5&&(c=45*Rb);var g=h;0>pi*Tg&&0==c&&(g=h+vd);f.font=de;d=d+" "+vh;var l=f.measureText(d).width;f.fillStyle=ce;0===c?(f.fillRect(a+2,g-vd-2+c,l+4,vd+3),f.fillStyle=Ac,f.textBaseline=
"bottom",f.fillText(d,a+5,g)):(f.save(),f.translate(a+5,h),f.rotate(c),f.fillRect(2,-2,l+4,vd+3),f.fillStyle=Ac,f.textBaseline="bottom",f.fillText(d,5,vd),f.restore());d=a;c=h;a=Math.round(d+ze*pi);h=Math.round(c+ze*Tg);b+=ca}}null!=wd&&Ta(ag,Si,Ti,wd,0);re&&(Ta(Ei,9999,Rh,Qh[wf],0),qi=zf,ri=Qg,si=Qg+Rg)}if(Bb){re&&(0==Kd?Ta(bi,9999,10,We[0],0):(Ta(Oi,10,10,We[1],0),Ui=zf+oi,Ta(bi,9999,10,We[2],0)),Vi=zf,Wi=Rg);f.beginPath();f.lineWidth=2;f.strokeStyle=Sh;for(b=0;b<sa.length;b+=2)0==b?f.moveTo(sa[b]/
B,sa[b+1]/r):f.lineTo(sa[b]/B,sa[b+1]/r);Xe&4<sa.length&&f.lineTo(sa[0]/B,sa[1]/r);f.stroke();for(b=0;b<sa.length;b+=2)f.beginPath(),f.rect(sa[b]/B-2,sa[b+1]/r-2,5,5),f.stroke()}if(Nb)for(b=0;b<x.length;b++){d=x[b].type;f.beginPath();f.strokeStyle=x[b].color;f.lineWidth=x[b].width;if("0"==d||"6"==d)a=Math.atan2(x[b].xe-x[b].x,x[b].ye-x[b].y),h=x[b].x+x[b].width*Math.sin(a),e=x[b].y+x[b].width*Math.cos(a),f.beginPath(),f.moveTo(h,e),f.lineTo(x[b].xe,x[b].ye),"0"==d&&(d=12+x[b].width/5,c=30*Rb,f.moveTo(h+
d*Math.sin(a-c),e+d*Math.cos(a-c)),f.lineTo(h,e),f.lineTo(h+d*Math.sin(a+c),e+d*Math.cos(a+c)));else if("1"==d)f.arc(x[b].x,x[b].y,x[b].size,0,2*Math.PI);else if("2"==d)f.rect(x[b].x-x[b].size,x[b].y-x[b].size,2*x[b].size,2*x[b].size);else if("3"==d){f.moveTo(x[b].xp[0],x[b].yp[0]);for(h=1;h<x[b].xp.length;h++)f.lineTo(x[b].xp[h],x[b].yp[h]);f.lineTo(x[b].xp[0],x[b].yp[0])}else if("4"==d)for(f.moveTo(x[b].xp[0],x[b].yp[0]),h=1;h<x[b].xp.length;h++)f.lineTo(x[b].xp[h],x[b].yp[h]);else"5"==d&&(f.fillStyle=
x[b].color,f.font=x[b].width+"pt arial",a=f.measureText(x[b].text).width,f.fillText(x[b].text,x[b].x-a/2,x[b].y+x[b].width/2));f.stroke()}cd&&(W=la.getX(),z=W*B,ha=J+z/G,S=la.getY(),p=S*r,ia=L+p/C,f.beginPath(),f.strokeStyle=eh,f.lineWidth=3,f.moveTo(Ug/B,Vg/r),f.lineTo(Bf/B,Cf/r),f.stroke(),f.closePath(),pb(),qd?(kd=Rb*Rd[0],ld=Rb*xa[0],Be=Rb*Rd[1],Ce=Rb*xa[1],Wg=Math.pow(Math.sin((ld-kd)/2),2)+Math.cos(kd)*Math.cos(ld)*Math.pow(Math.sin((Ce-Be)/2),2),Wg=12742.02*Me*Math.asin(Math.min(1,Math.sqrt(Wg))),
b=" "+Wg.toFixed(Pf)+" "+rd+" ",Zd&&(a=y(Zd,"t")?(Math.atan2(Math.sin(Ce-Be)*Math.cos(ld),Math.cos(kd)*Math.sin(ld)-Math.sin(kd)*Math.cos(ld)*Math.cos(Ce-Be))/Rb+360)%360:(Math.atan2(Math.sin(Be-Ce)*Math.cos(kd),Math.cos(ld)*Math.sin(kd)-Math.sin(ld)*Math.cos(kd)*Math.cos(Be-Ce))/Rb+360)%360,b=b+" ("+a.toFixed(0)+"\u00b0)")):(a=Kc*(Rd[0]-xa[0]),h=Ke*(Rd[1]-xa[1]),b=" "+Math.sqrt(a*a+h*h).toFixed(Pf)+" "+rd+" ",Zd&&(a=Math.atan2(-a,h)/Rb,0>a&&(a+=360),y(Zd,"f")&&(a+=180),360<a&&(a-=360),b=b+" ("+a.toFixed(0)+
"\u00b0)")),Ta(Ci,Bf/B+10,Cf/r,b,-1));Jb&&Ta(Ah,ti,ui,vi,-1);if(Yb||Id||Pe)if(W=la.getX(),z=W*B,S=la.getY(),p=S*r,0<=z&&0<=p){ha=J+z/G;ia=L+p/C;if(Id){pb();b=xa[1];qd&&180<b&&(b-=360);qd&&360<b&&(b-=360);Xi=He+xa[0].toFixed(Mf)+"  "+Ie+b.toFixed(Mf);b=S;if(cd||Jb)b=S+dh.fontHeight+6;Ta(dh,W+10,b,Xi,-1)}if(Pe)for(f.fillStyle=ih,b=0;b<db;b++)if(a=eb[b],a.isPan){if(ha>=a.x0&&ha<=a.x1&&ia>=a.y0&&ia<=a.y1){(-1===a.overlay||w[a.overlay].checked)&&f.fillRect((a.x0-J)*G,(a.y0-L)*C,a.width*G,a.height*C);break}}else if(z>
a.x0&&z<a.x1&&p>a.y0&&p<a.y1){(-1===a.overlay||w[a.overlay].checked)&&f.fillRect(a.x0,a.y0,a.width,a.height);break}if(Yb&&Uc&&bd)if(ha=Math.round(ha),ia=Math.round(ia),Qf)Za.clearRect(0,0,1,1),Za.drawImage(Pa[n],ha,ia,1,1,0,0,1,1),Z=Za.getImageData(0,0,1,1).data,T=0,Xd(!1);else for(a=0;a<V;a++)if(b=V-a-1,H[n][b].gotit&&w[b].checked&&(b==rb||null!=yc[b]&&0<=yc[b])){Za.clearRect(0,0,1,1);b==rb?Za.drawImage(kc[n],ha,ia,1,1,0,0,1,1):Za.drawImage(H[n][b],ha,ia,1,1,0,0,1,1);Z=Za.getImageData(0,0,1,1).data;
T=yc[b];null!=T&&Xd(b==rb||Wh);break}}!nb||ib||Xb||Yb||null==ta||(f.drawImage(ta.can,0,0,ta.width,ta.height,ta.xmin/B,ta.ymin/r,ta.width/B,ta.height/r),Ta(Ah,(ta.xmin+ta.xmax)/2/B,(ta.ymin+ta.ymax)/2/r,ta.tip,0),Sg=!0)}function Xd(b){Df=999;qc=fh;var a=xb[T].length-1;if(0==Z[3])qc=$e[T];else{if(gh)rc=Z[0];else if(b)Xg=0,rc=Z[0],Df=0;else for(var d=0;d<a;d++)sc[0]=Z[0]-ab[T][d],0>sc[0]*(ab[T][d+1]-Z[0]-1)||(sc[1]=Z[1]-bb[T][d],0>sc[1]*(bb[T][d+1]-Z[1]-1)||(sc[2]=Z[2]-cb[T][d],0>sc[2]*(cb[T][d+1]-Z[2]-
1)||(Sd=ng[T][d],Yg=sc[Sd]/Yc[T][d][Sd],wi=Math.abs(sc[xi[Sd]]-Yg*Yc[T][d][xi[Sd]])+Math.abs(sc[yi[Sd]]-Yg*Yc[T][d][yi[Sd]]),wi<Df&&(rc=d,Df=wi,Xg=Yg))));if(999>Df)qc=Wc[T][rc],-1!=fc[T][rc]&&(zi=xb[T][rc],0!=Xg&&(zi+=Xg*(xb[T][rc+1]-xb[T][rc])),qc=qc+" "+zi.toFixed(fc[T][rc])+" "+Vc[T][rc]);else if(b||0<$d){var c=-1;if(b)c=Z[0];else for(d=0;d<a;d++)if(Math.abs(Z[0]-ab[T][d])<$d&&Math.abs(Z[1]-bb[T][d])<$d&&Math.abs(Z[2]-cb[T][d])<$d){c=d;break}-1!=c&&(qc=Wc[T][c],-1!=fc[T][c]&&(qc=qc+" "+xb[T][c].toFixed(fc[T][c])+
" "+Vc[T][c]))}}"hide"!=qc&&Ta(Di,W-10,S,qc,1)}function U(){if(bd)try{M.clearRect(0,0,Y,aa);M.globalAlpha=1;if(!Ih)if(Nd&&null!=lc&&0<=ba&&lc[ba].gotit)M.drawImage(lc[ba],J*pa[ba],L*pa[ba],Ja*pa[ba],Ia*pa[ba],0,0,Y,aa);else if(Pa[n].gotit&&(null!=Wf?Wd(Pa[n],J,L,Ja,Ia,Wf):M.drawImage(Pa[n],J,L,Ja,Ia,0,0,Y,aa)),null!=Na&&(M.globalAlpha=1,Pa[n].gotit))for(var b=0;b<Na.length;b+=4)M.drawImage(Pa[n],Na[b],Na[b+1],Na[b+2],Na[b+3],Na[b]/B,Na[b+1]/r,Na[b+2]/B,Na[b+3]/r);if(0<V){for(b=0;b<V;b++){var a=null!=
Oc?Oc[b]:b;M.imageSmoothingEnabled=uf[a];!Zf[a]&&w[a].checked&&w[a].showMe&&(null!=Se&&(M.globalAlpha=Se[a]),Nd&&0<=ba&&null!=wa&&void 0!=wa[a]&&wa[a][ba][n].gotit?M.drawImage(wa[a][ba][n],J*pa[ba],L*pa[ba],Ja*pa[ba],Ia*pa[ba],0,0,Y,aa):H[n][a].gotit&&(null==Pc||1===Pc[a]?null!=Mc&&0<=Mc[a]?Wd(H[n][a],J,L,Ja,Ia,Mc[a]):M.drawImage(H[n][a],J,L,Ja,Ia,0,0,Y,aa):0===Pc[a]&&M.drawImage(H[n][a],0,0,qa,ra,0,0,Y,aa)))}if(null!=sb)for(M.globalAlpha=1,b=0;b<V;b++)if(a=null!=Oc?Oc[b]:b,H[n][a].gotit&&(uh[a]||
w[a].checked)&&sb[a])for(var d=0;d<ka[a].length;d++)M.drawImage(null!=H[n][a].origImage?H[n][a].origImage:H[n][a],ka[a][d][0],ka[a][d][1],ka[a][d][2],ka[a][d][3],ka[a][d][4]/B,ka[a][d][5]/r,ka[a][d][2]/B,ka[a][d][3]/r)}Yb&&da();ai&&k();if(Kg)for(M.globalAlpha=1,a=0;a<db;a++)if(null!=eb[a]){var c=eb[a];null!=c.icon&&(c.icon.style.visibility="hidden");if((-1==c.frame||c.frame==n)&&null!=c.icon&&c.icon.gotit&&(-1==c.overlay||-1!=c.overlay&&w[c.overlay].checked)){if(c.isPan){c.zoomme&&(c.icon.style.width=
Math.round(c.width*G)+"px",c.icon.style.height=Math.round(c.height*C)+"px",c.w2=Math.round(c.width*G/2),c.h2=Math.round(c.height*C/2));var h=Math.round(((c.x0-J)*G-c.w2)/B);var e=Math.round(((c.y0-L)*C-c.h2)/r);if(c.anim){if(0>=h+c.icon.width||h>=qa||0>=e+c.icon.height||e>=ra)continue;c.icon.style.top=e+"px";c.icon.style.left=h+"px"}else M.drawImage(c.icon,c.origX,c.origY,c.width,c.height,h,e,c.width/B,c.height/r)}else M.drawImage(c.icon,c.origX,c.origY,c.width,c.height,c.x0/B,c.y0/r,c.width/B,c.height/
r);c.icon.style.visibility="visible"}}Ef&&(Ff.addFrame(M,{copy:!0,delay:Ai}),n==oa(t-1)&&(Ef=!1,F(Ka),Ff.render()))}catch(g){ea("Error:"+g)}}function ua(b,a,d){!Ve||d>=a||(M.save(),M.fillStyle="blue",M.strokeStyle="white",M.lineWidth=3,M.strokeRect(bf,cf,200,18),M.fillRect(bf,cf,d/a*200,18),a=M.measureText(b).width,M.fillStyle="orange",M.font="14px arial",M.fillText(b,bf+100-a/2,cf+14),M.restore())}function k(){Ve&&jc>Qa?ua("Loading Images",jc,Qa):(ai=!1,Lf&&(wc.style.visibility="hidden"));Qa>=jc&&
(Da||za(oa(n)),null!=pd&&(Aa.value=pd,E.doEnhance(null),pd=null),void 0!=df&&df(!0),null!=zb&&(zb.disabled=!1))}function ea(b){if(Fe&&Kf&&!Kf.closed)try{Kf.document.write(b+"<br>")}catch(a){}}function Ni(){Da&&Gb(mf);Ai=n==oa(t-1)?hh+Ga:Ga;U();setTimeout(function(){cj(Ni)},Ai)}function Gf(b){for(;-180>b;)b+=360;for(;180<b;)b-=360;return b}function aj(){var b,a,d,c,e,f,g,l,k=Math.PI/180;this.init=function(c){for(var d=[],h=1;h<c.length;h++)d[h]=parseFloat(c[h]);a=d[1];b=d[4]/d[5];e=d[6];f=d[7];c=this.toXY(d[2],
d[3]);e=c[0];f=c[1]};this.toXY=function(h,g){d=b*Gf(g-a)*k-e;c=-b*h*k-f;return[d,c]};this.toLatLon=function(c,d){g=-(d+f)/b/k;l=Gf((c+e)/b/k+a);return[g,l]}}function $i(){var b,a,d,c,e,f,g,l,k,m,q,n,t,p,u,x,y,z,A,v,r,B,C,w,G,D,F,H,J,I,L,E=Math.PI/180;this.init=function(c){for(var d=[],e=1;e<c.length;e++)d[e]=parseFloat(c[e]);b=d[1];a=d[2];v=0==d[8]?!1:!0;r=d[6];B=r*r;C=B*B;w=C*B;G=C*C;g=d[5]/d[7];L=d[7];v?(l=Math.cos(E*b),k=Math.sin(E*b)):(l=Math.cos(-b*E),k=Math.sin(-b*E));y=l/Math.sqrt(1-B*k*k);
A=(1-r*k)/(1+r*k);x=v?Math.tan(Math.PI/4-b*E/2)/Math.pow(A,r/2):Math.tan(Math.PI/4- -b*E/2)/Math.pow(A,r/2);p=d[9];u=d[10];c=this.toXY(d[3],d[4]);p=c[0];u=c[1]};this.toXY=function(h,l){v?(e=E*h,f=E*(l-a)):(e=E*-h,f=E*(a-l));A=(1-r*Math.sin(e))/(1+r*Math.sin(e));z=Math.tan(Math.PI/4-e/2)/Math.pow(A,r/2);D=90!=b&&-90!=b?g*y*z/x:2*g*L*z/Math.sqrt(Math.pow(1+r,1+r)*Math.pow(1-r,1-r));d=D*Math.sin(f);c=D*Math.cos(f);v||(d=-d,c=-c);m=d-p;q=c-u;return[m,q]};this.toLatLon=function(h,f){d=h+p;c=f+u;D=Math.sqrt(d*
d+c*c);z=90==b||-90==b?D*Math.sqrt(Math.pow(1+r,1+r)*Math.pow(1-r,1-r))/(2*g*L):D*x/(g*y);F=Math.PI/2-2*Math.atan(z);H=Math.sin(2*F);J=Math.sin(4*F);I=Math.sin(6*F);e=F+H*B/2+5*H*C/24+H*w/12+13*H*G/360+7*J*C/48+29*J*w/240+811*J*G/11520+7*I*w/120+81*I*G/1120+4279*Math.sin(8*F)*G/161280;v?(n=e/E,t=Math.atan2(d,c)/E+a):(n=-e/E,t=-Math.atan2(-d,-c)/E+a);return[n,Gf(t)]}}function bj(){var b,a,d,c,e,f,g,l,k,m,q,n,t,r,p,u,x,y,z,v,A,B,C,w,D,E,G,F,H,J,I,L,M,N,P,O=Math.PI/180;this.init=function(c){for(var e=
[],h=1;h<c.length;h++)e[h]=parseFloat(c[h]);b=e[1];a=e[2];d=e[3];w=e[7];D=w*w;E=D*D;G=E*D;F=E*E;l=e[6]/e[8];k=Math.cos(O*b);m=Math.cos(O*a);n=Math.sin(b*O);q=Math.sin(a*O);A=k/Math.sqrt(1-D*n*n);B=m/Math.sqrt(1-D*q*q);z=Math.sqrt((1-n)/(1+n)*Math.pow((1+w*n)/(1-w*n),w));v=Math.sqrt((1-q)/(1+q)*Math.pow((1+w*q)/(1-w*q),w));I=(Math.log(A)-Math.log(B))/(Math.log(z)-Math.log(v));L=A/(I*Math.pow(z,I));N=l*L*Math.pow(z,I);x=e[9];y=e[10];c=this.toXY(e[4],e[5]);x=c[0];y=c[1]};this.toXY=function(a,b){f=O*
a;g=O*Gf(b-d);P=Math.sin(f);C=Math.sqrt((1-P)/(1+P)*Math.pow((1+w*P)/(1-w*P),w));J=l*L*Math.pow(C,I);M=I*g;c=J*Math.sin(M);e=N+J*Math.cos(M);t=c-x;r=e-y;return[t,r]};this.toLatLon=function(a,b){c=a+x;e=b+y;J=Math.abs(I)/I*Math.sqrt(c*c+(N-e)*(N-e));C=Math.pow(J/(l*L),1/I);H=Math.PI/2-2*Math.atan(C);M=0>I?Math.atan(-c/(e-N)):Math.atan(c/(N-e));g=M/I;f=H+(D/2+5/24*E+G/12+13/360*F)*Math.sin(2*H)+(7/48*E+29/240*G+811/11520*F)*Math.sin(6*H)+(7/120*G+81/1120*F)*Math.sin(6*H)+4279/161280*F*Math.sin(8*H);
p=f/O;u=Gf(d-g/O);return[p,u]}}var E=this,lh,aa,Y,ra,qa,B,r,Th,Uh,Kb,Lb,wc,Lf,la,Fe,Lg,Kf,Hc,Zg,Xf=!1,A,D,jf,lf,Ua,kf,Ec,ke,qb,M,Za,xc,f,ie,xg,Qc,bg,Ue,$h,cg,Fc,t,va,Mh,gb,Zc,Ba,id,V,Zf,ac,Oc,R,Gc,bc,xd,fa,Bh,Pa,H,sg,Ki,Xh,w,Se,oe,Jb,vi,ti,ui,ud,Hb,nh,O,oh,he,tg,W,S,z,p,ha,ia,Ja,Ia,J,L,re,mb,ic,Mi,Da,Ka,hf,n,xf,mf,ye,Od,Dc,Ed=!0,Qe,nf,Ag,zg,Je,Ge,e,Ga,cc,Sc,Ld,df,jg,hh,Ai,sd,jh,uf,Aa,Fd,Nc,rb,pd,Va,kc,$c,ne,vg,ef,Wf,af,je,mi,jd,hb,Mg,Ng,Og,Pg,Ri,pc,Mc,Xa,Md,rf,sf,li,Cb,ni,Gg,$g,ii,ji,ki,be,mh,eb,
db,Kg,dg,Pe,Sf,ih,mg,ma,Xc,xe,Yh,yb,Oa,Z,ah,Wa,ff,nb,Gd,wg,me,ta,Sg,zc,td,pa,ba,lc,ad,wa,Ra,Nd,fb,Sa,Jc,Ig,tf,hd,Hg,bd,od,Ib,wb,vb,Mb,ec,dc,Re,zb,Ef,Ff,dd,Bb,Kd,We,kg,Xe,Ze,Sh,sa,Oi,bi,Vi,Ui,Wi,mc,ib,Ya,Qb,Db,Pd,qi,Qh,ri,si,Rh,Ei,ub,ze,Af,Ae,Bi,Rb,fe,rg,pi,Tg,Qd,ca,wf,hc,Te,vh,Ac,ce,de,vd,wh,xh,Qi,Eg,Fg,Cg,Dg,te,x,Bg,gi,oc,hi,na,Nb,gd,ue,fd,ed,qf,Pi,we,ve,Ic,Ob,di,ei,Fa,Dh,Ch,Cd,G,C,gf,vf,Ph,Bc,ee,Oh,Nh,Ca,Rc,Dd,Hf,ig,ph=!1,qh,rh,sh,$f,th,Ab,yf,of,ci,pe,qe,Ha,pf,se,ug,nc,Xb,Ug,Vg,Pf,Le,qd,zf,Qg,oi,
Rg,Zh=!0,le,ch,Bf,Cf,Ci,eh,Of,La,Nf,Ne,cd,Kc,Ke,rd,Zd,kd,ld,Be,Ce,Wg,Me,Ah,Yf,Hd,Id,Mf,He,Ie,dh,gc,xa,Rd,Xi,og,pg,Ji,qg,Na,Pb,Jg,Pc,sb,ka,uh,yg,Ye,Tc,Jh,Lh,Kh,yc,Yb,Jd,Oe,Uc,Vc,Wc,fc,Sd,Df,Di,fh,$d,gh,Qf,ag,yh,zh,wd,Si,Ti,rc,Xg,Yg,xi,yi,sc,T,wi,qc,zi,xb,u,Yc,Wh,ab,bb,cb,ge,ng,$e,Yi,ae,Rf,Lc,Ve,Tf,Uf,Vf,Zb,$b,kh,ai,bf,cf,Qa,jc,yd,Ih,eg,zd,fg,Ad,gg,Eh,Fh,Hh,Gh,Bd,hg,Yd,tb,dj="N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW N".split(" "),cj=window.requestAnimationFrame||window.mozRequestAnimationFrame||
window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(b){setTimeout(b,10)},q=function(b){return document.createElement(b)},y=function(b,a){return null==b?!1:0==b.trim().toLowerCase().indexOf(a)},Li=function(b,a){if(null!=b)return b=b.trim(),b.lastIndexOf(a)===b.length-1},Ii=function(b){void 0==Zg&&(Zg=q("textarea"));Zg.innerHTML=b;return Zg.value},fi=function(b,a,d){var c=q("select");c.style.width="70px";c.style.margin="5px";for(var e=0;e<b.length;e++){var f=q("option");f.innerHTML=
b[e];f.value=a[e];c.add(f)}c.addEventListener("change",d,!1);return c},Hi=function(b){b=b.split(",");R=Array(t);for(var a=0;a<b.length;a++){var d=b[a].split("&");V=b.length;for(var c=0;c<t;c++)0===a&&(R[c]=Array(V)),R[c][a]=d[1==d.length?0:c].trim(),null!=tb?R[c][a]=(tb+R[c][a]).trim():null!=fa&&(R[c][a]=(fa+R[c][a]).trim())}od=!1},Fi=function(b){b=b.split(",");t=b.length;va=Array(t);for(var a=0;a<t;a++)va[a]=null!=fa?fa+b[a].trim():b[a].trim();od=!1;t>V&&(V=0)},Gi=function(b,a,d){var c=b;null!=fa&&
(c=fa+b);va=Array(t);for(var h=0;h<t;h++){b=h*d+a;if(0<=c.indexOf("*"))va[h]=c.replace("*",b);else if(0<=c.indexOf("?")){for(var f=c;0<=f.lastIndexOf("?");){var g=f.lastIndexOf("?");f=f.substring(0,g)+b%10+f.substring(g+1);b=Math.floor(b/10)}va[h]=f}else va[h]=c+h;ea("image filename = "+va[h])}y(e.reverse_order,"t")&&va.reverse();od=!1;t>V&&(V=0)};HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(b,a,d){d=window.atob(this.toDataURL(a,d).split(",")[1]);
for(var c=d.length,e=new Uint8Array(c),f=0;f<c;f++)e[f]=d.charCodeAt(f);b(new Blob([e],{type:a||"image/png"}))}});this.setup=function(b,a,d,c){void 0==a&&(a="MORdivcan");kf=a;le=d;void 0!=le&&"function"!=typeof le&&(le=null);ch=void 0!=c?c.split("\n"):null;A=document.getElementById(a);Yd="center";A.align=Yd;Ua=q("div");Ua.setAttribute("style","position:relative;border:0px;margin:0px;padding:0px;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; -webkit-tap-heightlight-color:transparent;");
qb=q("canvas");qb.setAttribute("style","position:absolute;top:0;left:0;z-index:1;");M=qb.getContext("2d");xc=q("canvas");xc.setAttribute("style","position:absolute;top:0;left:0;z-index:12;");f=xc.getContext("2d");f.imageSmoothingEnabled=!1;ie=q("canvas");ie.setAttribute("style","position:absolute;top:0;left:0;z-index:10;");xg=ie.getContext("2d");xg.imageSmoothingEnabled=!1;Ec=q("div");Ec.setAttribute("style","position:absolute;top:0;left:0;z-index:5;overflow:hidden;border-width:0px;padding:0px;margin:0px;");
ke=q("div");ke.setAttribute("style","position:absolute;top:0;left:0;z-index:10;overflow:hidden;border-width:0px;padding:0px;margin:0px;");ke.appendChild(ie);af=q("canvas");Ua.appendChild(ke);Ua.appendChild(qb);Ua.appendChild(xc);Ua.appendChild(Ec);A.appendChild(Ua);la=new PEvs(Ua,E.down,E.up,E.move,E.drag,null,E.canTip);A.setAttribute("tabindex",0);A.addEventListener("keyup",function(a){Nb||Ge||(zg=Ag=nf=!1,Je&&(a.preventDefault(),a.stopPropagation()))},!1);A.addEventListener("keypress",function(a){Nb||
Ge||!Je||(a.preventDefault(),a.stopPropagation())},!1);A.addEventListener("keydown",function(a){Nb||Ge||(Je&&(a.preventDefault(),a.stopPropagation()),nf=a.ctrlKey?!0:!1,Ag=a.shiftKey?!0:!1,zg=a.altKey?!0:!1,37==a.keyCode?(F(!1),Gb(-1),U()):39==a.keyCode?(F(!1),Gb(1),U()):32==a.keyCode?E.toggleIsLooping():82==a.keyCode&&a.altKey&&E.resetZoom())},!1);A.addEventListener("mouseenter",function(a){A.focus({preventScroll:!0})},!1);A.style.outlineWidth="0px";A.style.outline="none";Rb=.01745329252;ic=n=0;
ye=!1;mf=1;yf=Ab=!1;Ka=Da=!0;Ef=!1;db=V=t=0;Sf=Pe=!1;Qe=!0;Oc=null;gb=[];Zc=!1;Ba=0;id=[];Dc=!0;Ga=500;cc=100;Sc=2E3;jg=30;hh=0;Rf=6E4;Lc=null;Qc=ae=!1;Ue=!0;Fc=[];xd=tb=fa=null;sg=!1;pa=Bh=null;Nd=!1;ba=-1;Dd=!1;vf=gf=C=G=1;Hf=!1;L=J=Ia=Ja=ia=ha=p=z=S=W=0;Ph=!1;Ed=Zh=!0;Ig=Lf=Xf=!1;be=$g=-1;Xa=[];yb=0;Kg=!1;ma=null;Xc=-1;mg=0;xe=!1;Sa=null;cf=bf=Qa=jc=0;Wh=!1;T=0;Jb=cg=dg=bd=!1;Ug=Vg=Bf=Cf=0;cd=Xb=!1;La=[];La.push("default");La.push("default");Nf="default";Id=!1;Ne="default";gc=null;xa=[0,0];Rd=
[0,0];nb=ug=Le=!1;td=!0;ta=zc=null;Bb=Sg=!1;Xe=!0;Of="default";re=!0;sa=[];Yb=Qf=!1;Oe="default";Uc=!1;xi=[1,0,0];yi=[2,2,1];sc=[];yc=[];Nc=Fd=ib=!1;Te=wf=0;Pb=lf=jf=D=Cb=null;Jg=0;Je=!0;Nb=Ge=Ag=zg=nf=!1;a=q("canvas");a.height=1;a.width=1;Za=a.getContext("2d");Za.imageSmoothingEnabled=!1;wg=q("canvas");Fe=!1;"string"===typeof b?0>b.indexOf("\n")?bh(b):m(b.split("\n")):m(b)};this.newBasenames=function(b,a,d,c){bd=!1;Ka=Da;F(!1);t=c;Gi(b,a,d);Dc=!0;Sb()};this.newFilenames=function(b){bd=!1;Ka=Da;F(!1);
Fi(b);Dc=!0;Sb()};this.newOverlayFilenames=function(b){bd=!1;Ka=Da;F(!1);Hi(b);Dc=!0;Sb()};this.newProbeTable=function(b){Uc=!1;X(b.trim())};this.reloadFOF=function(){ea("reload FoF = "+Lc);If("r");od?Zi(Yi,!1):(Ka=null==hf?!0:Da,Dc=!0,Sb())};this.getFOF=function(){var b=e.file_of_filenames.trim();E.newFOF(null!=xd?xd+b:b,!0)};this.newFOF=function(b,a){E.resetZoom();Zi(b,a)};var Zi=function(b,a){var d,c,e,f,g=new XMLHttpRequest,l,k,m,q,n,r,p,u=null,x=!1;Yh=yb;bd=!1;Ka=Da;F(!1);a&&za(ic);yb=t=0;va=
[];O=Wa=null;sg=!1;tg=[];for(he=null;Ec.hasChildNodes();)Ec.removeChild(Ec.lastChild);ff=0;Nd=nb=Gd=!1;wa=ad=lc=null;Ra=[];Jc=-1;R=[];var w=!1;if(null==ub||null!=fe)ub=[];ea("new FOF="+b);ib&&(null!=mc&&(I(mc,!0,"extrap on"),A.style.cursor="default",F(Ka),Ya=-1),ib=!1,da());Bb&&(null!=dd&&(I(dd,!0,"mark on"),A.style.cursor="default",F(Ka),Kd=-1),Bb=!1,da());g.onload=function(){var a=this.responseText.split("\n");for(d=0;d<a.length;d++)if(!(2>a[d].length)&&(l=a[d].trim(),ea("FOF: "+l),0!=l.indexOf("#")))if(0==
l.indexOf("frame_labels"))n=l.split("="),fb=n[1].split(",");else if(0==l.indexOf("redirect"))for(n=l.split("="),p=n[1].split(","),he=p[0].trim(),c=1;c<p.length;c++){var b=parseInt(p[c],10)-1;tg[b]=!0}else if(0==l.indexOf("framenumber_index_values"))n=l.split("="),Yf=n[1].split(",");else if(0==l.indexOf("slice")){n=l.split("=");p=n[1].split(",");O=[];for(c=0;c<p.length;c++)O[c]=parseInt(p[c],10);O[2]=O[2]-O[0]+1;O[3]=O[3]-O[1]+1;4<O.length&&(O[6]=O[6]-O[4]+1,O[7]=O[7]-O[5]+1)}else if(0==l.indexOf("fof_extension"))n=
l.split("="),u=n[1].trim();else if(0==l.indexOf("probe_table"))n=l.split("="),Uc=!1,X(n[1].trim());else if(0==l.indexOf("image_base"))n=l.split("="),fa=n[1].trim();else if(0==l.indexOf("overlay_base"))n=l.split("="),tb=n[1].trim();else if(0==l.indexOf("high_res_basemap")){n=l.split("=");p=n[1].split(",");ad=[];for(c=0;c<p.length;c++)ad[c]=p[c].trim(),null!=fa&&(ad[c]=fa+ad[c]);Nd=!0}else if(0==l.indexOf("high_res_overlay"))for(n=l.split("="),r=n[1].split("&"),e=0;e<r.length;e++){p=r[e].split(",");
Jc=parseInt(p[0].trim(),10)-1;Ra[Jc]=[];for(c=1;c<p.length;c++)Ra[Jc][c-1]=p[c].trim(),Li(Ra[Jc][c-1],"/")||(null!=tb?Ra[Jc][c-1]=tb+Ra[Jc][c-1]:null!=fa&&(Ra[Jc][c-1]=fa+Ra[Jc][c-1]));Nd=!0}else if(0==l.indexOf("high_res_zoom")){n=l.split("=");p=n[1].split(",");pa=[];for(c=0;c<p.length;c++)pa[c]=parseFloat(p[c].trim());Vb()}else if(0==l.indexOf("hoverzone"))Ud(l);else if(0==l.indexOf("hotzone"))Ma(l);else if(0==l.indexOf("hotspot"))x||(eb=null,db=0,x=!0),Tb(l);else if(0==l.indexOf("toggle_onoff"))n=
l.split("="),tf=n[1].split(",");else if(0==l.indexOf("coordinates"))n=l.split("="),Eb(n[1]);else if(0==l.indexOf("fof_substitute"))b=l.indexOf("="),p=l.substring(b+1).split(","),sg=!0,Xh=p[0].trim(),Ki=p[1].trim();else if(0==l.indexOf("map_scale"))n=l.split("="),p=n[1].split(","),Kc=parseFloat(p[0]),Ke=1<p.length?parseFloat(p[1]):Kc;else if(0==l.indexOf("times")){n=l.split("=");p=n[1].split(",");for(d=0;d<p.length;d++)ub[d]=parseInt(p[d].trim(),10);w=!0}else{null!=fe&&(b=l.match(fe),null!=b&&2==b.length?
(ub.push(parseInt(b[1],10)),ea("+ + + Extrap time = "+b[1]),w=!0):ea("+ + + Cannot parse times using "+fe+" from line: "+l));e=l.indexOf(" ");0>e&&(e=l.length);va[t]=l.substring(0,e).trim();null!=fa&&(va[t]=fa+va[t]);l=l.substring(e+1);b=l.indexOf('"');0<=b&&(null==fb&&(fb=[]),e=l.substring(b+1),b=e.indexOf('"'),0<=b&&(fb[t]=e.substring(0,b),0==t&&(Sa.innerHTML=fb[0])));R[t]=[];b=l.indexOf("overlay");if(0<=b)for(k=l.substring(b),b=k.indexOf("="),0>b&&ea("Cannot find a = sign in "+k),m=k.substring(b+
1),k=m.trim(),m=k.split(","),V=Math.max(V,m.length),ea("numOverlays set to "+V),f=0;f<m.length;f++)R[t][f]=m[f].trim(),null!=he&&tg[f]?R[t][f]=(he+R[t][f]).trim():null!=tb?R[t][f]=(tb+R[t][f]).trim():null!=fa&&(R[t][f]=(fa+R[t][f]).trim());t+=1}w&&ya(ub);null!=u?(a=new XMLHttpRequest,a.onload=function(){var a=this.responseText.split("\n");for(d=0;d<a.length;d++)2>a[d].length||(q=a[d].trim(),ea("ext_FOF: "+q),0!=q.indexOf("#")&&(0==q.indexOf("hotzone")?Ma(q):0==q.indexOf("hotspot")&&Tb(q)));$a()},
a.onerror=function(){$a()},a.open("get",u+"?"+Math.round(1E5*Math.random()),!0),a.send()):$a()};Yi=b;g.open("get",b+"?"+Math.round(1E5*Math.random()),!0);g.send()};this.setWindowSize=function(b,a){if(null!=A){A.style.height=a+"px";A.style.width=b+"px";A.style.padding="0px";a=a-(null!=jf?jf.offsetHeight:0)-(null!=lf?lf.offsetHeight:0)-(null!=Cb?Cb.offsetHeight:0)-Jg*(null!=Pb?Pb.offsetHeight:0);var d=a*qa/ra;d>b&&(d=b,a=b*ra/qa);a=Math.floor(a);d=Math.floor(d);Ed||(Td(d,a),da())}};this.drag=function(b){Bb||
(W=la.getX(),S=la.getY(),Nb?(b=x.length-1,x[b].xe=W,x[b].ye=S,x[b].xp.push(W),x[b].yp.push(S),x[b].size=Math.round(Math.sqrt(Math.pow(W-x[b].x,2)+Math.pow(S-x[b].y,2)))):(z=W*B,p=S*r,cd=Jb=!1,Xb&&(!Le||Le&&b.shiftKey)?(Bf=z,Cf=p,cd=!0):(Ca&&C!=vf?(J=ha-z/G,L=ia-p/C,nd(),ha=Math.round(J+z/G),ia=Math.round(L+p/C),void 0!=Od&&Od(["drag",G,C,ha,ia,z,p,J,L,Ja,Ia])):Bb||ib||!nb||(ta=null,td&&0<=z&&0<=p&&(Z=me.getImageData(z,p,1,1).data,0!=Z[3]&&(ta=Wa[Z[3]-1]))),Hf=!0,U())),da())};this.resetZoom=function(){G=
gf;C=vf;ba=-1;null!=Fa&&(I(Fa,!0,"zoom on"),Ca=!1);ha=z;ia=p;L=J=0;Ia=ra;Ja=qa;Vb();U();Gd&&(nb=!0);void 0!=Od&&Od(["reset",0,0])};this.canTip=function(){var b;Jb=!1;W=la.getX();z=W*B;S=la.getY();p=S*r;if(!((Bb||ib)&&p<si&&p>ri&&z>qi)){ha=Math.round(J+z/G);ia=Math.round(L+p/C);if(0!=yb)for(b=0;b<yb;b++)if(Oa[b].overlay>=V)ea(" Error...hotzone overlay # "+Oa[b].overlay+" > number of overlays = "+V);else if(w[Oa[b].overlay].checked&&(Za.clearRect(0,0,1,1),Za.drawImage(H[n][Oa[b].overlay],ha,ia,1,1,
0,0,1,1),Z=Za.getImageData(0,0,1,1).data,ah=(Z[0]<<16)+(Z[1]<<8)+Z[2],ah==Oa[b].color)){Jb=!0;ti=W;ui=S;vi=Oa[b].tip;break}if(0!=db)for(b=db-1;0<=b;b--)if(null!=eb[b]){var a=eb[b];if(-1==a.frame||a.frame==n)if(-1==a.overlay||w[a.overlay].checked){var d=!1;if(a.isPan)if(a.isIcon){var c=(a.x0-J)*G-a.w2;var e=(a.y0-L)*C-a.h2;z>c&&z<c+a.width&&p>e&&p<e+a.height&&(d=!0)}else c=(a.x0-J)*G,e=(a.y0-L)*C,z>c&&z<c+a.width*G&&p>e&&p<e+a.height*C&&(d=!0);else z>a.x0&&z<a.x1&&p>a.y0&&p<a.y1&&(d=!0);if(d&&null!=
a.tip){Jb=!0;ti=W;ui=S;vi=eb[b].tip;break}}}da()}};this.move=function(){if(!ib&&nb&&(ta=null,td)){var b=la.getX()*B,a=la.getY()*r;0<=b&&0<=a&&(Z=me.getImageData(b,a,1,1).data,0!=Z[3]&&(ta=Wa[Z[3]-1]))}ib&&2<=Ya&&(W=la.getX(),z=W*B,S=la.getY(),p=S*r);da()};this.down=function(){Jb&&(Jb=!1,da());W=la.getX();z=W*B;S=la.getY();p=S*r;Ug=z;Vg=p;Bf=Ug;Cf=Vg;ha=Math.round(J+z/G);ia=Math.round(L+p/C);Xb&&(pb(),Rd[0]=xa[0],Rd[1]=xa[1]);Hf=!1;if(Nb){var b={};b.x=W;b.y=S;b.xe=W;b.ye=S;b.xp=[W];b.yp=[S];b.type=
we.value;b.color=ve.value;b.width=Ic.value;b.text=Ob.value;b.size=0;x.push(b)}};this.up=function(b){Jb=!1;if(!Nb){if(ib||Bb){W=la.getX();z=W*B;S=la.getY();p=S*r;if(Bb){Kd=1;if(0<Kd&&p/r<Wi){if(z/B>Vi){sa.pop();sa.pop();0==sa.length&&(Kd=0);da();return}if(z/B<Ui){da();b=window.open("","Mark Points");b.document.write("<div>Marked Points<br>");for(var a=[],d=0;d<sa.length;d+=2)ha=J+sa[d]/G,ia=L+sa[d+1]/C,pb(),b.document.write(xa[0].toFixed(4)+","+xa[1].toFixed(4)+"<br>"),0==d&&(a[0]=xa[0],a[1]=xa[1]);
Xe&&b.document.write(a[0].toFixed(4)+","+a[1].toFixed(4)+"<br>");return}}sa.push(z);sa.push(p);da();return}if(3>Ya)if(Qb[Ya]=z,Db[Ya]=p,Pd[Ya]=rg[n],0==Ya)Ya=1,za(oa(t-1)),wf=1,wd=null;else{Bi=Pd[1]-Pd[0];Af=(Qb[1]-Qb[0])/Bi;Ae=(Db[1]-Db[0])/Bi;if(null!=ag&&null!=Kc){d=Af*Kc;var c=Ae*Ke;a=Math.round(60*Math.sqrt(d*d+c*c));d=Math.atan2(d,-c)/Rb;0>d&&(d+=360);wd=yh+dj[Math.round(d/22.5)]+" at "+a+" "+zh;Si=Qb[0];Ti=0<Ae?Db[0]-15:Db[0]+30}a=parseInt(de,10);ca=Math.round(Math.abs(4*(a+4)/Af));Qd=Math.round(Math.abs(2*
(a+4)/Ae));Qd<ca&&(ca=Qd);120<ca?ca=120*Math.floor(ca/120)+60:90<ca?ca=120:60<ca?ca=90:30<ca?ca=60:15<ca?ca=30:10<ca?ca=15:5<ca?ca=10:2<ca?ca=5:0==ca&&(ca=1);Qd=Pd[1]/ca*ca+ca;ze=1;xh&&(ze=-1);pi=Af*ca;Tg=Ae*ca;za(oa(t-1));Ya=3;wf=2}else if(p/r<si&&p/r>ri&&z/B>qi&&3==Ya){Wb();da();return}da()}if(cd)cd=!1,da();else if(null!=nc&&Ca&&(Xb=!1,I(nc,!0,"distance on")),Hf)Hf=!1;else if(b.altKey)E.resetZoom();else if(nb&&null!=ta&&Sg)md(ta,"z");else{W=la.getX();z=W*B;S=la.getY();p=S*r;if(0!=yb)for(a=0;a<yb;a++)if(Oa[a].overlay>=
V)ea(" Error...hotzone overlay # "+Oa[a].overlay+" > number of overlays = "+V);else if(w[Oa[a].overlay].checked&&(Za.clearRect(0,0,1,1),Za.drawImage(H[n][Oa[a].overlay],Math.floor(ha),Math.floor(ia),1,1,0,0,1,1),Z=Za.getImageData(0,0,1,1).data,ah=(Z[0]<<16)+(Z[1]<<8)+Z[2],ah==Oa[a].color)){md(Oa[a],"z");return}if(0!=db)for(a=db-1;0<=a;a--)if(null!=eb[a]){var e=eb[a];if(!(-1!=e.frame&&e.frame!=n||e.fromfile||-1!=e.overlay&&!w[e.overlay].checked)){var f=!1;e.isPan?e.isIcon?(d=(e.x0-J)*G-e.w2,c=(e.y0-
L)*C-e.h2,z>d&&z<d+e.width&&p>c&&p<c+e.height&&(f=!0)):(d=(e.x0-J)*G,c=(e.y0-L)*C,z>d&&z<d+e.width*G&&p>c&&p<c+e.height*C&&(f=!0)):z>e.x0&&z<e.x1&&p>e.y0&&p<e.y1&&(f=!0);if(f){md(eb[a],"s");return}}}Ca&&(nb=!1,Vd(b.ctrlKey||nf||b.which&&3==b.which||b.button&&2==b.button));U();da()}}};this.wheel=function(b){Mh?Gb(b):Ca&&(W=la.getX(),z=W*B,S=la.getY(),p=S*r,ha=Math.round(J+z/G),ia=Math.round(L+p/C),Vd(-1==b))};this.toggleAutoRefresh=function(){ae?(I(Tc,!1,"autorefresh off"),null!=Lc&&clearInterval(Lc),
ae=!1):(I(Tc,!0,"autorefresh on"),Lc=setInterval("HAniS.reloadFOF();",Rf),ae=!0)};this.toggleLoopRock=function(){ye?(I(pe,!0,"looprock rock"),ye=!1):(I(pe,!1,"looprock loop"),ye=!0)};this.toggleLoopHalt=function(){Ab?(I(qe,!0,"loophalt halt"),yf=Ab=!1):(I(qe,!1,"loophalt loop"),yf=Ab=!0)};this.toggleExtrap=function(){ib?(null!=mc&&(I(mc,!0,"extrap on"),A.style.cursor=La.pop(),null!=Ib&&(Ib.disabled=!1),F(Ka),Ca=Nh,Ya=-1),ib=!1,da()):(null!=mc&&(ib=!0,wd=null,La.push(A.style.cursor),A.style.cursor=
"crosshair",I(mc,!1,"extrap off"),Ka=Da,null!=Ib&&(Ib.disabled=!0),Da=!1,Nh=Ca,Ca=!1,E.resetZoom(),Wb(),da()),U())};this.doEnhance=function(b){if(Fd||Nc){var a=Va[0].height,d=Va[0].width;b=parseInt(Aa.value,10);0<=b?(Mg=ab[b],Ng=bb[b],Og=cb[b],Pg=ge[b],yc[rb]=b):yc[rb]=null;var c=a*d*4;for(d=0;d<kc.length;d++)if(Va[d].gotit){Va[d].gotit=!1;var e=ef[d].data;var f=vg[d];if(0>b)for(a=0;a<c;a+=4)e[a]=f[a],e[a+1]=f[a+1],e[a+2]=f[a+2],e[a+3]=f[a+3];else for(a=0;a<c;a+=4)hb=f[a],hb===f[a+1]&&hb===f[a+2]&&
(e[a]=Mg[hb],e[a+1]=Ng[hb],e[a+2]=Og[hb],e[a+3]=Pg[hb]);$c[d].putImageData(ef[d],0,0);Va[d].gotit=!0}}};this.overClick=function(b){var a;if(b.target.checked)for(a=0;a<w.length;a++)b.target!=w[a]&&0!=b.target.name&&b.target.name==w[a].name&&(w[a].checked=!1);td=!0;for(a=0;a<bc.length;a++)b.target!=w[a]&&Fb(a),null!=zc&&!zc[a]&&w[a].checked&&(td=!1),null!=Aa&&a===rb&&(Aa.disabled=!w[a].checked);U()};this.toggleIsLooping=function(){Da?(Da=!1,I(Ib,!0,"startstop start")):(Da=!0,I(Ib,!1,"startstop stop"),
yf=Ab,Ab=!1)};this.toggleZooming=function(){Ca?(E.resetZoom(),I(Fa,!0,"zoom on")):(I(Fa,!1,"zoom off"),Ca=!0,null!=nc&&(Xb=!1,I(nc,!0,"distance on")),Gd&&(nb=!0),ib&&E.toggleExtrap())};this.togup=function(b){$g=-1};this.togdown=function(b){var a=Gg.getX();Gg.getY();for(var d=ni,c=0;c<Xa.length;c++){if(a>d&&a<d+Md){if(c==$g)break;if(b.shiftKey){0<=Xa[c]&&(F(!1),za(c));break}a=0;!b.ctrlKey&&0<=Xa[c]&&(a=-1);Ea(c,a);$g=c;break}d=d+Md+sf}};this.makeAniGIF=function(){if(!Ef){var b=zb.innerHTML;Ff=new GIF({workers:4,
debug:!1,quality:10,width:Y,height:aa,repeat:0});Ff.on("finished",function(a){zb.innerHTML=b;var d=e.anigif_prompt,c=e.anigif_filename;null==c&&(c="hanimate.gif");if(null!=d&&(c=window.prompt(d,c),null==c))return;d=document.createElement("a");d.href=URL.createObjectURL(a);d.download=c;c=new MouseEvent("click");d.dispatchEvent(c);setTimeout(function(){URL.revokeObjectURL(a)},3E4)});Ff.on("progress",function(a){zb.innerHTML=Math.round(100*a)+"%"});Ka=Da;F(!1);mf=1;Ef=!0;za(oa(ic));U();F(!0);zb.innerHTML=
"Loading"}};this.doneLoading=function(b){df=b};this.getCustomButton=function(){return Ze};this.dwellChanged=function(b){Ld=b};this.getDwell=function(){return Ga};this.frameChanged=function(b){xf=b};this.getFrame=function(){return n};this.showFrame=function(b){za(oa(b));U()};this.zoomChanged=function(b){Od=b};this.showZoom=function(b){"reset"===b[0]?E.resetZoom():(G=b[1],C=b[2],ha=b[3],ia=b[4],z=b[5],p=b[6],J=b[7],L=b[8],Ja=b[9],Ia=b[10],nd(),U())}};
