
	var GoogleMap = Class.create();
	
	GoogleMap.prototype = {
		map:false,
		centre:false,
		finished:false,
		container:false,
		tabPoint:new Array(),
		initialize:function(myMapDiv,obj) {	
			var ref = this;
			this.container = myMapDiv.container;
			this.centre = myMapDiv.centre;			
			obj.each(function(truc,i) { ref.tabPoint[ref.tabPoint.length] = truc;});
			
			this.set_map();
		},		
		set_point:function(myPoint) {
			return (new GLatLng(myPoint.coords[0],myPoint.coords[1]),myPoint.coords[2]);
		},
		set_marker:function(myPoint) {
			// point
			if(myPoint.icone == 'standard'){
				var tinyIcon = new GIcon();
				/*tinyIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";*/
				tinyIcon.image = "/img/common/cars.png";
				tinyIcon.iconSize = new GSize(64, 18);
				tinyIcon.iconAnchor = new GPoint(6, 20);
				// Marker
				var myMarquer = new GMarker(new GLatLng(myPoint.coords[0],myPoint.coords[1]),{icon:tinyIcon});
				this.map.addOverlay(myMarquer);
				
				// lien sur icone
				if(myPoint.url != undefined )GEvent.addListener(myMarquer, "click", function() {
					window.location.href=myPoint.url;
				});
			}else{
				var tinyIcon = new GIcon();
				tinyIcon.image = myPoint.icone;
				//tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
				tinyIcon.iconSize = new GSize(117,98);
				tinyIcon.iconAnchor = new GPoint(6, 20);
				
				// Marker
				var myMarquer = new GMarker(new GLatLng(myPoint.coords[0],myPoint.coords[1]),{icon:tinyIcon});
				this.map.addOverlay(myMarquer);
				
				// lien sur icone
				if(myPoint.url != undefined )GEvent.addListener(myMarquer, "click", function() {
					window.location.href=myPoint.url;
				});
			}
		},
		set_map:function() {
			var ref = this;
			
			Event.observe(window,'load', function() {
				if (GBrowserIsCompatible()) {					
					ref.map = new GMap2($(ref.container))
					ref.map.setCenter(new GLatLng(ref.centre[0],ref.centre[1]),ref.centre[2]);
		
					// bar de controle: echelle
					ref.map.addControl(new GSmallMapControl());
					
					var mapControl = new GHierarchicalMapTypeControl();					
					mapControl.clearRelationships();
					ref.map.addControl(mapControl);
						
					// création des points
					ref.tabPoint.each(function(pt,p) {ref.set_marker(pt);})	
					
					// Fin de la cration de la Google Map
					setTimeout(function() {
						ref.finished = true;					
					},1500)
				};
			});
			Event.observe(window,'unload', function() {GUnload()});
		}
	};
			

