var map;
var point;
var icon;

var myPano;

function handleNoFlash(errorCode) {
  if (errorCode == FLASH_UNAVAILABLE) {
    alert("Error: Flash doesn't appear to be supported by your browser");
    return;
  }
}  


var icon = new GIcon();

icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
markerOptions = { icon:icon };

function initialize(lat,lng,css){
	
  point=new GLatLng(lat,lng);

  
  icon.image = "/css/vig/gfx/carte-point-"+css+".png";
  point=new GLatLng(lat,lng);
  map = new GMap2(document.getElementById("carte"));
  map.setCenter(point, 16);
  map.setUIToDefault();
  map.addOverlay(new GMarker(point, icon));
  if (document.getElementById('pano')){	
	  panoramaOptions = { latlng:point };
	  myPano = new GStreetviewPanorama(document.getElementById("pano"), panoramaOptions);
	  GEvent.addListener(myPano, "error", handleNoFlash);	
	  GEvent.addListener(map,"click", function(overlay,latlng) {
	      myPano.setLocationAndPOV(latlng);
	  });
  }

}
