 //<![CDATA[





function createMarker(point, cp, ville, pays, pseudo, sexe, avatar,icone, shadow, photo, pense_jour, id, nb_annonce_cuistot, nb_annonce_client, nb_astuce, profil, distance, validation_photo) 
{

	 var MonIcon = new GIcon(); 
	 var annonce_cuistot="";
	 var annonce_client="";
	 var astuce="";
	  
	  MonIcon.image=icone;
	  MonIcon.shadow=shadow;
	  
	 //MonIcon.shadow = "img/purple-pushpin-s.png"; // Image "Ombre"
	 //MonIcon.shadowSize=new GSize(56,32); // Dimensions de l'image "Ombre"
	 MonIcon.iconSize=new GSize(32,32);
	 MonIcon.shadowSize = new GSize(49.0, 32.0);
	 MonIcon.iconAnchor=new GPoint(16,32);
	 MonIcon.infoWindowAnchor = new GPoint(16, 16);
	
	
	
	 var marker = new GMarker(point,MonIcon);
	

	
	/*//Afficher les onglets
	var infoTabs = [
					new GInfoWindowTab("Fiche" , "<div style='float:left;padding:10px'> <img src='" + photo + "' border='0' width='50' height='50'> </div> <div style='float:left;padding:10px '><h2> " +  pseudo + "</h2> <b>" + cp + " - " + ville + " - " + pays +"</b> <br/><br/> "+annonce+"<a href='layout.php?pg=voir_fiche&id="+ id +"'>Voir la fiche</a><br/>Nombre d'annonces : "+nb_annonce+" </div>")];
				
	
	//Ouvre la bulle au click
	GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowTabsHtml(infoTabs); });
	//GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});*/
	
	
	
			
	if(photo==""){		
			avatar=avatar;		
	}else{
		if(validation_photo==2){
			avatar=avatar;			
		}else{
			avatar="photos_abonnes/"+id+"/photo_abonne_recadrer.jpg";	
		}
	}
	
	
	
	
	if(nb_annonce_cuistot>0){                              
		if(profil==1){
			annonce_cuistot="<div onclick=\"document.location.href='home.php?pg=plats_proposes&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\" title='Voir les plats propos&eacute;s par "+pseudo+"' >- Plats propos&eacute;s : "+nb_annonce_cuistot+"</div>";
		}else if(profil==3){
			annonce_cuistot="<div onclick=\"document.location.href='home.php?pg=plats_proposes&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\" title='Voir les plats propos&eacute;s par "+pseudo+"' >- Plats propos&eacute;s : "+nb_annonce_cuistot+"</div>";
		}
	}
	
	if(nb_annonce_client>0){
		if(profil==2){
			annonce_client="<div onclick=\"document.location.href='home.php?pg=plats_recherches&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\" title='Voir les plats recherch&eacute;s par "+pseudo+"'>- Plats recherch&eacute;s : "+nb_annonce_client+"</div>";
		}else if(profil==3){
			annonce_client="<div onclick=\"document.location.href='home.php?pg=plats_recherches&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\" title='Voir les plats recherch&eacute;s par "+pseudo+"'>- Plats recherch&eacute;s : "+nb_annonce_client+"</div>";
		}
	}
	
	if(nb_astuce>0){
		astuce="<div onclick=\"document.location.href='home.php?pg=astuces&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\" title='Voir les astuces culinaires de "+pseudo+"' >- Astuces culinaires : "+nb_astuce+"</div>";
	}

	
	
	if(profil==1 || profil==3){
		var lien="plats_proposes";	
	}
	if(profil==2){
		var lien="plats_recherches";	
	}
	
	var infobulle="<div style='float:left;padding:5px;width:50px;height:50px;' onclick=\"document.location.href='home.php?pg="+lien+"&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\" > ";
	infobulle+="<img src='" + avatar + "' border='0' width='50' height='50' onclick=\"document.location.href='home.php?pg="+lien+"&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\">";
	infobulle+="</div> ";
	infobulle+="<div style='float:left;padding:0px; text-align:left '>";
	infobulle+="<div onclick=\"document.location.href='home.php?pg="+lien+"&id_voisin="+id+"&id_plat=&order=date&by=desc&l1=0'\" class=\"lien_bulle\" >";
	infobulle+="<h2> " +  pseudo + "</h2>";
	infobulle+="</div>";
	infobulle+="<b>" + cp + " - " + ville + "</b><br/><b> " + pays +"</b>";
	infobulle+="</div>";	
	infobulle+="</div>";
	infobulle+="<br style='clear:both' />";
	infobulle+="<br/><br/>";
	infobulle+="<div style='text-align:left;border-top: 1px solid #900;'>";
	infobulle+=""+annonce_cuistot+""+annonce_client+""+astuce+"";
	infobulle+="</div>";
	
	
	
	
	
	GEvent.addListener(marker, "click", function() {
              
				
				//eval(infobulle);
                marker.openInfoWindowHtml(infobulle);
    }); 
	
	
	GEvent.addListener(marker, "mouseover", function() {
               
				var index=icone.indexOf(".png")
				var icone_on=icone.substr(0,index)
				
				icone_on=icone_on+"_on.png";
				
				marker.setImage(icone_on);
				
				
				         
	}); 
	
	GEvent.addListener(marker, "mouseout", function() {
               
				
				 marker.setImage(icone);
				
				         
	}); 
	

	return marker;
}




function createMarkerLocalisation(point, icone, shadow, deplacable)
{


 var icon = new GIcon();
 
 //MonIcon.shadow = "img/purple-pushpin-s.png"; // Image "Ombre"
 //MonIcon.shadowSize=new GSize(56,32); // Dimensions de l'image "Ombre"
 icon.iconSize=new GSize(32,32);
 icon.shadowSize = new GSize(49.0, 32.0);
 icon.iconAnchor=new GPoint(16,32);
 icon.infoWindowAnchor = new GPoint(10, 10);
 icon.image=icone;
 icon.shadow=shadow;


 if(deplacable=="OUI"){
var marker = new GMarker(point, {icon:icon ,draggable: true});
GEvent.addListener(marker, "draggable", function() { map.closeInfoWindow(); });			
GEvent.addListener(marker, "dragend", function() {
											  var point = marker.getPoint();
											  //marker.openInfoWindowHtml("coord" + point);
											  var lat =point.lat();
											  var long=point.lng();
											  document.getElementById("latitude").value = lat;	
											  document.getElementById("longitude").value = long;
											
											  });

 }else{
	 var marker = new GMarker(point,icon); 
	
 }


return marker;
}



function createMarkerVoisin(lat,lng,icone,shadow)
{

  //clearMarkerVoisin(lat,lng);
 var point = new GLatLng(parseFloat(lat),parseFloat(lng));
         
 var icon = new GIcon();
  icone=icone.toString();

 var lenghticone=icone.length;
  

lenghticone=lenghticone-4;

 icone=icone.substring(0,lenghticone);
 icone=icone+"_on.png";

icon.image=icone;
icon.shadow=shadow;
	
	
	icon.iconSize=new GSize(32,32);
 	icon.iconAnchor=new GPoint(16,32);
 	icon.infoWindowAnchor = new GPoint(10, 10);
 
	icon.shadowSize = new GSize(49, 32);
   marker = new GMarker(point,icon); 
  


 map.addOverlay(marker,icon);
      

return marker;
	
	
}




function createMonMarker(lat,lng,icone,shadow)
{


 
 //clearMarkerVoisin(lat,lng);
 var point = new GLatLng(parseFloat(lat),parseFloat(lng));
         
 var icon = new GIcon();
  icone=icone.toString();

 var lenghticone=icone.length;
  

lenghticone=lenghticone-4;

 icone=icone.substring(0,lenghticone);
 icone=icone+"_on.png";

icon.image=icone;
icon.shadow=shadow;
	
	
	icon.iconSize=new GSize(32,32);
 	icon.iconAnchor=new GPoint(16,32);
 	icon.infoWindowAnchor = new GPoint(10, 10);
 
	icon.shadowSize = new GSize(49, 32);
   marker = new GMarker(point,icon); 
  


 map.addOverlay(marker,icon);
      

return marker;
	
	
}


function clearMarkerVoisin(lat,lng)
{
 

var point = new GLatLng(parseFloat(lat),parseFloat(lng));
map.removeOverlay(marker);
return marker;
	
}



function getAddress(overlay, latlng) {
  if (latlng != null) {
    address = latlng;
    geocoder.getLocations(latlng, showAddress);
  }
}



 //]]>









