
function init(pos_lat, pos_lng){

	var pos = {
			lat: pos_lat ,
			lng: pos_lng
		}


var lat, lon, _zoom;


	//default center of france
	lat = 46.92475 ;
	lon = 2.0517 ;
	_zoom = 6
	var position_latlng = new google.maps.LatLng(lat, lon);


	//options of the map
	var options = {
        center: position_latlng ,
        zoom: _zoom ,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        scrollwheel: true,
        draggable: true,
        disableDoubleClickZoom: true
    };


		//search the markup for insertion
    var map = new google.maps.Map(document.getElementById("ggmaps_map"), options);




var tMarker = [
	//for each
	{
		lat : 45.833608, //UserSchema.coord_lat,
		lon : 6.865089,	//UserSchema.coord_lng,
		title : "BigBeardShoes", //UserSchema.name,
		text : "Bienvenue dans le magasin au coeur du Mont-Blanc" //UserSchema.descr
	}
	//}
]
		//add marker
		// tMarker = array of
		createMarker( tMarker, map, pos);
}




function createMarker( tab, map, pos){
  var oLatLng, oMarker, data;
  var i, nb = tab.length;
  var contenu = "";
  var infowindow;

	if (pos.lat != undefined || pos.lng != undefined){
		oLatLng = new google.maps.LatLng(pos.lat, pos.lng);
		oMarker = new google.maps.Marker({
				position : oLatLng,
				map : map,
		})
	}


  for( i = 0; i < nb; i++){
    data = tab[i];
    oLatLng = new google.maps.LatLng( data.lat, data.lon);

    infowindow = new google.maps.InfoWindow();

    	oMarker = new google.maps.Marker({
      		position : oLatLng,
      		map : map,
      		title : data.title,
      		animation: google.maps.Animation.DROP,
      		icon : "img/marker.png"
    	})

		}






  contenu = contenu_texte(data.title, data.text);


	setEventMarker(oMarker,infowindow,contenu);

}


function contenu_texte(title, body){
	var ret;
	ret = '<h1 class= "ggmaps_entete">';
	ret += title;
	ret += '</h1>';

	ret += '<p class= "ggmaps_corps">';
	ret += body ;
	ret += '</p>' ;

	return ret;

}



function setEventMarker( oMarker, infowindow, text){
    google.maps.event.addListener( oMarker, 'click', function() {
    	// affectation du texte
    	infowindow.setContent( text);
    	// affichage InfoWindow
    	infowindow.open( this.getMap(), this);
    });
}


function handleLocationError(browserHasGeolocation, infoWindow, pos) {
	infoWindow.setPosition(pos);
	infoWindow.setContent(browserHasGeolocation ?
												'Error: The Geolocation service failed.' :
												'Error: Your browser doesn\'t support geolocation.');
	infoWindow.open(map);
}

@@ -599,19 +599,228 @@
 ions);%0A%0A
-%0A%0A%0A
+%09//*************************%0A%09// %C3%A0 suppr%0A%09var UserSchema = %7B%0A%09%09name : %22T%C3%AAte Biselx%22,%0A%09%09descr : %22je ne sais pas quoi dire%22,%0A%09%09coord_lat : 45.9842725 ,%0A%09%09coord_lng : 7.0294034%0A%09%7D;%0A%0A%0A%09//*************************%0A%0A%0A%09
 var tMar
@@ -830,16 +830,20 @@
  = %5B
+%5D;%0A%0A
 %0A%09//for 
 each
@@ -842,37 +842,138 @@
 for 
-each%0A%09
+UserSchema in User %7B%0A%09%09if (UserSchema.coord_lat != undefined %7C%7C UserSchema.coord_lng != undefined )%7B%0A%09%09%09tMarker.push (
 %7B%0A%09%09
+%09
+%09
 lat : 
-45.833608, //
 User
@@ -994,16 +994,18 @@
 at,%0A
+%09%09
 %09%09lon : 
 6.86
@@ -1004,20 +1004,8 @@
 n : 
-6.865089,%09//
 User
@@ -1024,24 +1024,26 @@
 _lng,%0A%09%09
+%09
+%09
 title : 
 %22BigBear
@@ -1038,27 +1038,8 @@
 e : 
-%22BigBeardShoes%22, //
 User
@@ -1051,16 +1051,18 @@
 a.name,%0A
+%09%09
 %09%09text :
@@ -1066,103 +1066,60 @@
 t : 
-%22Bienvenue dans le magasin au coeur du Mont-Blanc%22 //UserSchema.descr%0A%09%7D%0A%09//%7D%0A%5D%0A%09%09//add
+UserSchema.descr%0A%09%09%09%7D);%0A%09%09%7D%0A%09//%7D%0A%09//end list
  marker%0A
 %09%09//
@@ -1114,17 +1114,17 @@
  marker%0A
-%09
+%0A
 %09// tMar
@@ -1138,17 +1138,16 @@
 rray of%0A
-%09
 %09createM

modify to implement db correctly