	//	FONCTION RETOURNANT UN OBJET PERSONNLISE Gicon
	function iconeVF(urlBase){
		// icone GGmaps avec tous les parametres
		//newIcon=new GIcon(icon, '../templates/v3/img/maps/lettres/icon_'+j+'.png');	j++;	if (j>26) { j=1; }	// si on veux des icones avec lettres, image de 1 a 26..		
		var ulTpl = urlBase+'templates/v3/img/maps/fleche-30/';
		var newIcon = new GIcon();
		newIcon.image = ulTpl+'image.png';
		newIcon.shadow = ulTpl+'shadow.png';
		newIcon.iconSize = new GSize(30,27);
		newIcon.shadowSize = new GSize(44,27);
		newIcon.iconAnchor = new GPoint(15,27);
		newIcon.infoWindowAnchor = new GPoint(15,0);
		newIcon.printImage = ulTpl+'printImage.gif';
		newIcon.mozPrintImage = ulTpl+'mozPrintImage.gif';
		newIcon.printShadow = ulTpl+'printShadow.gif';
		newIcon.transparent = ulTpl+'transparent.png';
		newIcon.imageMap = [19,0,21,1,26,2,27,3,28,4,28,5,28,6,28,7,28,8,29,9,29,10,29,11,29,12,29,13,29,14,29,15,29,16,29,17,18,18,18,19,17,20,17,21,17,22,17,23,16,24,16,25,16,26,15,26,14,25,14,24,14,23,14,22,13,21,13,20,13,19,13,18,1,17,0,16,0,15,0,14,0,13,0,12,0,11,1,10,1,9,1,8,2,7,2,6,2,5,2,4,2,3,3,2,9,1,11,0];

		return newIcon;
	}


	//	FONCTION CREATION HTML INFOBULLE
	function infobulle(obj, id){
		var str  = '<div class="infobulle">';
		str		+= (obj.site == 1) ? '<h4><a href="'+obj.url+'">'+obj.titre+'</a></h4>' : '<h4>'+obj.titre+'</h4>';
		str 	+= (obj.adresse  != null)	?	'<p>'+obj.adresse+'</p>'  : '';
		str 	+= (obj.adresse2 != null)	?	'<p>'+obj.adresse2+'</p>' : '';
		str 	+= '<p>'+obj.cp+' '+obj.ville+'</p>';
		str 	+= '<div>';
		if(obj.site == 1){
			str		+= '<p class="contact"><a href="'+obj.contact+'">Contacter l\'agence</a></p>';
			str		+= '<p class="site"><a href="'+obj.url+'">site de l\'agence</a></p>';
		}
		str		+= '</div>';
		str		+= '</div>';
		
		return str;
	}


	//	FONCTION CREATION HTML INFOBULLE DES GROUPES
	function infobulleGroupe(args){
		var html = '<div class="infobulleGroupe">';
		html 	+= '<h4><a href="javascript:void(0)" onclick="cluster.defaultClickAction();">'+args.clusteredMarkers.length+' agences :</a>';
		html 	+= '<span>[ <a href="javascript:void(0)" onclick="cluster.defaultClickAction()">Zoomer sur les '+args.clusteredMarkers.length+'</a> ]</span></h4>';
		
		// on fait defiler l'objet retourne
		html 	+= '<ul>';
		for (i=0; i<args.clusteredMarkers.length; i++) {
			html+='<li><span>'+arrayOptInfos['cp_'+args.clusteredMarkers[i].index]+'</span> ';
			html+= (arrayOptInfos['site_'+args.clusteredMarkers[i].index] == 1)	? '<a href="'+arrayOptInfos['url_'+args.clusteredMarkers[i].index]+'">'+args.clusteredMarkers[i].getTitle()+'</a>' : args.clusteredMarkers[i].getTitle();
			html+='<span style="float:right;"><a href="javascript:cluster.triggerClick('+args.clusteredMarkers[i].index+')">Zoom [+]</a></span></li>';
		}
		html 	+= '</ul>';
		html+='</div>';
		
		return html;
	}


	//	FONCTION RETOURNANT LA PARTIE "reprgouper" (div + texte + checkbox)
	function boutonRegrouper(){
		var html = '<div class="htmlControl">';
		html 	+= '<p onclick="checkedToogle(); toggleClustering();">Regrouper</p><input type="checkbox" id="checkToogle" checked="checked" onclick="toggleClustering()" />';
		html 	+= '</div>';
		var control=new HtmlControl(html);
		return control;
	}

	
	//	FONCTION GERANT LE CLICK SUR LA ZONE "regrouper"
	function checkedToogle(){
		var em = document.getElementById('checkToogle');
		em.checked = (em.checked) ? false : true;
	}


	//	PROTOTYPE HtmlControl GERANT LA CREATION DE CONTROLES PERSONNALISES DANS GOOGLE MAPS
	//	Google Maps API HtmlControl v1.1.2
	//	based on code posted on Google Maps API discussion group
	//	last updated/modified by Martin Pearman 20th August 2008
	//	http://googlemapsapi.martinpearman.co.uk/htmlcontrol
	//	
	//	This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
	//	This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
	//	You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.


	function HtmlControl(html, options){
		this.html=html;
		this.isVisible=true;
		this.isPrintable=false;	
		this.isSelectable=false;
		if(options){
			this.isVisible=(options.visible===false)?false:true;
			this.isPrintable=(options.printable===true)?true:false;
			this.isSelectable=(options.selectable===true)?true:false;
		}
	}
	
	HtmlControl.prototype=new GControl();
	
	HtmlControl.prototype.initialize=function(map){
		this.div=document.createElement('div');
		this.div.innerHTML=this.html;
		this.setVisible(this.isVisible);
		map.getContainer().appendChild(this.div);
		return this.div;
	};
	
	HtmlControl.prototype.getDefaultPosition=function(){
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7,7));
	};
	
	HtmlControl.prototype.selectable=function(){
		return this.isSelectable;
	};
	
	HtmlControl.prototype.printable=function(){
		return this.isPrintable;
	};
	
	HtmlControl.prototype.setVisible=function(bool){
		this.div.style.display=bool ? '':'none';
		this.isVisible=bool;
	};
	
	HtmlControl.prototype.visible=function(){
		return this.isVisible;
	}
	
