
	// FOR FLASH
	swfobject.registerObject("azzure_slideshow", "9.0.0");
	
	// FOR POPUP	
	$(document).ready(function(){
		$("a[rel='photos_azzure']").colorbox({slideshow:true,slideshowSpeed:4000});

		//Example of preserving a JavaScript event for inline calls.
		$("#click").click(function(){ 
			$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
			return false;
		});
	});	
	
	var geocoder;
	var map;
	var curr_infw;
	// Add markers to the map
	
	// Marker sizes are expressed as a Size of X,Y
	// where the origin of the image (0,0) is located
	// in the top left of the image.
	
	// Origins, anchor positions and coordinates of the marker
	// increase in the X direction to the right and in
	// the Y direction down.
	//  var image = new google.maps.MarkerImage('images/beachflag.png',
	
	
	var image = new google.maps.MarkerImage('/images/common/house.png?azzure',
	// This marker is 20 pixels wide by 32 pixels tall.
	//    new google.maps.Size(20, 32),
	new google.maps.Size(86, 72),
	// The origin for this image is 0,0.
	new google.maps.Point(0,0),
	// The anchor for this image is the base of the flagpole at 0,32.
	new google.maps.Point(28, 72));
	var shadow = new google.maps.MarkerImage('images/common/houseShadow.png?azzure',
	// The shadow image is larger in the horizontal dimension
	// while the position and offset are the same as for the main image.
	new google.maps.Size(86, 72),
	new google.maps.Point(0,0),
	new google.maps.Point(28, 72));
	// Shapes define the clickable region of the icon.
	// The type defines an HTML &lt;area&gt; element 'poly' which
	// traces out a polygon as a series of X,Y points. The final
	// coordinate closes the poly by connecting to the first
	// coordinate.
	var shape = {
		coord: [1, 1, 1, 86, 72, 86, 72 , 1],
		type: 'poly'
	};
  
	function GetMapAzzure(MapTitle,MapDesc,MapCentreLat,MapCentreLong,MapScale,MapLatitude,MapLongitude) {
		geocoder = new google.maps.Geocoder();
		
		var myOptions = {
			zoom: MapScale,
			scrollwheel: true,
			center: new google.maps.LatLng(MapCentreLat, MapCentreLong),
			navigationControl: true,	// déplacement   
			mapTypeControl: true,  
			scaleControl: true,	// zoom 
			mapTypeId: google.maps.MapTypeId.HYBRID
		}	

		map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);


		var myLatLng = new google.maps.LatLng(MapLatitude, MapLongitude); 
		
		var ximage = image;
		
		var marker = new google.maps.Marker({ 
			position: myLatLng, 
			map: map,
			shadow: shadow,
			icon: ximage,
			shape: shape,
			title: MapTitle, 
			zIndex: 1 
		});
             
		var infowindow = new google.maps.InfoWindow({ 
			content: MapDesc, 
			size: new google.maps.Size(50,50) 
		}); 
                  
		google.maps.event.addListener(marker, 'click', function() { 
			//close previosly opened window if opened at all
			if(curr_infw) { curr_infw.close();} 
			// save info about opened window 
			curr_infw = infowindow;	 
			infowindow.open(map,marker); 
		});
		
	}

var concessionaire = new Array();  

function setMarkers(map, locations) {

	var bounds = new google.maps.LatLngBounds(); 
	
	if (concessionaire.length > 0) {
		
	          for (var i = 0; i < concessionaire.length; i++) { 
	                //attachInfoAdr(map, concessionaire[i]); 
	                if (concessionaire[i][1] != null) {
				attachInfo(map, concessionaire[i]); 
	                }
	          } 
	}

	function attachInfo(map, beach) {
	
		var myLatLng = new google.maps.LatLng(beach[1], beach[2]); 
//alert(beach[0] + ',' +beach[1] + ',' + beach[2] + ',' + beach[3] + ',' + beach[4]);
		var ximage = image;
		
		var marker = new google.maps.Marker({ 
			position: myLatLng, 
			map: map,
			shadow: shadow,
			icon: ximage,
			shape: shape,
			title: beach[0], 
			zIndex: parseInt(beach[3]) 
		});
		
		var infowindow = new google.maps.InfoWindow({ 
			content: beach[4], 
			size: new google.maps.Size(50,50) 
		}); 
		
		google.maps.event.addListener(marker, 'click', function() { 
			//close previosly opened window if opened at all
			if(curr_infw) { curr_infw.close();} 
			// save info about opened window 
			curr_infw = infowindow;	 
			infowindow.open(map,marker); 
		}); 
		
		bounds.extend(myLatLng);
		map.setCenter(bounds.getCenter());		
		map.fitBounds(bounds);
	} 

  
}




function GetMultiMap(id_lang,type,arrayId) {	

	var sUrl = '../includes/ajax_map.php?id_lang=' + id_lang + '&type=' + type + '&arrayId=' + arrayId;	

	var html = $.ajax({
		type: "GET",
		url: sUrl,
		async: false
	 }).responseText;


		concessionaire = html.split(/\n/g); 	

	
		 for (var i=0;i<concessionaire.length;i++) {   
		 	//alert(concessionaire[i]);
			concessionaire[i] = concessionaire[i].split("$");   
			
		
		 } 
		 
		 if (concessionaire.length > 0) {

			geocoder = new google.maps.Geocoder();
		
			  var myOptions = {						
				zoom: 6,
				scrollwheel: true,
				center: new google.maps.LatLng(46.22764, 2.21375),		// FRANCE
				navigationControl: true,	// déplacement   
				mapTypeControl: true,  
				scaleControl: true,	// zoom 
				mapTypeId: google.maps.MapTypeId.HYBRID
				}
	
			map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
	
	  		setMarkers(map, concessionaire);
		 
		 }

		
} 
