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