var map1;
var geocoder1;
var opts1;
var marker1;

var map2;
var geocoder2;
var opts2;
var marker2;

function load(address) {

  if (GBrowserIsCompatible()) {

	//opts1 = {size : {width:200, height:145}};
    //map1 = new GMap2(document.getElementById("map1"), opts1);
    map1 = new GMap2(document.getElementById("map1"));
    //map.addControl(new GMapTypeControl());
    //map.addControl(new GLargeMapControl());
    map1.setCenter(new GLatLng(35.54944192456544,139.78368759155273), 13);

    geocoder1 = new GClientGeocoder();
    geocoder1.getLatLng(address , showMap);

	//opts2 = {size : {width:300, height:300}};
	//map2 = new GMap2(document.getElementById("map2"), opts2);
	map2 = new GMap2(document.getElementById("map2"));
	//map2.addControl(new GMapTypeControl());
    map2.addControl(new GLargeMapControl());
    map2.setCenter(new GLatLng(35.16931803601131, 136.89119338989258), 13);

    geocoder2 = new GClientGeocoder();
    geocoder2.getLatLng(address , showMap);
  }
}

//function moveAddress(address){
//  geocoder.getLatLng(address, showMap);
//}

function showMap(latlng){
  if (latlng){
    map1.setCenter(latlng, 15);
    map2.setCenter(latlng, 16);
    marker1 = new GMarker(latlng);
    marker2 = new GMarker(latlng);
    map1.addOverlay(marker1);
    map2.addOverlay(marker2);
  }else{
    alert("住所から緯度経度に変換できません");
  }
}