var map,mapicon,showll,showinfo,rdiv,geocoder;function getWindowHeight(){if(window.self&&self.innerHeight)return self.innerHeight;if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;return 0}function makeurl(a){var b=map.getCenter(),d=b.lng();b=b.lat();return a+"?x="+Math.round(d*1E5)/1E5+"&y="+Math.round(b*1E5)/1E5+"&zoom="+map.getZoom()}function gotoeolme(){var a=makeurl("http://a.earthol.me/share.php");top.location=a}
function mapresize(){th=getWindowHeight()-120;document.getElementById("map").style.height=th+"px"}function addAddressToMap(a){if(!a||a.Status.code!=200)map.openInfoWindowHtml(map.getCenter(),"\u6ca1\u627e\u5230\uff0c\u8bf7\u91cd\u65b0\u641c\u7d22\u3002<br />");else{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 showsearch(){if(map){if(rdiv==null){rdiv=document.createElement("div");rdiv.style.position="absolute";rdiv.style.fontsize="16px";rdiv.style.width="300px";rdiv.style.color="#FF9900";map.getContainer().appendChild(rdiv)}rdiv.innerHTML='<form name="citysearch" action="javascript:void(0)" onsubmit="gothere(this.cityskey.value); return false;"><strong>\u5730\u56fe\u641c\u7d22\uff1a</strong><input type="text" size="15" name="cityskey" value="" /> <input type="submit" value="\u641c\u7d22" /></form>';rdiv.style.left=
map.getSize().width-300+"px";rdiv.style.top=map.getSize().height-100+"px"}}function addmaps(a,b,d,c,e){b=new GLatLng(d,b);a='<div style="width:333px; word-break:break-all;"><b>'+c+'</b><br /><br /><a href="http://a.earthol.me/view-'+a+'.html" target="_blank">\u70b9\u6b64\u67e5\u770b\u5730\u6807\u8be6\u60c5</a></div>';markerOptions={icon:mapicon};c=new GMarker(b,markerOptions);c.bindInfoWindowHtml(a);if(randomn==e){showll=b;showinfo=a}map.addOverlay(c)}window.onresize=function(){mapresize()};
if(top.location!=self.location)top.location=self.location;
function loadmap(){mapresize();map=new GMap2(document.getElementById("map"));map.addControl(new GLargeMapControl);map.addControl(new GMapTypeControl);map.addControl(new GScaleControl);var a=new GLatLng(33.431,109.775);map.setCenter(a,4,G_HYBRID_MAP);mapicon=new GIcon;mapicon.image="http://img.earthol.net/1/eolme.png";mapicon.iconSize=new GSize(20,20);mapicon.iconAnchor=new GPoint(10,20);mapicon.infoWindowAnchor=new GPoint(10,10);geocoder=new GClientGeocoder;geocoder.setBaseCountryCode("CN");showsearch()}
;

