var map = null;
var geocoder = null;

function load()
  {
  if (GBrowserIsCompatible())
    {
	// création de la carte
	var map = new GMap2(document.getElementById("map"));
	// ajout des contrôles
	//GEvent.addListener(map, "click", function() {alert("|"+map.getBounds().getSouthWest().lat()+"|"+map.getBounds().getNorthEast().lat()+"|"+map.getBounds().getSouthWest().lng()+"|"+map.getBounds().getNorthEast().lng());});
	map.addControl(new GLargeMapControl());
	map.addControl(new GScaleControl())      
	map.addControl(new GMapTypeControl());
	map.addControl(new GOverviewMapControl());
	// centrage
	map.setCenter(new GLatLng(47.2000, 6.0000), 9);
	// création des pictos avec ombre, icone...
	var baseIcon = new GIcon();
	baseIcon.iconSize = new GSize(31, 31);
	baseIcon.iconAnchor = new GPoint(18, 18);
	baseIcon.infoWindowAnchor = new GPoint(18, 15);
	// création de la frontière de la F-C
	var polyline = new GPolyline([new GLatLng(47.52091047852613, 7.130126953125),	new GLatLng(47.50978034953473, 7.12738037109375), new GLatLng(47.60060732292067, 7.06695556640625), new GLatLng(47.59875528481801, 7.020263671875), new GLatLng(47.64133557512159, 7.020263671875), new GLatLng(47.67833372712058, 7.04498291015625), new GLatLng(47.719001413201916, 7.03399658203125), new GLatLng(47.74855798927942, 7.0037841796875), new GLatLng(47.77440623229445, 6.90765380859375), new GLatLng(47.79655164755933, 6.85546875), new GLatLng(47.81315451752768, 6.84173583984375), new GLatLng(47.840814175074456, 6.80328369140625), new GLatLng(47.885038970041435, 6.690673828125), new GLatLng(47.923704717745686, 6.64398193359375), new GLatLng(47.94394667836211, 6.602783203125), new GLatLng(47.91450120703987, 6.56158447265625), new GLatLng(47.90161354142077, 6.52587890625), new GLatLng(47.892406101169264, 6.48193359375), new GLatLng(47.931066347509784, 6.448974609375), new GLatLng(47.94946583788702, 6.416015625), new GLatLng(47.96234158490351, 6.3555908203125), new GLatLng(47.94946583788702, 6.2896728515625), new GLatLng(47.94394667836211, 6.25396728515625), new GLatLng(47.938426929481054, 6.21002197265625), new GLatLng(47.96969771406487, 6.1578369140625), new GLatLng(48.00278733106708, 6.14959716796875), new GLatLng(48.02299832104887, 6.14410400390625), new GLatLng(48.021161285657804, 6.097412109375), new GLatLng(48.011975126709956, 6.05621337890625), new GLatLng(47.97889140226656, 6.02325439453125), new GLatLng(47.956823800497474, 6.009521484375), new GLatLng(47.95498440806741, 5.96282958984375), new GLatLng(47.96601978044178, 5.9490966796875), new GLatLng(47.97889140226656, 5.94085693359375), new GLatLng(47.94946583788702, 5.9051513671875), new GLatLng(47.923704717745686, 5.877685546875), new GLatLng(47.90161354142077, 5.877685546875), new GLatLng(47.907137219641115, 5.855712890625), new GLatLng(47.857402894658236, 5.82275390625), new GLatLng(47.855559965615484, 5.75958251953125), new GLatLng(47.82237604116143, 5.73211669921875), new GLatLng(47.82053186746053, 5.69366455078125),	new GLatLng(47.77256035513371, 5.67718505859375), new GLatLng(47.746711194756, 5.70465087890625), new GLatLng(47.69127688626756, 5.6854248046875), new GLatLng(47.67278567576541, 5.592041015625), new GLatLng(47.702368466573716, 5.570068359375), new GLatLng(47.6764844422132, 5.5206298828125), new GLatLng(47.68757916850813, 5.482177734375), new GLatLng(47.67278567576541, 5.4107666015625), new GLatLng(47.63763431783611, 5.3997802734375), new GLatLng(47.60986653003798, 5.36956787109375), new GLatLng(47.59690318115471, 5.40252685546875), new GLatLng(47.628380027447136, 5.4327392578125), new GLatLng(47.585789182379905, 5.47943115234375), new GLatLng(47.541309583656854, 5.4986572265625), new GLatLng(47.49493650511712, 5.438232421875), new GLatLng(47.49308072945064, 5.40252685546875), new GLatLng(47.45037978769006, 5.39154052734375), new GLatLng(47.44480754169437, 5.438232421875), new GLatLng(47.3834738721015, 5.44921875), new GLatLng(47.39091206104779, 5.50140380859375), new GLatLng(47.33137715779824, 5.4876708984375), new GLatLng(47.310896517807215, 5.47393798828125), new GLatLng(47.301584511330795, 5.5096435546875), new GLatLng(47.21210577562242, 5.482177734375), new GLatLng(47.13742464629386, 5.4327392578125), new GLatLng(47.09630525444073, 5.37506103515625), new GLatLng(47.05515408550348, 5.30364990234375), new GLatLng(47.02895043138593, 5.27069091796875), new GLatLng(47.01584377790818, 5.31463623046875), new GLatLng(46.97837846572262, 5.2569580078125), new GLatLng(46.937136280659246, 5.26519775390625), new GLatLng(46.937136280659246, 5.30364990234375), new GLatLng(46.89023157359399, 5.394287109375), new GLatLng(46.84328581149685, 5.4656982421875), new GLatLng(46.81509864599243, 5.3448486328125), new GLatLng(46.76620587423741, 5.3887939453125), new GLatLng(46.7360959377012, 5.35858154296875), new GLatLng(46.6965511173143, 5.40802001953125), new GLatLng(46.64377960861833, 5.438232421875), new GLatLng(46.609827858351025, 5.4052734375), new GLatLng(46.57585481240773, 5.35858154296875), new GLatLng(46.522965520307295, 5.3558349609375), new GLatLng(46.481373492133784, 5.41900634765625), new GLatLng(46.44731998341687, 5.3228759765625), new GLatLng(46.41892578708076, 5.30364990234375), new GLatLng(46.38672781370433, 5.36407470703125), new GLatLng(46.326068311712596, 5.4052734375), new GLatLng(46.31468715855948, 5.4547119140625), new GLatLng(46.27863122156088, 5.460205078125), new GLatLng(46.26724020382508, 5.526123046875), new GLatLng(46.28812192778069, 5.57830810546875), new GLatLng(46.32986150334176, 5.6414794921875), new GLatLng(46.3127900695348, 5.69366455078125), new GLatLng(46.280529494335575, 5.723876953125), new GLatLng(46.25964487666548, 5.73211669921875), new GLatLng(46.26913887119721, 5.855712890625), new GLatLng(46.30140615437332, 5.9381103515625), new GLatLng(46.36588370484979, 5.99853515625), new GLatLng(46.45299704748289, 6.08367919921875), new GLatLng(46.49650154751426, 6.10015869140625), new GLatLng(46.54752767224308, 6.163330078125), new GLatLng(46.58340621861241, 6.10565185546875), new GLatLng(46.777492763768294, 6.4599609375), new GLatLng(46.81509864599243, 6.43798828125), new GLatLng(46.85455653885574, 6.46820068359375), new GLatLng(46.93150988336929, 6.43524169921875), new GLatLng(46.97088225099078, 6.50115966796875), new GLatLng(47.034566583590426, 6.690673828125), new GLatLng(47.07012182383309, 6.70440673828125), new GLatLng(47.10004469402519, 6.74285888671875), new GLatLng(47.16357498846737, 6.85821533203125), new GLatLng(47.24381345414034, 6.95159912109375), new GLatLng(47.28854494625744, 6.94610595703125), new GLatLng(47.32393057095941, 7.0147705078125), new GLatLng(47.336961408985005, 7.05596923828125), new GLatLng(47.368594345213374, 7.02850341796875), new GLatLng(47.35371061951363, 6.8829345703125), new GLatLng(47.42622912485741, 6.9488525390625), new GLatLng(47.455951443369926, 7.00103759765625), new GLatLng(47.48565697095909, 6.998291015625), new GLatLng(47.50421439972969, 7.00103759765625), new GLatLng(47.49493650511712, 7.0697021484375), new GLatLng(47.49864785970502, 7.13287353515625),new GLatLng(47.52091047852613, 7.130126953125)], "#3D65EA", 3, 1);
	map.addOverlay(polyline);
	
	//get_donnees();
	
	// "écouteurs" sur les éléments du moteur de recherche
	/*var ToutesLesBalisesInput = document.getElementsByTagName('input');
	if(ToutesLesBalisesInput != null){
		for(var i = 0; i < ToutesLesBalisesInput.length; i++){
				ToutesLesBalisesInput[i].onclick=function(){get_donnees();}
				ToutesLesBalisesInput[i].onkeyup=function(){get_donnees();}
		}
	}*/
	
	// "écouteurs" sur les types de biens
	function decoche_pieces()
	  {
		document.form_recherche.nbr_pieces[0].checked=false;
		document.form_recherche.nbr_pieces[1].checked=false;
		document.form_recherche.nbr_pieces[2].checked=false;
		document.form_recherche.nbr_pieces[3].checked=false;
		document.form_recherche.nbr_pieces[4].checked=false;
		document.form_recherche.nbr_pieces[5].checked=false;
	  }
	document.form_recherche.type_bien[2].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[3].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[4].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[5].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[6].onclick=function(){decoche_pieces();}
	
	// "écouteur" sur le bouton valider
	document.getElementById('valider').onclick=function()
	  {
	  var message_no_checked = 'no';
	  if((document.form_recherche.type_transaction[0].checked==false && document.form_recherche.type_transaction[1].checked==false || document.form_recherche.type_bien[0].checked==false && document.form_recherche.type_bien[1].checked==false && document.form_recherche.type_bien[2].checked==false && document.form_recherche.type_bien[3].checked==false && document.form_recherche.type_bien[4].checked==false && document.form_recherche.type_bien[5].checked==false && document.form_recherche.type_bien[6].checked==false) && document.form_recherche.num_asp.value=="") {message_no_checked = "Merci de sélectionner un type de transaction et un type de bien."}
	  if(message_no_checked != 'no')
	    {
			alert(message_no_checked);
		} else {
			get_donnees();
		}
	  }
	  
	// "écouteurs" sur la carte si déplacement
	/*var infwindow="close"
	GEvent.addListener(map, "moveend", function() {
			//alert(map.getBounds().getCenter().lat()+"|"+map.getBounds().getCenter().lng()+"|"+map.getZoom());
			if(infwindow=="close") {get_donnees();}
		});
    GEvent.addListener(map, "infowindowopen", function() {infwindow="open";});
	GEvent.addListener(map, "infowindowclose", function() {infwindow="close";});*/
	
	// "écouteur" sur le Select des "quartiers" prédéfinis
	document.getElementById('quartier').onchange=function() {
		var movTo=this.value.split("|");
		map.setZoom(Number(movTo[2]));
		map.panTo(new GLatLng(Number(movTo[0]), Number(movTo[1])));
		//get_donnees();
	}
	
	// "écouteur" sur le bouton GO du Select des "quartiers" prédéfinis
	/*document.getElementById('movgo').onclick=function() {
		var movTo=document.getElementById('quartier').value.split("|");
		map.setZoom(Number(movTo[2]));
		map.panTo(new GLatLng(Number(movTo[0]), Number(movTo[1])));
		get_donnees();
	}*/
	
	
		
function objConnexion(){
	//on definie la fonction de traitement de la réponse
	this.callBack = function() {
		if (this.obj.readyState==4){
			if (this.obj.status == 200){
			  var result = this.obj.responseText;
			  var liste = "";
			  
			  map.clearOverlays();
			  map.addOverlay(polyline);
			  
			  var data =  result.split(":||:");
			  for (var i=0; i<data.length-1;i++) {
				 var detail =  data[i].split("|");
				 var point = new GLatLng(detail[0], detail[1]);
                 map.addOverlay(createMarker(point, detail[2], detail[3]));
				 liste += detail[4];
			  }
			  document.getElementById("liste_div").innerHTML=liste;
			  
			}else{
			  alert('Problème de connexion ');
		  }
		document.getElementById("chargement").style.display = 'none';
	  }
	}
	
	//
	try{
		this.obj = new ActiveXObject("Msxml2.XMLHTTP")
	}
	catch(e){
		try{
			this.obj = new ActiveXObject("Microsoft.XMLHTTP")
		}
		catch(oc){
			this.obj = null
		}		
	}
	if(!this.obj&&typeof XMLHttpRequest!="undefined")
		this.obj = new XMLHttpRequest()
		
	return this
}



// fonction crée l'url à interroger en fonction du moteur de recherche
function get_donnees() {
	document.getElementById("liste_div").innerHTML = '<img id="wait2" src="../img/geoloc-ajax-loader.gif" alt="" width="16" height="16" />';
	document.getElementById("chargement").style.display = 'inline';

	
	var url = 'httprequest-carte.php?type_transaction=';
	
	transaction=document.form_recherche.type_transaction;
	for (var i=0; i<transaction.length;i++) {
         if (transaction[i].checked) {
            url += transaction[i].value;
         }
      }
	
	biens=document.form_recherche.type_bien;
	var first=true;
	for (var i=0; i<biens.length;i++) {
		if (biens[i].checked) {
			if(first==true) {url += "&type_bien=";} else {url += ",";}
			url += biens[i].value;
			first=false;
         }
      }
	
	pieces=document.form_recherche.nbr_pieces;
	var first=true;
	for (var i=0; i<pieces.length;i++) {
		if (pieces[i].checked) {
			if(first==true) {url += "&nbr_pieces=";} else {url += ",";}
			url += pieces[i].value;
			first=false;
         }
      }
	
	budget_mini=document.form_recherche.budget_mini.value;
	if (budget_mini!="") {url += "&budget_mini="+budget_mini;}
	
	budget_maxi=document.form_recherche.budget_maxi.value;
	if (budget_maxi!="") {url += "&budget_maxi="+budget_maxi;}
	
	url += "&map_north_east_lat="+map.getBounds().getNorthEast().lat()+"&map_north_east_lng="+map.getBounds().getNorthEast().lng()+"&map_south_west_lat="+map.getBounds().getSouthWest().lat()+"&map_south_west_lng="+map.getBounds().getSouthWest().lng()+"&num_asp="+document.form_recherche.num_asp.value;
	//connexion asynchrone au serveur pour recuperer les données des biens trouvés
	connexion_asc(url);
}



// fonction de création des marqueurs
function createMarker(point, info2, info3)
		  {
		  var icon = new GIcon(baseIcon);
		  icon.image = "./img/marker_css.png";
		  var marker = new GMarker(point, icon);
		  
		  GEvent.addListener(marker, "click", function() {
		  marker.openInfoWindowHtml("<span class='msg-info'>"+info2+"</span>");
		    });
		  return marker;
		  }


// fonction qui interroge l'URL
function connexion_asc(url) {
	var methode = "GET";
	var asynchrone = true;
	var httpRequest = new objConnexion();
	
	if (httpRequest) {
    try{
	    var _this = httpRequest;
			//Appel de la fonction de callback quand l'objet XMLHTTPRequest change de status
			httpRequest.obj.onreadystatechange = function() {
				//alert(_this);
				_this.callBack();
			}
	  	httpRequest.obj.open(methode, url, asynchrone);
    	httpRequest.obj.send(null);
			
    }catch(oe){
    }
	}
}
}}





function load_alerte()
  { 
  if(GBrowserIsCompatible())
    {
	// création de la carte
	var map = new GMap2(document.getElementById("map"));
	// centrage
	map.setCenter(new GLatLng(47.2000, 6.0000), 9);
	map.disableDragging();
	// création des pictos avec ombre, icone...
	var baseIcon = new GIcon();
	baseIcon.iconSize = new GSize(34, 34);
	baseIcon.iconAnchor = new GPoint(18, 18);
	baseIcon.infoWindowAnchor = new GPoint(18, 15);
	// création de la frontière de la F-C
	var polyline = new GPolyline([new GLatLng(47.52091047852613, 7.130126953125),	new GLatLng(47.50978034953473, 7.12738037109375), new GLatLng(47.60060732292067, 7.06695556640625), new GLatLng(47.59875528481801, 7.020263671875), new GLatLng(47.64133557512159, 7.020263671875), new GLatLng(47.67833372712058, 7.04498291015625), new GLatLng(47.719001413201916, 7.03399658203125), new GLatLng(47.74855798927942, 7.0037841796875), new GLatLng(47.77440623229445, 6.90765380859375), new GLatLng(47.79655164755933, 6.85546875), new GLatLng(47.81315451752768, 6.84173583984375), new GLatLng(47.840814175074456, 6.80328369140625), new GLatLng(47.885038970041435, 6.690673828125), new GLatLng(47.923704717745686, 6.64398193359375), new GLatLng(47.94394667836211, 6.602783203125), new GLatLng(47.91450120703987, 6.56158447265625), new GLatLng(47.90161354142077, 6.52587890625), new GLatLng(47.892406101169264, 6.48193359375), new GLatLng(47.931066347509784, 6.448974609375), new GLatLng(47.94946583788702, 6.416015625), new GLatLng(47.96234158490351, 6.3555908203125), new GLatLng(47.94946583788702, 6.2896728515625), new GLatLng(47.94394667836211, 6.25396728515625), new GLatLng(47.938426929481054, 6.21002197265625), new GLatLng(47.96969771406487, 6.1578369140625), new GLatLng(48.00278733106708, 6.14959716796875), new GLatLng(48.02299832104887, 6.14410400390625), new GLatLng(48.021161285657804, 6.097412109375), new GLatLng(48.011975126709956, 6.05621337890625), new GLatLng(47.97889140226656, 6.02325439453125), new GLatLng(47.956823800497474, 6.009521484375), new GLatLng(47.95498440806741, 5.96282958984375), new GLatLng(47.96601978044178, 5.9490966796875), new GLatLng(47.97889140226656, 5.94085693359375), new GLatLng(47.94946583788702, 5.9051513671875), new GLatLng(47.923704717745686, 5.877685546875), new GLatLng(47.90161354142077, 5.877685546875), new GLatLng(47.907137219641115, 5.855712890625), new GLatLng(47.857402894658236, 5.82275390625), new GLatLng(47.855559965615484, 5.75958251953125), new GLatLng(47.82237604116143, 5.73211669921875), new GLatLng(47.82053186746053, 5.69366455078125),	new GLatLng(47.77256035513371, 5.67718505859375), new GLatLng(47.746711194756, 5.70465087890625), new GLatLng(47.69127688626756, 5.6854248046875), new GLatLng(47.67278567576541, 5.592041015625), new GLatLng(47.702368466573716, 5.570068359375), new GLatLng(47.6764844422132, 5.5206298828125), new GLatLng(47.68757916850813, 5.482177734375), new GLatLng(47.67278567576541, 5.4107666015625), new GLatLng(47.63763431783611, 5.3997802734375), new GLatLng(47.60986653003798, 5.36956787109375), new GLatLng(47.59690318115471, 5.40252685546875), new GLatLng(47.628380027447136, 5.4327392578125), new GLatLng(47.585789182379905, 5.47943115234375), new GLatLng(47.541309583656854, 5.4986572265625), new GLatLng(47.49493650511712, 5.438232421875), new GLatLng(47.49308072945064, 5.40252685546875), new GLatLng(47.45037978769006, 5.39154052734375), new GLatLng(47.44480754169437, 5.438232421875), new GLatLng(47.3834738721015, 5.44921875), new GLatLng(47.39091206104779, 5.50140380859375), new GLatLng(47.33137715779824, 5.4876708984375), new GLatLng(47.310896517807215, 5.47393798828125), new GLatLng(47.301584511330795, 5.5096435546875), new GLatLng(47.21210577562242, 5.482177734375), new GLatLng(47.13742464629386, 5.4327392578125), new GLatLng(47.09630525444073, 5.37506103515625), new GLatLng(47.05515408550348, 5.30364990234375), new GLatLng(47.02895043138593, 5.27069091796875), new GLatLng(47.01584377790818, 5.31463623046875), new GLatLng(46.97837846572262, 5.2569580078125), new GLatLng(46.937136280659246, 5.26519775390625), new GLatLng(46.937136280659246, 5.30364990234375), new GLatLng(46.89023157359399, 5.394287109375), new GLatLng(46.84328581149685, 5.4656982421875), new GLatLng(46.81509864599243, 5.3448486328125), new GLatLng(46.76620587423741, 5.3887939453125), new GLatLng(46.7360959377012, 5.35858154296875), new GLatLng(46.6965511173143, 5.40802001953125), new GLatLng(46.64377960861833, 5.438232421875), new GLatLng(46.609827858351025, 5.4052734375), new GLatLng(46.57585481240773, 5.35858154296875), new GLatLng(46.522965520307295, 5.3558349609375), new GLatLng(46.481373492133784, 5.41900634765625), new GLatLng(46.44731998341687, 5.3228759765625), new GLatLng(46.41892578708076, 5.30364990234375), new GLatLng(46.38672781370433, 5.36407470703125), new GLatLng(46.326068311712596, 5.4052734375), new GLatLng(46.31468715855948, 5.4547119140625), new GLatLng(46.27863122156088, 5.460205078125), new GLatLng(46.26724020382508, 5.526123046875), new GLatLng(46.28812192778069, 5.57830810546875), new GLatLng(46.32986150334176, 5.6414794921875), new GLatLng(46.3127900695348, 5.69366455078125), new GLatLng(46.280529494335575, 5.723876953125), new GLatLng(46.25964487666548, 5.73211669921875), new GLatLng(46.26913887119721, 5.855712890625), new GLatLng(46.30140615437332, 5.9381103515625), new GLatLng(46.36588370484979, 5.99853515625), new GLatLng(46.45299704748289, 6.08367919921875), new GLatLng(46.49650154751426, 6.10015869140625), new GLatLng(46.54752767224308, 6.163330078125), new GLatLng(46.58340621861241, 6.10565185546875), new GLatLng(46.777492763768294, 6.4599609375), new GLatLng(46.81509864599243, 6.43798828125), new GLatLng(46.85455653885574, 6.46820068359375), new GLatLng(46.93150988336929, 6.43524169921875), new GLatLng(46.97088225099078, 6.50115966796875), new GLatLng(47.034566583590426, 6.690673828125), new GLatLng(47.07012182383309, 6.70440673828125), new GLatLng(47.10004469402519, 6.74285888671875), new GLatLng(47.16357498846737, 6.85821533203125), new GLatLng(47.24381345414034, 6.95159912109375), new GLatLng(47.28854494625744, 6.94610595703125), new GLatLng(47.32393057095941, 7.0147705078125), new GLatLng(47.336961408985005, 7.05596923828125), new GLatLng(47.368594345213374, 7.02850341796875), new GLatLng(47.35371061951363, 6.8829345703125), new GLatLng(47.42622912485741, 6.9488525390625), new GLatLng(47.455951443369926, 7.00103759765625), new GLatLng(47.48565697095909, 6.998291015625), new GLatLng(47.50421439972969, 7.00103759765625), new GLatLng(47.49493650511712, 7.0697021484375), new GLatLng(47.49864785970502, 7.13287353515625),new GLatLng(47.52091047852613, 7.130126953125)], "#3D65EA", 3, 1);
	map.addOverlay(polyline);
		
	// "écouteurs" sur les types de biens
	function decoche_pieces()
	  {
		document.form_recherche.nbr_pieces[0].checked=false;
		document.form_recherche.nbr_pieces[1].checked=false;
		document.form_recherche.nbr_pieces[2].checked=false;
		document.form_recherche.nbr_pieces[3].checked=false;
		document.form_recherche.nbr_pieces[4].checked=false;
		document.form_recherche.nbr_pieces[5].checked=false;
	  }
	document.form_recherche.type_bien[2].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[3].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[4].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[5].onclick=function(){decoche_pieces();}
	document.form_recherche.type_bien[6].onclick=function(){decoche_pieces();}
	
	
	// "écouteur" sur le bouton valider
	document.getElementById('valider').onclick=function()
	  {
	  //var regex = new RegExp(/^(01|02|03|04|05|06|08)(([\.\-\/])?[0-9][0-9]){4}/gi);
	  var regex = new RegExp(/^(06)(([\.\-\/])?[0-9][0-9]){4}/gi);
	  var message_no_checked = 'no';
	  if(document.form_recherche.type_transaction[0].checked==false && document.form_recherche.type_transaction[1].checked==false || document.form_recherche.type_bien[0].checked==false && document.form_recherche.type_bien[1].checked==false && document.form_recherche.type_bien[2].checked==false && document.form_recherche.type_bien[3].checked==false && document.form_recherche.type_bien[4].checked==false && document.form_recherche.type_bien[5].checked==false && document.form_recherche.type_bien[6].checked==false || document.form_recherche.nom_alerte.value=="" || regex.test(document.form_recherche.tel_user.value)==false && document.form_recherche.email_user.value=="") {message_no_checked = "Merci de sélectionner :";}
	  if(document.form_recherche.type_transaction[0].checked==false && document.form_recherche.type_transaction[1].checked==false) {message_no_checked += "\nun type de transaction";}
	  if(document.form_recherche.type_bien[0].checked==false && document.form_recherche.type_bien[1].checked==false && document.form_recherche.type_bien[2].checked==false && document.form_recherche.type_bien[3].checked==false && document.form_recherche.type_bien[4].checked==false && document.form_recherche.type_bien[5].checked==false && document.form_recherche.type_bien[6].checked==false) {message_no_checked += "\nun type de bien";}
	  if(document.form_recherche.nom_alerte.value=="") {message_no_checked += "\nun nom d'alerte";}
	  var regex = new RegExp(/^(06)(([\.\-\/])?[0-9][0-9]){4}/gi);
	  if(regex.test(document.form_recherche.tel_user.value)==false && document.form_recherche.email_user.value=="") {message_no_checked += "\nun email et/ou un numéro de mobile valide";}
	  
	  if(message_no_checked != 'no')
	    {
			alert(message_no_checked);
		} else {
			document.form_recherche.submit();
		}
	  }
	
	// "écouteur" sur le Select des "quartiers" prédéfinis
	document.getElementById('quartier').onchange=function() {
		var movTo=this.value.split("|");
		map.setZoom(Number(movTo[2]));
		map.panTo(new GLatLng(Number(movTo[0]), Number(movTo[1])));
	}

var movTo=document.getElementById('quartier').value.split("|");
map.setZoom(Number(movTo[2]));
map.panTo(new GLatLng(Number(movTo[0]), Number(movTo[1])));
}}