
var icon_100 = new GIcon();
icon_100.image = "http://www.gelules.tv/ICO_100.png";
icon_100.iconSize = new GSize(30, 30);
icon_100.iconAnchor = new GPoint(8, 28);
icon_100.infoWindowAnchor = new GPoint(8, 8);

var icon_101 = new GIcon();
icon_101.image = "http://www.gelules.tv/ICO_101.png";
icon_101.iconSize = new GSize(30, 30);
icon_101.iconAnchor = new GPoint(8, 28);
icon_101.infoWindowAnchor = new GPoint(8, 8);

var icon_102 = new GIcon();
icon_102.image = "http://www.gelules.tv/ICO_102.png";
icon_102.iconSize = new GSize(30, 30);
icon_102.iconAnchor = new GPoint(8, 28);
icon_102.infoWindowAnchor = new GPoint(8, 8);

var icon_103 = new GIcon();
icon_103.image = "http://www.gelules.tv/ICO_103.png";
icon_103.iconSize = new GSize(30, 30);
icon_103.iconAnchor = new GPoint(8, 28);
icon_103.infoWindowAnchor = new GPoint(8, 8);

var icon_104 = new GIcon();
icon_104.image = "http://www.gelules.tv/ICO_104.png";
icon_104.iconSize = new GSize(30, 30);
icon_104.iconAnchor = new GPoint(8, 28);
icon_104.infoWindowAnchor = new GPoint(8, 8);

var icon_105 = new GIcon();
icon_105.image = "http://www.gelules.tv/ICO_105.png";
icon_105.iconSize = new GSize(30, 30);
icon_105.iconAnchor = new GPoint(8, 28);
icon_105.infoWindowAnchor = new GPoint(8, 8);

var icon_106 = new GIcon();
icon_106.image = "http://www.gelules.tv/ICO_106.png";
icon_106.iconSize = new GSize(30, 30);
icon_106.iconAnchor = new GPoint(8, 28);
icon_106.infoWindowAnchor = new GPoint(8, 8);

var icon_107 = new GIcon();
icon_107.image = "http://www.gelules.tv/ICO_107.png";
icon_107.iconSize = new GSize(30, 30);
icon_107.iconAnchor = new GPoint(8, 28);
icon_107.infoWindowAnchor = new GPoint(8, 8);

var icon_108 = new GIcon();
icon_108.image = "http://www.gelules.tv/ICO_108.png";
icon_108.iconSize = new GSize(30, 30);
icon_108.iconAnchor = new GPoint(8, 28);
icon_108.infoWindowAnchor = new GPoint(8, 8);

var icon_109 = new GIcon();
icon_109.image = "http://www.gelules.tv/ICO_109.png";
icon_109.iconSize = new GSize(30, 30);
icon_109.iconAnchor = new GPoint(8, 28);
icon_109.infoWindowAnchor = new GPoint(8, 8);

var icon_110 = new GIcon();
icon_110.image = "http://www.gelules.tv/ICO_110.png";
icon_110.iconSize = new GSize(30, 30);
icon_110.iconAnchor = new GPoint(8, 28);
icon_110.infoWindowAnchor = new GPoint(8, 8);

var icon_111 = new GIcon();
icon_111.image = "http://www.gelules.tv/ICO_111.png";
icon_111.iconSize = new GSize(30, 30);
icon_111.iconAnchor = new GPoint(8, 28);
icon_111.infoWindowAnchor = new GPoint(8, 8);

var icon_112 = new GIcon();
icon_112.image = "http://www.gelules.tv/ICO_112.png";
icon_112.iconSize = new GSize(30, 30);
icon_112.iconAnchor = new GPoint(8, 28);
icon_112.infoWindowAnchor = new GPoint(8, 8);

var icon_113 = new GIcon();
icon_113.image = "http://www.gelules.tv/ICO_113.png";
icon_113.iconSize = new GSize(30, 30);
icon_113.iconAnchor = new GPoint(8, 28);
icon_113.infoWindowAnchor = new GPoint(8, 8);

var icon_114 = new GIcon();
icon_114.image = "http://www.gelules.tv/ICO_114.png";
icon_114.iconSize = new GSize(30, 30);
icon_114.iconAnchor = new GPoint(8, 28);
icon_114.infoWindowAnchor = new GPoint(8, 8);

var icon_115 = new GIcon();
icon_115.image = "http://www.gelules.tv/ICO_115.png";
icon_115.iconSize = new GSize(30, 30);
icon_115.iconAnchor = new GPoint(8, 28);
icon_115.infoWindowAnchor = new GPoint(8, 8);

var icon_116 = new GIcon();
icon_116.image = "http://www.gelules.tv/ICO_116.png";
icon_116.iconSize = new GSize(30, 30);
icon_116.iconAnchor = new GPoint(8, 28);
icon_116.infoWindowAnchor = new GPoint(8, 8);

var icon_117 = new GIcon();
icon_117.image = "http://www.gelules.tv/ICO_117.png";
icon_117.iconSize = new GSize(30, 30);
icon_117.iconAnchor = new GPoint(8, 28);
icon_117.infoWindowAnchor = new GPoint(8, 8);

var icon_118 = new GIcon();
icon_118.image = "http://www.gelules.tv/ICO_118.png";
icon_118.iconSize = new GSize(30, 30);
icon_118.iconAnchor = new GPoint(8, 28);
icon_118.infoWindowAnchor = new GPoint(8, 8);

var icon_119 = new GIcon();
icon_119.image = "http://www.gelules.tv/ICO_119.png";
icon_119.iconSize = new GSize(30, 30);
icon_119.iconAnchor = new GPoint(8, 28);
icon_119.infoWindowAnchor = new GPoint(8, 8);



var icon_con_J = new GIcon();
icon_con_J.image = "http://www.gelules.tv/ICO_concert_J.png";
icon_con_J.iconSize = new GSize(41, 51);
icon_con_J.iconAnchor = new GPoint(8, 28);
icon_con_J.infoWindowAnchor = new GPoint(8, 8);

var icon_con_N = new GIcon();
icon_con_N.image = "http://www.gelules.tv/ICO_concert_N.png";
icon_con_N.iconSize = new GSize(41, 51);
icon_con_N.iconAnchor = new GPoint(8, 28);
icon_con_N.infoWindowAnchor = new GPoint(8, 8);

var icon_spe_J = new GIcon();
icon_spe_J.image = "http://www.gelules.tv/ICO_spectacle_J.png";
icon_spe_J.iconSize = new GSize(41, 51);
icon_spe_J.iconAnchor = new GPoint(8, 28);
icon_spe_J.infoWindowAnchor = new GPoint(8, 8);

var icon_spe_N = new GIcon();
icon_spe_N.image = "http://www.gelules.tv/ICO_spectacle_N.png";
icon_spe_N.iconSize = new GSize(41, 51);
icon_spe_N.iconAnchor = new GPoint(8, 28);
icon_spe_N.infoWindowAnchor = new GPoint(8, 8);

var icon_the_J = new GIcon();
icon_the_J.image = "http://www.gelules.tv/ICO_theatre_J.png";
icon_the_J.iconSize = new GSize(41, 51);
icon_the_J.iconAnchor = new GPoint(8, 28);
icon_the_J.infoWindowAnchor = new GPoint(8, 8);

var icon_the_N = new GIcon();
icon_the_N.image = "http://www.gelules.tv/ICO_theatre_N.png";
icon_the_N.iconSize = new GSize(41, 51);
icon_the_N.iconAnchor = new GPoint(8, 28);
icon_the_N.infoWindowAnchor = new GPoint(8, 8);

var icon_conf_J = new GIcon();
icon_conf_J.image = "http://www.gelules.tv/ICO_conference_J.png";
icon_conf_J.iconSize = new GSize(41, 51);
icon_conf_J.iconAnchor = new GPoint(8, 28);
icon_conf_J.infoWindowAnchor = new GPoint(8, 8);

var icon_conf_N = new GIcon();
icon_conf_N.image = "http://www.gelules.tv/ICO_conference_N.png";
icon_conf_N.iconSize = new GSize(41, 51);
icon_conf_N.iconAnchor = new GPoint(8, 28);
icon_conf_N.infoWindowAnchor = new GPoint(8, 8);

var icon_sal_J = new GIcon();
icon_sal_J.image = "http://www.gelules.tv/ICO_salon_J.png";
icon_sal_J.iconSize = new GSize(41, 51);
icon_sal_J.iconAnchor = new GPoint(8, 28);
icon_sal_J.infoWindowAnchor = new GPoint(8, 8);

var icon_sal_N = new GIcon();
icon_sal_N.image = "http://www.gelules.tv/ICO_salon_N.png";
icon_sal_N.iconSize = new GSize(41, 51);
icon_sal_N.iconAnchor = new GPoint(8, 28);
icon_sal_N.infoWindowAnchor = new GPoint(8, 8);

var icon_pouv_J = new GIcon();
icon_pouv_J.image = "http://www.gelules.tv/ICO_porteouverte_J.png";
icon_pouv_J.iconSize = new GSize(41, 51);
icon_pouv_J.iconAnchor = new GPoint(8, 28);
icon_pouv_J.infoWindowAnchor = new GPoint(8, 8);

var icon_pouv_N = new GIcon();
icon_pouv_N.image = "http://www.gelules.tv/ICO_porteouverte_N.png";
icon_pouv_N.iconSize = new GSize(41, 51);
icon_pouv_N.iconAnchor = new GPoint(8, 28);
icon_pouv_N.infoWindowAnchor = new GPoint(8, 8);

var icon_exp_J = new GIcon();
icon_exp_J.image = "http://www.gelules.tv/ICO_expo_J.png";
icon_exp_J.iconSize = new GSize(41, 51);
icon_exp_J.iconAnchor = new GPoint(8, 28);
icon_exp_J.infoWindowAnchor = new GPoint(8, 8);

var icon_spo_J = new GIcon();
icon_spo_J.image = "http://www.gelules.tv/ICO_sport_J.png";
icon_spo_J.iconSize = new GSize(41, 51);
icon_spo_J.iconAnchor = new GPoint(8, 28);
icon_spo_J.infoWindowAnchor = new GPoint(8, 8);

var icon_spo_N = new GIcon();
icon_spo_N.image = "http://www.gelules.tv/ICO_sport_N.png";
icon_spo_N.iconSize = new GSize(41, 51);
icon_spo_N.iconAnchor = new GPoint(8, 28);
icon_spo_N.infoWindowAnchor = new GPoint(8, 8);

var icon_vgu_J = new GIcon();
icon_vgu_J.image = "http://www.gelules.tv/ICO_visiteguidee_J.png";
icon_vgu_J.iconSize = new GSize(41, 51);
icon_vgu_J.iconAnchor = new GPoint(8, 28);
icon_vgu_J.infoWindowAnchor = new GPoint(8, 8);

var icon_vgu_N = new GIcon();
icon_vgu_N.image = "http://www.gelules.tv/ICO_visiteguidee_N.png";
icon_vgu_N.iconSize = new GSize(41, 51);
icon_vgu_N.iconAnchor = new GPoint(8, 28);
icon_vgu_N.infoWindowAnchor = new GPoint(8, 8);

var icon_foi_J = new GIcon();
icon_foi_J.image = "http://www.gelules.tv/ICO_foire_J.png"; 
icon_foi_J.iconSize = new GSize(41, 51);
icon_foi_J.iconAnchor = new GPoint(8, 28);
icon_foi_J.infoWindowAnchor = new GPoint(8, 8);

var icon_foi_N = new GIcon();
icon_foi_N.image = "http://www.gelules.tv/ICO_foire_N.png";
icon_foi_N.iconSize = new GSize(41, 51);
icon_foi_N.iconAnchor = new GPoint(8, 28);
icon_foi_N.infoWindowAnchor = new GPoint(8, 8);

var icon_aut_J = new GIcon();
icon_aut_J.image = "http://www.gelules.tv/ICO_autre_J.png";
icon_aut_J.iconSize = new GSize(41, 51);
icon_aut_J.iconAnchor = new GPoint(8, 28);
icon_aut_J.infoWindowAnchor = new GPoint(8, 8);

var icon_aut_N = new GIcon();
icon_aut_N.image = "http://www.gelules.tv/ICO_autre_N.png";
icon_aut_N.iconSize = new GSize(41, 51);
icon_aut_N.iconAnchor = new GPoint(8, 28);
icon_aut_N.infoWindowAnchor = new GPoint(8, 8);

var icon_prm_J = new GIcon();
icon_prm_J.image = "http://www.gelules.tv/ICO_promo_J.png";
icon_prm_J.iconSize = new GSize(41, 51);
icon_prm_J.iconAnchor = new GPoint(8, 28);
icon_prm_J.infoWindowAnchor = new GPoint(8, 8);

var icon_ici = new GIcon();
icon_ici.image = "http://www.gelules.tv/ico_ici.png";
icon_ici.shadow = "http://www.gelules.tv/ico_ici_sd.png";
icon_ici.shadowSize = new GSize(35, 35);
icon_ici.iconSize = new GSize(35, 35);
icon_ici.iconAnchor = new GPoint(8, 28);
icon_ici.infoWindowAnchor = new GPoint(8, 8);

var map; 
var LALISTE=new Array();

function load() {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("mapch"));
	map.setCenter(new GLatLng(45.6190751977781,5.881805419921876), 12);
	map.addControl(new GLargeMapControl());
	map.setMapType(G_PHYSICAL_MAP);
  }
}
function loadat(lat,lng) {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("mapch"));
	map.setCenter(new GLatLng(lat,lng), 14);
	map.addControl(new GLargeMapControl());
	map.setMapType(G_PHYSICAL_MAP);
  }
}

function loadit() {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("mapit"));
	map.setCenter(new GLatLng(45.6190751977781,5.881805419921876), 12);
	map.addControl(new GLargeMapControl());
	map.setMapType(G_NORMAL_MAP);
  }
}

function loadTO(LAT,LNG,ZOOM) {
  if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("mapch"));
	map.setCenter(new GLatLng(LAT,LNG), ZOOM);
	map.addControl(new GLargeMapControl());
  }
}

function GetLimites()
{
var limites= map.getBounds();	
var sw=limites.getSouthWest();
var ne=limites.getNorthEast();
var leslimites=new Array(sw.lng(),ne.lng(),ne.lat(),sw.lat());
return leslimites;
}

function AddMark(Lat,Long)
{
	markerOptions = { icon:icon_ici };
	map.addOverlay(new GMarker(new GLatLng(Lat,Long), markerOptions));	
}

function AddOne(Lat,Long,Idweb,type,horaire,lieu)
{
//alert(type+':'+horaire);
var markerOptions = { icon:icon_aut_J };
if(horaire!=100)
{
switch (type) {
	case "CONCERT":
	markerOptions = { icon:icon_con_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_con_N };
	break;
	case "MUSIQUE":
	markerOptions = { icon:icon_con_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_con_N };
	break;
	case "SPECTACLE":
	markerOptions = { icon:icon_spe_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_spe_N };
	break;
	case "DANSE":
	markerOptions = { icon:icon_spe_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_spe_N };
	break;
	case "THEATRE":
	markerOptions = { icon:icon_the_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_the_N };
	break;
	case "CONFERENCE":
	markerOptions = { icon:icon_conf_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_conf_N };
	break;
	case "CONFERENCES":
	markerOptions = { icon:icon_conf_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_conf_N };
	break;
	case "SALON":
	markerOptions = { icon:icon_sal_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_sal_N };
	break;
		case "PORTE OUVERTE":
	markerOptions = { icon:icon_pouv_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_pouv_N };
	break;
		case "EXPOSITION":
	markerOptions = { icon:icon_exp_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_exp_N };
	break;
		case "EXPOSITIONS":
	markerOptions = { icon:icon_exp_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_exp_N };
	break;
		case "SPORT":
	markerOptions = { icon:icon_spo_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_spo_N };
	break;
		case "SPORTS":
	markerOptions = { icon:icon_spo_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_spo_N };
	break;
		case "VISITE GUIDEE":
	markerOptions = { icon:icon_vgu_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_vgu_N };
	break;
		case "VISITES GUIDEES":
	markerOptions = { icon:icon_vgu_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_vgu_N };
	break;
		case "FOIRE BRADERIE":
	markerOptions = { icon:icon_foi_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_foi_N };
	break;
		case "COMMERCE : Promotion commerciale":
	markerOptions = { icon:icon_prm_J };
	break;
		case "DIVERS":
	markerOptions = { icon:icon_aut_J };
	if(horaire=="SOIREE") markerOptions = { icon:icon_aut_N };
	break;
	}
}
	else
	{
		switch (type) {
		case "Particulier":
	markerOptions = { icon:icon_100 };
	break;		
		case "Artisan":
	markerOptions = { icon:icon_101 };
	break;		
		case "Commercant":
	markerOptions = { icon:icon_102 };
	break;		
		case "Entreprise":
	markerOptions = { icon:icon_103 };
	break;		
		case "Club Sportif":
	markerOptions = { icon:icon_104 };
	break;		
		case "Association":
	markerOptions = { icon:icon_105 };
	break;		
		case "Adminsitration":
	markerOptions = { icon:icon_106 }; //ok
	break;		
		case "Restaurant":
	markerOptions = { icon:icon_107 }; //ok
	break;		
		case "Bar":
	markerOptions = { icon:icon_108 }; //ok
	break;		
		case "Discotheque":
	markerOptions = { icon:icon_109 }; //ok
	break;		
		case "Hotel Chambre Gite":
	markerOptions = { icon:icon_110 };
	break;		
		case "Lieu Loisir":
	markerOptions = { icon:icon_111 };
	break;		
		case "Lieu Culture":
	markerOptions = { icon:icon_112 };
	break;	
	}

}

//alert(markerOptions);

	var options = {maxWidth:300};
	var MYmarker=new GMarker(new GLatLng(Lat,Long), markerOptions);
//	MYmarker.title=titre;
	GEvent.addListener(MYmarker, "click", function() {
			var URL="http://www.gelules.tv/GETDESC.php";
			var rand = Math.random(9999);
			var myAjax = new Ajax.Request( 
						     	URL	, {
										method: 'get',
										parameters: 'idweb='+Idweb+'&horaire='+horaire+'&rand='+rand,
										onLoading:function(){	MYmarker.openInfoWindowHtml("Loading...",options);},
										onComplete:function(t,json) {
										MYmarker.openInfoWindowHtml(t.responseText,options);
										}
					} );
	});
	map.addOverlay(MYmarker);	
}

function getDesc(Idweb)
{

var URL="http://www.chambresdhotes.travel/GETDESC.php";
var tmp;
var myAjax = new Ajax.Request( 
						     	URL	, {
										method: 'get',
										parameters: 'idweb='+Idweb,
										onComplete:function(t,json) {
										tmp=t.responseText;
										}
	} );

	return tmp; 

}

function AddAll()
{
//var gx = new GGeoXml("http://www.chambres-hotes.org/GGE/?idweb=full");
var gx = new GGeoXml("http://www.chambresdhotes.travel/KML.php");
	map.addOverlay(gx);	
}

function AddWysiwig(valeur)
{
var limites= map.getBounds();	
var sw=limites.getSouthWest();
var ne=limites.getNorthEast();
var GEOURL="http://www.gelules.tv/KJSON.php";
//$('REPORT').innerHTML="CHARGEMENT DES ETABLISSEMENTS EN COURS ...";
//$('REPORT').setStyle({backgroundColor:"#FF3366"});
//alert(valeur);
var myAjax = new Ajax.Request( 
						    	GEOURL	, {
										method: 'get',
										parameters: 'lngsw='+sw.lng()+'&lngne='+ne.lng()+'&latne='+ne.lat()+'&latsw='+sw.lat()+'&today='+valeur,
										onComplete:function(t,json) {
										//$('REPORT').innerHTML="CHARGEMENT DES ETABLISSEMENTS : COMPLET";
										//$('REPORT').setStyle({backgroundColor:"#D6FF59"});
										if(map.getZoom()==11 || map.getZoom()==12)
										{
										//$('REPORT').innerHTML="ATTENTION: VOUS POUVEZ SAUVEGARDER CETTE VUE <a class=\"saveit\" onClick=\"javascript:SaveIt()\">CLIQUEZ ICI</a><br/>- Pour la partager <br/>- Pour faire d&eacute;couvrir cette r&eacute;gion";
										//$('REPORT').setStyle({backgroundColor:"#FFFF00"});
										}
										//$('REPORT').innerHTML="JSON OK"; 
										//alert("yo:"+json.length);
												for(i=0;i<json.length;i++)
												{
												//alert(" "+json[i].LAT+" "+json[i].LNG+" REF:"+json[i].REF);
												var tmpref=json[i].REF;
												
												if(LALISTE[tmpref]!='EXIST') 
													{
													//alert("add");
													LALISTE[tmpref]='EXIST';
													AddOne(json[i].LAT,json[i].LNG,tmpref,json[i].TYPE,json[i].HORAIRE,json[i].LIEU);
													}
												}		
										}
	} );


//map.addOverlay(gx);	

}

function AddWysiwigWeb(valeur)
{
var limites= map.getBounds();	
var sw=limites.getSouthWest();
var ne=limites.getNorthEast();
var GEOURL="http://www.gelules.tv/KJSONweb.php";
//$('REPORT').innerHTML="CHARGEMENT DES ETABLISSEMENTS EN COURS ...";
//$('REPORT').setStyle({backgroundColor:"#FF3366"});
//alert(valeur);
var myAjax = new Ajax.Request( 
						    	GEOURL	, {
										method: 'get',
										parameters: 'lngsw='+sw.lng()+'&lngne='+ne.lng()+'&latne='+ne.lat()+'&latsw='+sw.lat()+'&today='+valeur,
										onComplete:function(t,json) {
										//$('REPORT').innerHTML="CHARGEMENT DES ETABLISSEMENTS : COMPLET";
										//$('REPORT').setStyle({backgroundColor:"#D6FF59"});
										if(map.getZoom()==11 || map.getZoom()==12)
										{
										//$('REPORT').innerHTML="ATTENTION: VOUS POUVEZ SAUVEGARDER CETTE VUE <a class=\"saveit\" onClick=\"javascript:SaveIt()\">CLIQUEZ ICI</a><br/>- Pour la partager <br/>- Pour faire d&eacute;couvrir cette r&eacute;gion";
										//$('REPORT').setStyle({backgroundColor:"#FFFF00"});
										}
										//$('REPORT').innerHTML="JSON OK"; 
										//alert("yo:"+json.length);
												for(i=0;i<json.length;i++)
												{
												//alert(" "+json[i].LAT+" "+json[i].LNG+" REF:"+json[i].REF);
												var tmpref=json[i].REF;
												
												if(LALISTE[tmpref]!='EXIST') 
													{
													//alert("add");
													LALISTE[tmpref]='EXIST';
													AddOne(json[i].LAT,json[i].LNG,tmpref,json[i].TYPE,json[i].HORAIRE,json[i].LIEU);
													}
												}		
										}
	} );


//map.addOverlay(gx);	

}

function AddWysiwigWebTag(valeur)
{
var limites= map.getBounds();	
var sw=limites.getSouthWest();
var ne=limites.getNorthEast();
var GEOURL="http://www.gelules.tv/KJSONwebtag.php";
//$('REPORT').innerHTML="CHARGEMENT DES ETABLISSEMENTS EN COURS ...";
//$('REPORT').setStyle({backgroundColor:"#FF3366"});
//alert(valeur);
var myAjax = new Ajax.Request( 
						    	GEOURL	, {
										method: 'get',
										parameters: 'lngsw='+sw.lng()+'&lngne='+ne.lng()+'&latne='+ne.lat()+'&latsw='+sw.lat()+'&today='+valeur,
										onComplete:function(t,json) {
										//$('REPORT').innerHTML="CHARGEMENT DES ETABLISSEMENTS : COMPLET";
										//$('REPORT').setStyle({backgroundColor:"#D6FF59"});
										if(map.getZoom()==11 || map.getZoom()==12)
										{
										//$('REPORT').innerHTML="ATTENTION: VOUS POUVEZ SAUVEGARDER CETTE VUE <a class=\"saveit\" onClick=\"javascript:SaveIt()\">CLIQUEZ ICI</a><br/>- Pour la partager <br/>- Pour faire d&eacute;couvrir cette r&eacute;gion";
										//$('REPORT').setStyle({backgroundColor:"#FFFF00"});
										}
										//$('REPORT').innerHTML="JSON OK"; 
										//alert("yo:"+json.length);
												for(i=0;i<json.length;i++)
												{
												//alert(" "+json[i].LAT+" "+json[i].LNG+" REF:"+json[i].REF);
												var tmpref=json[i].REF;
												
												if(LALISTE[tmpref]!='EXIST') 
													{
													//alert("add");
													LALISTE[tmpref]='EXIST';
													AddOne(json[i].LAT,json[i].LNG,tmpref,json[i].TYPE,json[i].HORAIRE,json[i].LIEU);
													}
												}		
										}
	} );


//map.addOverlay(gx);	

}


function AddMoveLoc()
{
GEvent.addListener(map, 'moveend',
    function(){ 
      GetInfoLoc();
    });
}


function AddMove()
{
GEvent.addListener(map, 'moveend',
    function(){ 
      GetInfo();
    });
}

function AddMover()
{

GEvent.addListener(map, 'dragend',
    function(){ 
		//alert(this.getZoom());
		if(this.getZoom()>7)
		{
     // this.clearOverlays();
	 // alert("Cleared");
	   AddWysiwig();
		}
    });
GEvent.addListener(map, 'zoomend',
    function(){ 
		if(this.getZoom()>6)
		{
     //	this.clearOverlays();
	 	// alert("Cleared");
	   	AddWysiwig();
		}
    });
}
function AddMoverWeb()
{

GEvent.addListener(map, 'dragend',
    function(){ 
		//alert(this.getZoom());
		if(this.getZoom()>7)
		{
     // this.clearOverlays();
	 // alert("Cleared");
	   AddWysiwigWeb(0);
		}
    });
GEvent.addListener(map, 'zoomend',
    function(){ 
		if(this.getZoom()>6)
		{
     //	this.clearOverlays();
	 	// alert("Cleared");
	   	AddWysiwigWeb(0);
		}
    });
}

function AddMoverWebTag(valeur)
{

GEvent.addListener(map, 'dragend',
    function(){ 
		//alert(this.getZoom());
		if(this.getZoom()>7)
		{
     // this.clearOverlays();
	 // alert("Cleared");
	   AddWysiwigWebTag(valeur);
		}
    });
GEvent.addListener(map, 'zoomend',
    function(){ 
		if(this.getZoom()>6)
		{
     //	this.clearOverlays();
	 	// alert("Cleared");
	   	AddWysiwigWebTag(valeur);
		}
    });
}

function AddCroix()
{
	croix = new GScreenOverlay('http://www.gelules.tv/cross.gif',
        new GScreenPoint(275,175, 'pixels', 'pixels'),  // screenXY
        new GScreenPoint(0, 0),  // overlayXY
        new GScreenSize(50, 50)  // size on screen
      );
    map.addOverlay(croix);	
	//alert("croix ok");
}

function GetInfo()
{
	var MYGLatLngBounds=map.getBounds();
	var MYcenter=MYGLatLngBounds.getCenter();
	//alert(MYcenter.lat()+" "+MYcenter.lng());
	$('lgt').value=MYcenter.lng();
	$('lat').value=MYcenter.lat();
	$('ENDIT').innerHTML="<input type=\"button\" name=\"Submit\" value=\"L\'etablissement est precisement au milieu du carre \"  onclick=\"javascript:Finalize()\">";
}

function GetInfoLoc()
{
	var MYGLatLngBounds=map.getBounds();
	var MYcenter=MYGLatLngBounds.getCenter();
	//alert(MYcenter.lat()+" "+MYcenter.lng());
	$('lgt').value=MYcenter.lng();
	$('lat').value=MYcenter.lat();
	$('zoom').value=map.getZoom();
}

function SaveIt()
{
//		var tmp=GetLimites();
//	alert(tmp[0]+" "+tmp[1]+" "+tmp[2]+" "+tmp[3]);
	var url    = 'getform.php';
	var rand   = Math.random(9999);
	var pars   = 'rand=' + rand;
	var myAjax = new Ajax.Request( 
									url, {
										method: 'post',
										parameters: pars, 	
										onComplete:function(t,json) {
										 		$('REPORT').innerHTML=t.responseText;
    										}
	} );
}

function SaveItNow()
{
	var MYGLatLngBounds=map.getBounds();
	var MYcenter=MYGLatLngBounds.getCenter();
//'&Name='+$F('Name')+

	var url    = 'SaveItNow.php';
	var rand   = Math.random(9999);
	var pars   = 'rand=' + rand+'&Name='+$F('Name')+'&LAT='+MYcenter.lat()+'&LNG='+MYcenter.lng()+'&ZOOM='+map.getZoom();
	var myAjax = new Ajax.Request( 
									url, {
										method: 'post',
										parameters: pars, 	
										onComplete:function(t,json) {
										 		$('REPORT').innerHTML=t.responseText;
    										}
	} );
}

function myzoom(a) {
	a > 0 ? map.zoomIn('', false, true): map.zoomOut('', true);
}

function mymove(a,b) {
	map.panDirection(a,b);
}

function affiche_marker(i) {
	map.panTo(aMarkers[i].getPoint());
	aMarkers[i].openInfoWindowHtml(aMarkersHtml[i]);
	aMarkers[i].setImage(icon_ville1.image);
}

function affiche_marker2(i) {
	map.panTo(aMarkers[i].getPoint());
	aMarkers[i].openInfoWindowHtml(aMarkersHtml[i]);
	//aMarkers[i].setMarkerZIndex (600000);
}

function revert_marker(i) {
	aMarkers[i].setImage(icon_annonce.image);
	//aMarkers[i].setMarkerZIndex (1);
}

function wheelZoom(a) {
	if (!a) a = window.event; 
	if (a.preventDefault) a.preventDefault(); 
	a.returnValue = false; 

	//if(a.cancelable){
	//	a.preventDefault();
	//}
	//(a.detail || -a.wheelDelta) < 0 ? map.zoomIn('', false, true): map.zoomOut('', true);
	//return false;
}

function changeType(a){
	if(a=='sat'){
		map.setMapType(G_SATELLITE_MAP);
	}

	if(a=='route'){
		map.setMapType(G_NORMAL_MAP);
	}
	
	if(a=='norm'){
		map.setMapType(G_PHYSICAL_MAP);
	}
	if(a=='hyb'){
		map.setMapType(G_HYBRID_MAP);
	}
}


