PostLocation.prototype.load=function(m,o,n,p,s){if(GBrowserIsCompatible()){var k=this;if(s&&s!=0){this.postID=s}var q=document.createElement("img");
q.style.position="absolute";q.style.left="5px";q.style.top="7px";q.src=this.pluginPath+"icons/return.png";q.title="初期表示位置に戻る";q.onclick=function(){k.map.returnToSavedPosition()
};q.style.cursor="pointer";document.getElementById(m).appendChild(q);this.map.addControl(new GSmallZoomControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(6,30)));
var l=G_NORMAL_MAP;var r=this.getCookie("gmaptype");if(r!=null){if(r=="G_SATELLITE_MAP"){l=G_SATELLITE_MAP}else{if(r=="G_HYBRID_MAP"){l=G_HYBRID_MAP
}}}GEvent.addListener(this.map,"maptypechanged",function(){var a=k.map.getCurrentMapType();var b="G_NORMAL_MAP";if(a==G_SATELLITE_MAP){b="G_SATELLITE_MAP"
}else{if(a==G_HYBRID_MAP){b="G_HYBRID_MAP"}}document.cookie="gmaptype="+b+"; path=/;"});if(!this.locations||this.locations.length==0){this.map.setCenter(new GLatLng(o,n),p,l);
return}if(s!=undefined&&s==0){}else{if(s||this.locations.length==1){n=this.locations[0][1];o=this.locations[0][2];p=this.locations[0][3];
p=Math.min(l.getMaximumResolution(),p)}else{var t=this.getLocationsBounds();zoom=this.map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(t[1],t[0]),new GLatLng(t[3],t[2])));
if(zoom>p){n=(t[0]+t[2])/2;o=(t[1]+t[3])/2;p=zoom}}}this.map.setCenter(new GLatLng(o,n),p,l);this.loadExtent=this.map.getBounds();
this.createLocationOverlay();if(s){this.createConnection(this.getLocationConnection(0),this.getLocationGeometries(0))}GEvent.addListener(this.map,"infowindowclose",function(){k.clearTmpMarker();
if(k.tmpIdx>=0){k.map.panTo(k.getLocationPoint(k.tmpIdx))}})}};PostLocation.prototype.setMapMoveCallback=function(c){var d=this;this.mapMoveListener=GEvent.addListener(this.map,"move",function(){c(d.map.getCenter())
})};PostLocation.prototype.removeMapMoveCallback=function(){GEvent.removeListener(this.mapMoveListener);this.mapMoveListener=null
};PostLocation.prototype.showLoadExtent=function(){this.map.setZoom(this.map.getBoundsZoomLevel(this.loadExtent))};PostLocation.prototype.getLocationsBounds=function(){var l=this.locations[0][1];
var j=this.locations[0][2];var n=l;var k=j;for(var h=0;h<this.locations.length;h++){if(this.locations[h].length>4){l=Math.min(l,this.locations[h][1]);
j=Math.min(j,this.locations[h][2]);n=Math.max(n,this.locations[h][1]);k=Math.max(k,this.locations[h][2])}}var i=n-l;var m=k-j;l-=i/10;
j-=m/10;n+=i/10;k+=m/10;return[l,j,n,k]};PostLocation.prototype.showLocationsBounds=function(){var b=this.getLocationsBounds();_x=(b[0]+b[2])/2;
_y=(b[1]+b[3])/2;_z=this.map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(b[1],b[0]),new GLatLng(b[3],b[2])));if(b[0]==b[2]){_z=_z-2
}this.map.setCenter(new GLatLng(_y,_x),_z)};PostLocation.prototype.setMaxBounds=function(f,g,h,e){this.maxBounds=new Array(f,g,h,e)
};PostLocation.prototype.showMapLinkIcon=function(j,i){if(j){idx=this.locations.length-1;var k="[map]";var l=this.getIcon(i);if(l){var g=14;
var h=Math.ceil(l.iconSize.width*g/l.iconSize.height);k='<img src="'+l.image.replace(/\.png$/,".gif")+'" width="'+h+'" height="'+g+'" style="margin:0px;padding:0px;border:0px;"><img src="'+this.pluginPath+'link.png" style="margin:0px;padding:0px;border:0px;">'
}j.innerHTML='<a href="javascript:void(0);" onclick="postLocation.onClickMapLink(event, '+idx+');" onmouseover="postLocation.onMouseOverMapLink(event, '+idx+');" onmouseout ="postLocation.onMouseOutMapLink();">'+k+"</a>";
this.postLinks.push(j)}};PostLocation.prototype.onClickMapLink=function(c,d){this.setMapMarginTop(c,d);this.showPostPopup(d)};PostLocation.prototype.onMouseOverMapLink=function(c,d){if(this.map.getInfoWindow().isHidden()){this.closePopup();
this.showPostCenter(d,0)}};PostLocation.prototype.onMouseOutMapLink=function(){var b=this;window.onscroll=function(){b.clearMapMarginTop()
};if(this.map.getInfoWindow().isHidden()){this.clearTmpMarker()}};PostLocation.prototype.setMapMarginTop=function(y,s){var w=document.getElementById("postlocation_position");
if(w){var e=(document.all)?[window.event.clientX,window.event.clientY]:[y.clientX,y.clientY];var v=document.getElementById("postlocation_"+s);
if(!v){return}var F=document.documentElement.scrollTop||document.body.scrollTop;var B=document.documentElement.scrollLeft||document.body.scrollLeft;
var z=this.getOffsetTop(w);var u=this.getOffsetLeft(w);var C=e[0]+B;var t=this.map.getSize().width;var A=this.map.getSize().height;
if(F>z+20){var x=F-z;var D=0;if(C>u&&C<u+t&&e[1]<A+40){D=-t-80;w.style.textAlign="right"}else{w.style.textAlign="left"}w.style.position="relative";
w.style.top=x+"px";w.style.left=D+"px";w.style.border="2px outset gray";w.style.paddingBottom="0px";var h=document.getElementById("postlocation_position_close");
if(h){h.style.display="block"}else{h=document.createElement("label");h.id="postlocation_position_close";h.innerHTML="閉じる";h.style.fontSize="8pt";
h.style.textDecoration="underline";h.style.cursor="pointer";h.onclick=this.clearMapMarginTop;w.appendChild(h)}}}else{var E=document.getElementById("postlocation_margin_top");
if(!E){return}var x=document.documentElement.scrollTop||document.body.scrollTop;var A=x-this.getOffsetTop(E);if(A>0){E.innerHTML="<table><tr><td height="+A+"><br></td></tr></table>"
}}};PostLocation.prototype.clearMapMarginTop=function(){var c=document.getElementById("postlocation_position");if(c){c.style.top="";
c.style.left="";c.style.border="2px solid white";var d=document.getElementById("postlocation_position_close");if(d){d.style.display="none"
}c.style.paddingBottom="4px"}elem=document.getElementById("postlocation_margin_top");if(elem){elem.innerHTML="";window.onscroll=null
}};PostLocation.prototype.getOffsetTop=function(d){var c=0;while(d){c+=d.offsetTop;d=d.offsetParent}return c};PostLocation.prototype.getOffsetLeft=function(c){var d=0;
while(c){d+=c.offsetLeft;c=c.offsetParent}return d};
