var map;
//var message_main = "<img src='./img/logo_main_black.gif' /><p>広島市中区流川4-14<br />グランド流川ビル1F奥<br />TEL: 082-222-8883</p>";
var message_casual = "<img src='./img/logo_casual_black.gif' /><p>広島市中区幟町15-9<br />藤本ビル2F<br />TEL: 082-222-8883</p>";

function load() {
      if (GBrowserIsCompatible()) {
  		map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		var latlng =  new GLatLng(34.395,132.46737);
		//var latlng =  new GLatLng(34.39339,132.46737);
    	map.setCenter(latlng, 16);
		
/*
		var icon_main = new GIcon(); 
		icon_main.image = "./img/shop_icon.gif";
		icon_main.iconSize = new GSize(20, 20); 
		icon_main.iconAnchor = new GPoint(10, 10); // アンカーの位置
		icon_main.infoWindowAnchor = new GPoint(10, 10); 
		var point = new GPoint(132.463869, 34.390344); // 画像のアンカーの位置 
		var marker_main = new GMarker(point, {icon: icon_main, draggable: true, 
                                 dragCrossMove: true}); 
*/

		var icon_casual = new GIcon(); 
		icon_casual.image = "./img/shop_icon.gif";
		icon_casual.iconSize = new GSize(20, 20); 
		icon_casual.iconAnchor = new GPoint(10, 10); // アンカーの位置
		icon_casual.infoWindowAnchor = new GPoint(10, 10); 
		var point_casual = new GPoint(132.46737, 34.39339); // 画像のアンカーの位置 
		var marker_casual = new GMarker(point_casual, {icon: icon_casual, draggable: true, 
                                 dragCrossMove: true}); 
		
		var message_main = "<img src='./img/logo_main_black.gif' /><p>広島市中区流川4-14<br />グランド流川ビル1F奥<br />TEL: 082-222-8883</p>";
   		var message_casual = "<img src='./img/logo_casual_black.gif' /><p>広島市中区幟町15-9<br />藤本ビル2F<br />TEL: 082-222-8883</p>";
		
		//map.addOverlay(marker_main);
		map.addOverlay(marker_casual);
		
		var latlng_main =  new GLatLng(34.390344,132.463869);
		var latlng_casual =  new GLatLng(34.39339,132.46737);
		//map.openInfoWindowHtml(latlng_main, message_main);
		map.openInfoWindowHtml(latlng_casual, message_casual);
/*
	  	GEvent.addListener(marker_main, "click", function() {
         marker_main.openInfoWindowHtml(message_main);
		});
*/
	  	GEvent.addListener(marker_casual, "click", function() {
         marker_casual.openInfoWindowHtml(message_casual);
		});
      }
}

function show_message($shop) {
if($shop == 'main') {
latlng = new GLatLng(34.390344,132.463869);
$msg = 	message_main;
} else {
latlng =  new GLatLng(34.39339,132.46737);
$msg = 	message_casual;	
}

map.setZoom(16);
map.panTo(latlng);
map.openInfoWindowHtml(latlng, $msg);

}

function pan_out(lat,lng) {
latlng = new GLatLng(lat,lng)
map.setZoom(13);
map.panTo(latlng);
map.closeInfoWindow();
}
