var map;
var marker;
var marker2;
var icon = Array();
	icon[0] = new GIcon();
	icon[0].image = "http://www.google.co.jp/intl/ja_jp/mapfiles/cb/man_arrow-0.png ";
	icon[0].iconSize = new GSize(49, 52);
	icon[0].iconAnchor = new GPoint(25, 35);
	icon[0].infoWindowAnchor = new GPoint(25, 5);
	icon[0].shadow = null;
	icon[1] = new GIcon();
	icon[1].image = "http://parkingmap.jp/img/dot_p.png";
	icon[1].iconSize = new GSize(9,9);
	icon[1].iconAnchor = new GPoint(4,4);
	icon[1].infoWindowAnchor = new GPoint(5,5);
	icon[2] = new GIcon();
	icon[2].image = "http://parkingmap.jp/img/dot_p.png";
	icon[2].iconSize = new GSize(9,9);
	icon[2].iconAnchor = new GPoint(4,4);
	icon[2].infoWindowAnchor = new GPoint(5,5);
function load() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GMapTypeControl());
    map.addControl(new GSmallMapControl());
    map.setCenter(new GLatLng(lat,lng), 18);

    var point = new GLatLng(lat,lng);
    marker = new GMarker(point,icon[0]);
    map.addOverlay(marker);
    var point = new GLatLng(lat,lng);
    marker1 = new GMarker(point,icon[1]);
    map.addOverlay(marker1)

    var option = { latlng:spoint };
    var scontainer = document.getElementById("street");
    var panorama = new GStreetviewPanorama(scontainer, option);

    GEvent.addListener(panorama, "initialized", moveMap);
	GEvent.addListener(panorama, "yawchanged", onYawChange);/*oooooooooooo_iconmove_ooooooooooooo*/

    var spoint = new GLatLng(lat,lng);
    panorama.setLocationAndPOV(spoint);
	
    var client = new GStreetviewClient();/*oooooooooooo_位置修正_ooooooooooooo*/
    client.getNearestPanorama(spoint, getPoint)/*oooooooooooo_位置修正_ooooooooooooo*/

  }

function getPoint(data){/*oooooooooooo_位置修正ファンクション_ooooooooooooo*/
	if (data.code != 200){
	    return;
	  }
	
	var newpoint = data.location.latlng;
	
	panorama.setLocationAndPOV(newpoint);
	map.panTo(newpoint);
	marker.setLatLng(newpoint);
	}/*oooooooooooo_位置修正ファンクションここまで_ooooooooooooo*/

i=0;

 }
  
  
  
function moveMap(location){
	map.panTo(location.latlng);
	marker.setLatLng(location.latlng);
	if(i==0){
	var point = new GLatLng(lat,lng);
	marker2 = new GMarker(point,icon[2]);
	map.addOverlay(marker2);
	map.removeOverlay(marker1);}
	i=i+1;
	}
function onYawChange(newYaw) {/*oooooooooooo_方向表示アイコン_ooooooooooooo*/
	var GUY_NUM_ICONS = 16;
	var GUY_ANGULAR_RES = 360 / GUY_NUM_ICONS;
	if (newYaw < 0) {
	newYaw += 360;
	}
	guyImageNum = Math.round(newYaw / GUY_ANGULAR_RES) % GUY_NUM_ICONS;
	guyImageUrl = "http://maps.google.co.jp/intl/ja_jp/mapfiles/cb/man_arrow-" + guyImageNum + ".png";
	marker.setImage(guyImageUrl);
	}/*oooooooooooo_方向表示アイコンここまで_ooooooooooooo*/ 