var map;
var geocoder;

function setPoint(address, myTitre, myHtmlText, idMarker, numDomaine)
{
	
	geocoder.getLatLng(address+" FRANCE",function(point) 
	{
		if (point) 
		{ 	
			var baseIcon = new GIcon();
			
			baseIcon.image = "img/bout_0"+numDomaine+".png";

			baseIcon.iconSize = new GSize(31,30);
			baseIcon.shadowSize = new GSize(0,0);
			baseIcon.iconAnchor = new GPoint(25,20);
			baseIcon.infoWindowAnchor = new GPoint(15,10);
			baseIcon.infoShadowAnchor = new GPoint(15,10);
		
			var marker = new GMarker(point, baseIcon);
				
			GEvent.addListener(marker,"click",function() 
			{
				marker.openInfoWindowHtml("<br/><span style='font-size:12px;font-style:arial'><b>"+ myTitre +"</b>" + "<br/><br/>" + myHtmlText+"</span");
			});
				
			map.addOverlay(marker);
		}

	});
}

function changeFiltre(catPrincipale)
{
	var listeSousCategories = document.getElementById('SousCat');
	var sousCategerie = '';

	switch (catPrincipale)
	{
		case 1: { listeSousCategories.style.display = 'block'; sousCategerie = listeSousCategories.value; } break;
		case 2: { listeSousCategories.style.display = 'none';  } break;
		case 3: { listeSousCategories.style.display = 'none';  } break;
		case 4: { listeSousCategories.style.display = 'none'; } break;
		case 5: { listeSousCategories.style.display = 'none'; } break;
	}
	
	map.clearOverlays();

	xajax_changeFiltre(catPrincipale, sousCategerie);
	
}




function onPageLoad() 
{
  if (GBrowserIsCompatible()) 
  {
   	 geocoder = new GClientGeocoder();
	 map = new GMap2(document.getElementById("map"));
	 
	 map.setCenter(new GLatLng(47.0667000, -1.5833330), 7);
	 map.addControl(new GLargeMapControl());
	 map.addControl(new GMapTypeControl());
  }
}
