//地図のインスタンスを保持するmap変数
var map;

function createMarker(lat,lng,title,address) {
	var icon = new GIcon();
	var shoptype = get['shoptype'];
	if(shoptype == "l"){
		icon.image = "img/plot_lifort.png";
		icon.iconSize = new GSize(26, 34);
		icon.iconAnchor = new GPoint(9, 34);
		icon.infoWindowAnchor = new GPoint(18, 11);
		var marker = new GMarker(new GLatLng(lat, lng),icon);
		var html = "<div class='mapWin'><img src='img/maplogo_lifort.gif' /><h6>" + title + "</h6><p>" + address + "</p>";
	}else if(shoptype == "z"){
		icon.image = "img/plot_zip.png";
		icon.iconSize = new GSize(26, 34);
		icon.iconAnchor = new GPoint(9, 34);
		icon.infoWindowAnchor = new GPoint(18, 11);
		var marker = new GMarker(new GLatLng(lat, lng),icon);
		var html = "<div class='mapWin'><img src='img/maplogo_zip.gif' /><h6>" + title + "</h6><p>" + address + "</p>";
	}
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindow(html);
	});
	map.addOverlay(marker);
} 
function gmload(lat,lng,title,address){ 
	map = new GMap2( document.getElementById("map")); 
	map.setCenter( new GLatLng(lat, lng), 14 );
	map.addControl(new GSmallMapControl());
	map.addControl(new GScaleControl());
	
	createMarker(lat,lng,title,address);  //
}
    
//
window.onunload = GUnload;

