var keyvalid=true;var gChart;function Chart(_1,_2,_3,_4,_5,_6,_7,_8,_9){gChart=this;this.ae={"x":0,"y":0};this.ad=false;this.af=false;this.ag=_8;this.ah=_9;this.ak=8;this.al=9;this.ai=_2;this.aj=_3;this.width=_4;this.height=_5;this.x0=0;this.y0=0;this.ab=_6;this.ac=_7;this.gX=0;this.gY=0;this.am=_1;var wh=ba();if(_2>0){this.width=wh.x-_2;}if(_3>0){this.height=wh.y-_3;}this.am.style.position="relative";this.am.style.width=this.width+"px";this.am.style.height=this.height+"px";this.am.style.borderWidth="1px";this.am.style.borderColor="gray";this.am.style.borderStyle="solid";this.aq=document.createElement("div");var st=this.aq.style;st.position="absolute";st.left="0px";st.top="0px";st.width="100%";st.height="100%";st.display="block";st.overflow="hidden";this.am.appendChild(this.aq);this.ap=document.createElement("div");st=this.ap.style;st.position="absolute";st.left="0px";st.top="0px";st.width="100%";st.height="100%";st.display="block";st.backgroundColor="transparent";st.backgroundImage="url(\"images/trans.gif\")";st.backgroundRepeat="no-repeat";st.backgroundPosition="center center";this.am.appendChild(this.ap);this.ar=function(){if(gChart.af&&gChart.ad){gChart.av({"x":gChart.gX,"y":gChart.gY});gChart.af=false;}};this.getEvent=function(_c){if(_c==undefined){return window.event;}else{return _c;}};this.az=function(_d){if(bd=="Internet Explorer"){return "style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_d+"', sizingMethod='crop');\"";}else{return "background='"+_d+"'";}};this.as=function(){this.au=[];var _e=Math.ceil(this.height/this.ah)+1;var _f=Math.ceil(this.width/this.ag)+1;if(!this.ab){_f=1;}if(!this.ac){_e=1;}for(var c=0;c<_f;c+=1){var _11=[];for(var r=0;r<_e;r+=1){var _13={"c":c,"r":r,"img":document.createElement("img"),"chart":this};_13.img.className="tile";_13.img.style.width=this.ag+"px";_13.img.style.height=this.ah+"px";_13.img.style.position="absolute";this.at(_13,true);this.aq.appendChild(_13.img);_11.push(_13);}this.au.push(_11);}};this.av=function(_14){var _15=Math.round(this.x0)+(_14.x-this.ae.x);var _16=Math.round(this.y0)+(_14.y-this.ae.y);if(!this.ac){_16=0;}if(!this.ab){_15=0;}for(var c=0;cthis.width){do{_19.c-=this.au.length;_19.x=(_19.c*this.ag)+_15;_1a=true;}while(_19.x>this.width);}else{while(_19.x<(-1*this.ag)){_19.c+=this.au.length;_19.x=(_19.c*this.ag)+_15;_1a=true;}}if(_19.y>this.height){do{_19.r-=this.au[c].length;_19.y=(_19.r*this.ah)+_16;_1a=true;}while(_19.y>this.height);}else{while(_19.y<(-1*this.ah)){_19.r+=this.au[c].length;_19.y=(_19.r*this.ah)+_16;_1a=true;}}this.at(_19,_1a);this.at(_19,false);_19.img.style.top=_19.y+"px";_19.img.style.left=_19.x+"px";}}};this.at=function(_1b,_1c){var ck=aw("cycle");var src="dget3.php?z="+this.ak+"&c="+_1b.c+"&i="+aw("cycle");var _1f=_1b.c<0;var _20=_1b.r<0;var _21=_1b.c>=Math.pow(2,this.ak);var low=_1b.r>=Math.pow(2,this.ak);var _23=this.ak>this.al;var _24=_20||_1f||low||_21||_23;if(_1c){src="au/tile-none.png";}if(_1b.img.src!=src){_1b.img.src=src;}};this.ao=function(_25){var _26={"x":_25.x,"y":_25.y};for(var _27=gChart.am;_27;_27=_27.offsetParent){_26.x-=_27.offsetLeft;_26.y-=_27.offsetTop;}var _28=window.pageYOffset?window.pageYOffset:document[(document.compatMode=="CSS1Compat")?"documentElement":"body"].scrollTop;_26.y+=_28;return _26;};this.getEvent=function(_29){if(_29==undefined){return window.event;}else{return _29;}};this.bb=function(_2a){var ev=gChart.getEvent(_2a);var _2c=gChart.ao({"x":ev.clientX,"y":ev.clientY});gChart.ad=true;gChart.af=false;gChart.aq.style.cursor=gChart.ap.style.cursor="move";gChart.ae={"x":_2c.x,"y":_2c.y};gChart.gX=_2c.x;gChart.gY=_2c.y;gChart.ap.onmousemove=gChart.be;};this.be=function(_2d){if(gChart.ad){var ev=gChart.getEvent(_2d);var _2f=gChart.ao({"x":ev.clientX,"y":ev.clientY});if(_2f.x!=gChart.gX||_2f.y!=gChart.gY){gChart.af=true;gChart.gX=_2f.x;gChart.gY=_2f.y;}}};this.bc=function(_30){if(gChart.ad){var ev=gChart.getEvent(_30);gChart.ap.onmousemove=null;gChart.aq.style.cursor=gChart.ap.style.cursor="default";var _32=gChart.ao({"x":ev.clientX,"y":ev.clientY});gChart.x0+=(_32.x-gChart.ae.x);gChart.y0+=(_32.y-gChart.ae.y);gChart.ad=false;}};this.resizeViewer=function(_33){var wh=ba();var _35=0;if(gChart.aj>0){_35=wh.y-gChart.aj;gChart.am.style.height=_35+"px";gChart.ap.style.height=_35+"px";gChart.aq.style.height=_35+"px";gChart.height=_35;}var _36=0;if(gChart.ai>0){_36=wh.x-gChart.ai;gChart.am.style.width=_36+"px";gChart.ap.style.width=_36+"px";gChart.aq.style.width=_36+"px";gChart.width=_36;}if(gChart.ai>0||gChart.aj>0){gChart.as();gChart.ae={"x":0,"y":0};gChart.av({"x":0,"y":0});}};this.zoomImage=function(_37,_38){if(_37==undefined){var _37={"x":this.width/2,"y":this.height/2};}var pos={"before":{"x":0,"y":0}};pos.before.x=(_37.x-pos.before.x)-this.x0;pos.before.y=(_37.y-pos.before.y)-this.y0;pos.before.width=pos.before.height=Math.pow(2,this.ak)*this.ag;if(this.ak+_38>=0&&this.ak+_38<=this.al){pos.after={"width":(pos.before.width*Math.pow(2,_38)),"height":(pos.before.height*Math.pow(2,_38))};pos.after.x=pos.before.x*Math.pow(2,_38);pos.after.y=pos.before.y*Math.pow(2,_38);pos.after.left=_37.x-pos.after.x;pos.after.top=_37.y-pos.after.y;this.x0=pos.after.left;this.y0=pos.after.top;this.ak+=_38;this.ae=_37;this.av(_37);}};this.setZoomLevel=function(_3a){if(_3a>this.al){_3a=this.al;}this.zoomImage(undefined,_3a-this.ak);};this.moveMeTo=function(px,py){this.x0=-px*2.855/Math.pow(2,5-this.ak)+this.width/2;this.ae={"x":0,"y":0};this.av({"x":0,"y":0});};this.init=function(){this.as();this.av({"x":0,"y":0});this.ap.onmousedown=this.bb;this.ap.onmouseup=this.bc;setInterval("gChart.ar()",100);};this.aa=function(_3d,x,y,_40,_41){var btn=document.createElement("div");btn.name=_3d;btn.style.position="absolute";btn.style.width="22px";btn.style.height="22px";btn.style.left=x+"px";btn.style.top=y+"px";btn.style.cursor="hand";btn.isLong=false;var ref="'javascript:"+_41+"'";var _44="";if(bd=="Internet Explorer"){_44="onclick="+_41;}btn.innerHTML="
";this.ap.appendChild(btn);};}function gogoChart(_45,_46,lng,lat,z){if(!keyvalid){return;}var _4a=document.getElementById("gogoChart");var _4b=new Chart(_4a,0,0,_45,_46,true,true,256,256);var _4c=0.081819191;var _4d={"x":-2.21657,"y":1.23046};var _4e={"x":-1.09956,"y":0.1309};scaleX=(_4e.x-_4d.x)/8192;scaleY=(_4e.y-_4d.y)/8192;offsetX=_4d.x;offsetY=_4d.y;tsfn=function(phi,_50){return Math.tan(0.5*((Math.PI/2)-phi))/Math.pow((1-_50*_4c)/(1+_50*_4c),0.5*_4c);};cphi2=function(ts){var _52=0.5*_4c;var phi=(Math.PI/2)-2*Math.atan(ts);for(i=0;i<15;i++){var con=_4c*Math.sin(phi);var _55=(Math.PI/2)-2*Math.atan(ts*Math.pow((1-con)/(1+con),_52))-phi;phi+=_55;if(Math.abs(_55)<=1e-10){return phi;}}return phi;};ax=function(_56){_56.y=-Math.log(tsfn(_56.y,Math.sin(_56.y)));_56.x=(_56.x-offsetX)/scaleX;_56.y=(_56.y-offsetY)/scaleY;};ay=function(_57){_57.x=_57.x*scaleX+offsetX;_57.y=_57.y*scaleY+offsetY;_57.y=Math.exp(-_57.y);_57.y=cphi2(_57.y);};getEvent=function(_58){if(_58==undefined){return window.event;}else{return _58;}};_4b.at=function(_59,_5a){var src="http://flyagogo.net/get.php?f=sec/tile-"+_4b.ak+"-"+_59.c+"-"+_59.r+".jpg";if(_5a){src="http://flyagogo.net/au/tile-none.png";}if(_59.img.src!=src){_59.img.src=src;}};_4b.moveMeTo=function(px,py){var p={"x":px/180*Math.PI,"y":py/180*Math.PI};ax(p);_4b.x0=-p.x/Math.pow(2,5-_4b.ak)+_4b.width/2;_4b.y0=-p.y/Math.pow(2,5-_4b.ak)+_4b.height/2;_4b.ae={"x":0,"y":0};_4b.av({"x":0,"y":0});};_4b.addLogo=function(px,py){logodiv=document.createElement("div");logodiv.style.position="absolute";logodiv.style.right="2px";logodiv.style.bottom="2px";logodiv.style.width="102px";logodiv.style.height="27px";var ref="'http://www.flyagogo.net/?"+py+","+px+"'";var _62="";if(bd=="Internet Explorer"){_62="onclick=\"javascript:document.location="+ref+"\"";}logodiv.innerHTML="
 
";_4b.ap.appendChild(logodiv);};_4b.dblClickViewer=function(_63){var ev=getEvent(_63);var _65=_4b.ao({"x":ev.clientX,"y":ev.clientY});if(_65.x>50||_65.y>30){_65.x-=_4b.x0;_65.x/=Math.pow(2,_4b.ak)/32;_65.y-=_4b.y0;_65.y/=Math.pow(2,_4b.ak)/32;ay(_65);document.location="http://flyagogo.net/?"+_65.y*180/Math.PI+","+_65.x*180/Math.PI;}};_4b.addZoomButtons=function(){gChart.aa("up",10,10,"http://flyagogo.net/images/zoom-plus2.png","gChart.zoomImage(undefined,1);");gChart.aa("down",33,10,"http://flyagogo.net/images/zoom-minus2.png","gChart.zoomImage(undefined,-1);");};_4b.init();_4b.addLogo(lng,lat);_4b.moveMeTo(lng,lat);_4b.setZoomLevel(z);_4b.ap.ondblclick=_4b.dblClickViewer;_4b.al=8;window.onmouseup=_4b.bc;return _4b;}var detect=navigator.userAgent.toLowerCase();var OS,bd,version,total,thestring;if(an("konqueror")){bd="Konqueror";OS="Linux";}else{if(an("safari")){bd="Safari";}else{if(an("omniweb")){bd="OmniWeb";}else{if(an("opera")){bd="Opera";}else{if(an("webtv")){bd="WebTV";}else{if(an("icab")){bd="iCab";}else{if(an("msie")){bd="Internet Explorer";}else{if(!an("compatible")){bd="Netscape Navigator";version=detect.charAt(8);}else{bd="An unknown browser";}}}}}}}}if(!version){version=detect.charAt(place+thestring.length);}if(!OS){if(an("linux")){OS="Linux";}else{if(an("x11")){OS="Unix";}else{if(an("mac")){OS="Mac";}else{if(an("win")){OS="Windows";}else{OS="an unknown operating system";}}}}}function an(_66){place=detect.indexOf(_66)+1;thestring=_66;return place;}function ba(){myWidth=0;myHeight=0;if(typeof (window.innerWidth)=="number"){myWidth=window.innerWidth;myHeight=window.innerHeight;}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}}}return {"x":myWidth,"y":myHeight};}