var map,tx,ty,distmks=[],distlines=null,mapjob,rdiv,ux,uy,uz,uzoom,showinfo;function getWindowHeight(){return window.self&&self.innerHeight?self.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:0}function mapresize(){th=getWindowHeight()-130;document.getElementById("map").style.height=th+"px"}
function getArgs(){for(var a={},c=location.search.substring(1).split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("=");if(-1!=e){var f=c[d].substring(0,e),e=c[d].substring(e+1);a[f]=decodeURIComponent(e)}}return a}function makeurl(a){var c=Math.round(1E5*tx)/1E5,d=Math.round(1E5*ty)/1E5;return a+"?x="+c+"&y="+d+"&zoom="+map.getZoom()}function makechinaurl(a){var c=Math.round(1E5*tx)/1E5,d=Math.round(1E5*ty)/1E5;return a+"?x="+c+"&y="+d+"&z="+map.getZoom()}
function getmapurl(){var a=makechinaurl("http://china.earthol.com/");map.getCurrentMapType().getName()!=G_NORMAL_MAP.getName()&&(a+="&t=s");var c=encodeURIComponent("Google Earth Online"),d=encodeURIComponent(a);map.openInfoWindowHtml(map.getCenter(),'<div style="width:333px; word-break:break-all;"><strong>\u901a\u8fc7\u94fe\u63a5\u5206\u4eab\u5f53\u524d\u4f4d\u7f6e\u5730\u56fe\uff1a<br /><a href="'+a+'">'+a+'</a><br /><br />\u8bf7\u590d\u5236\u4e0a\u9762\u7684\u94fe\u63a5\uff0c\u5206\u4eab\u7ed9\u670b\u53cb\u6216\u81ea\u884c\u6536\u85cf\u3002\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5206\u4eab\u5230\uff1a<a href="'+
("http://www.jiathis.com/send/?webid=tsina&url="+d+"&title="+c+"&uid=97625")+'" target="_blank"><img src="http://img.earthol.net/1/tsina.jpg" alt="\u65b0\u6d6a\u5fae\u535a" border="0" /></a> <a href="'+("http://www.jiathis.com/send/?webid=qzone&url="+d+"&title="+c+"&uid=97625")+'" target="_blank"><img src="http://img.earthol.net/1/qzone.jpg" alt="QQ\u7a7a\u95f4" border="0" /></a> <a href="'+("http://www.jiathis.com/send/?webid=renren&url="+d+"&title="+c+"&uid=97625")+'" target="_blank"><img src="http://img.earthol.net/1/renren.jpg" alt="\u4eba\u4eba\u7f51" border="0" /></a> <a href="'+
("http://www.jiathis.com/send/?webid=kaixin001&url="+d+"&title="+c+"&uid=97625")+'" target="_blank"><img src="http://img.earthol.net/1/kaixin.gif" alt="\u5f00\u5fc3\u7f51" border="0" /></a> <a href="'+("http://www.jiathis.com/send/?webid=tqq&url="+d+"&title="+c+"&uid=97625")+'" target="_blank"><img src="http://img.earthol.net/1/tqq.jpg" alt="\u817e\u8baf\u5fae\u535a" border="0" /></a> <a href="'+("http://www.jiathis.com/send/?webid=douban&url="+d+"&title="+c+"&uid=97625")+'" target="_blank"><img src="http://img.earthol.net/1/douban.gif" alt="\u8c46\u74e3\u7f51" border="0" /></a> <a href="'+
("http://www.jiathis.com/send/?webid=baidu&url="+d+"&title="+c+"&uid=97625")+'" target="_blank"><img src="http://img.earthol.net/1/baidu.gif" alt="\u767e\u5ea6\u641c\u85cf" border="0" /></a><br /><br />\u5982\u679c\u60a8\u60f3\u751f\u6210\u5e26\u6587\u5b57\u4ecb\u7ecd\u7684\u5730\u56fe\u7f51\u9875\uff0c\u8bf7<a href="javascript:void(0)" onclick="return gotoeolme()">\u70b9\u6b64\u5236\u4f5c</a></strong></div>')}
function addAddressToMap(a){!a||200!=a.Status.code?map.openInfoWindowHtml(map.getCenter(),'\u6ca1\u627e\u5230\uff0c\u8bf7\u91cd\u65b0\u641c\u7d22\u3002<br /><br /><a href="http://map.earthol.com/help/search.html" target="_blank"><strong>\u70b9\u6b64\u67e5\u770b\u641c\u7d22\u5e2e\u52a9</strong></a>'):(place=a.Placemark[0],point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]),map.setCenter(point,13),map.openInfoWindowHtml(map.getCenter(),place.address+"<br />"))}
function gothere(a){geocoder.getLocations(a,addAddressToMap)}function gotoeolme(){var a=makeurl("http://b.earthol.me/share.php");top.location=a}function flyto(a,c,d,e){0<e?map.setCenter(new GLatLng(c,a),e):map.setCenter(new GLatLng(c,a));map.openInfoWindowHtml(map.getCenter(),d)}function ForDight(a,c){return a=Math.round(a*Math.pow(10,c))/Math.pow(10,c)}function totop(){window.scrollTo(0,0)}
function gotoxy(){var a=document.xyform.x.value,c=document.xyform.y.value;flyto(a,c,"\u7ecf\u5ea6\uff1a"+a+"<br /><br />\u7eac\u5ea6\uff1a"+c,12);totop()}if(top.location!=self.location)top.location=self.location;
function drawdist(){distlines&&(map.removeOverlay(distlines),distlines=null);if(1<distmks.length){for(var a=[],c=0,d=0;d<distmks.length;d++){var e=distmks[d].getPoint();a.push(e);0<d&&(b=distmks[d-1].getPoint(),e=distab(b.lng(),b.lat(),e.lng(),e.lat()),c+=e)}distlines=new GPolyline(a);map.addOverlay(distlines);a="";a=1E3<c?"\u5f53\u524d\u957f\u5ea6:"+ForDight(c/1E3,3)+"\u516c\u91cc":"\u5f53\u524d\u957f\u5ea6:"+ForDight(c,0)+"\u7c73";cjout(a)}else 1==distmks.length&&cjout("\u8bf7\u9009\u62e9\u7ed3\u675f\u70b9")}
function distab(a,c,d,e){c=c*Math.PI/180;e=e*Math.PI/180;a=a*Math.PI/180-d*Math.PI/180;a=2*Math.asin(Math.sqrt(Math.pow(Math.sin((c-e)/2),2)+Math.cos(c)*Math.cos(e)*Math.pow(Math.sin(a/2),2)));return a=Math.round(6378137E4*a)/1E4}
function ceju(a){if("distance"==mapjob){distlines&&(map.removeOverlay(distlines),distlines=null);for(var c=distmks.length-1;0<=c;c--)map.removeOverlay(distmks[c]);distmks=[];1!=a?(cjout("",1),mapjob=""):cjout("\u8bf7\u9009\u62e9\u8d77\u59cb\u70b9")}else map.openInfoWindowHtml(map.getCenter(),'<div style="width:339px; word-break:break-all;">\u6d4b\u8ddd\u6a21\u5f0f\u5df2\u5f00\u542f-\u8bf7\u70b9\u51fb\u8d77\u59cb\u70b9\u5f00\u59cb\u6d4b\u8ddd<br /><br />\u652f\u6301\u4e24\u70b9\u6216\u591a\u70b9\u95f4\u7684\u6d4b\u8ddd\uff0c\u6d4b\u91cf\u7ed3\u679c\u663e\u793a\u5728\u5730\u56fe\u7684\u53f3\u4e0b\u89d2\u3002<br />\u60a8\u53ef\u4ee5\u968f\u610f\u62d6\u52a8\u5730\u56fe\u4e0a\u7684\u6d4b\u91cf\u70b9\uff0c\u4fee\u6b63\u540e\u7684\u8ddd\u79bb\u4f1a\u81ea\u52a8\u7ed9\u51fa\u3002</div><br />'),
cjout("\u8bf7\u9009\u62e9\u8d77\u59cb\u70b9"),mapjob="distance"}function mapclick(a,c){if("distance"==mapjob&&null!=c){var d=new GMarker(c,{draggable:!0});distmks.push(d);map.addOverlay(d);GEvent.addListener(d,"dragend",function(){drawdist()});drawdist()}}
function cjout(a,c){if(map){if(null==rdiv)rdiv=document.createElement("div"),rdiv.style.position="absolute",map.getContainer().appendChild(rdiv);rdiv.innerHTML=1!=c?'<span class="distance">'+a+'<br /><a href="javascript:void(0)" onclick="return ceju(1)" title="\u6e05\u9664\u6240\u6709\u6807\u8bb0\uff0c\u8ddd\u79bb\u5f52\u96f6">\u91cd\u7f6e\u5f52\u96f6</a> <a href="javascript:void(0)" onclick="return ceju()" title="\u9000\u51fa\u6d4b\u8ddd\u6a21\u5f0f">\u7ed3\u675f\u6d4b\u8ddd</a></span>':a;rdiv.style.left=
map.getSize().width-160+"px";rdiv.style.top=map.getSize().height-100+"px"}}window.onresize=function(){mapresize()};var args=getArgs();args.x&&args.y&&args.zoom?(ux=parseFloat(args.x),uy=parseFloat(args.y),uzoom=parseInt(args.zoom),5<uzoom&&(uzoom-=2)):args.x&&args.y&&args.z?(ux=parseFloat(args.x),uy=parseFloat(args.y),uzoom=parseInt(args.z)):(ux=101.953125,uy=33.72434,uzoom=4,showinfo=1);function showaddr(){var a=map.getCenter();geocoder.getLocations(a,getAddr)}
function getAddr(a){map.clearOverlays();!a||200!=a.Status.code?alert("\u6ca1\u6709\u627e\u5230\u6b64\u4f4d\u7f6e\u7684\u5730\u5740\u4fe1\u606f\uff01"):(place=a.Placemark[0],point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]),map.openInfoWindowHtml(map.getCenter(),'<div style="width:300px;">\u5f53\u524d\u5730\u56fe\u6240\u5728\u4f4d\u7f6e\u7684\u5730\u5740\u4e3a\uff1a<br /><div class="addrinfo">'+place.address+"<br /></div></div>"))}
function nsearch(){document.nsform.x.value=tx;document.nsform.y.value=ty}
function load(){GBrowserIsCompatible()&&(mapresize(),map=new GMap2(document.getElementById("map")),map.addControl(new GLargeMapControl),map.addControl(new GScaleControl),map.addControl(new GMapTypeControl),geocoder=new GClientGeocoder,geocoder.setBaseCountryCode("CN"),GEvent.addListener(map,"click",function(a,c){mapclick(a,c)}),GEvent.addListener(map,"move",function(){var a=map.getCenter();tx=a.lng();ty=a.lat();a="\u7ecf\u5ea6:"+tx+"<br />\u7eac\u5ea6:"+ty+"<br />";document.getElementById("xy").innerHTML=
a}),map.setCenter(new GLatLng(uy,ux),uzoom),args.t&&"s"==args.t&&map.setMapType(G_HYBRID_MAP),map.openInfoWindowHtml(map.getCenter(),'<div style="width:300px;"><center><b>\u5f53\u524d\u662f\u5730\u7403\u5728\u7ebf-\u4e2d\u56fd\u7248\u5730\u56fe\u6a21\u5f0f</b></center><br />\u4e2d\u56fd\u7248\u536b\u661f\u5730\u56fe\u4ece\u5b57\u4f53\u663e\u793a\u3001\u8857\u8def\u5730\u5740\u4fe1\u606f\u7b49\u65b9\u9762\u8fdb\u884c\u4e86\u4f18\u5316\u548c\u6821\u6b63\uff0c\u8ba9\u60a8\u5728\u6d4f\u89c8\u4e2d\u56fd\u5927\u9646\u7684\u5730\u70b9\u5730\u56fe\u65f6\u5f97\u5230\u66f4\u597d\u7684\u6548\u679c\u548c\u4f53\u9a8c\u3002</div>'))}
;

