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