







var statsUrl = '/servlets/StatsServlet';
var mapCfg = {
	vm_key:'JSBS20081126160326460588813276',
	map:null,
	def_lat:48.95341,
	def_lng:4.36654,
	def_center:null,//vmlonlat 
	def_zoom: 9,
	mode_nav : 1,
	map_mode : 0, //== recherche 0, selection 1;
	layers:{
		centerLayer:null,
		itiLayer:null,
		selectionLayer:null,
		polygonLayer:null,
		resultLayer:null,
		multipleLayer:null
	},
	bubble_template:'<div style="padding: 2px; background-color: #fff; border:0px none;">' 
			+ '<p align="right" id="VMBubbleClose" style="padding: 0px; margin: 0px;"><small>Fermer</small></p>' 
			+ '<div id="VMBubbleContent" style="background: #fff; white-space: nowrap; margin:1px;"></div>' 
			+ '</div>',
	icons:{},
	mile:0.621371192,
	currentPicto:null
};

var oRG={};
var navCfg = {
	filter_auth:false //filtre selon autorisation B	
};

function vmRegister(){
	VMAPI.registerKey( mapCfg.vm_key );
	VMAPI.setLanguage("fra");
	
}
function vmInit(){
	vmRegister();
	initPictos();
	
	mapCfg.map = new VMMap( document.getElementById( 'map') );
	
	mapCfg.map.setMapModeNav( mapCfg.mode_nav );
	mapCfg.def_center = new VMLonLat( mapCfg.def_lng, mapCfg.def_lat );
	mapCfg.map.setBubbleTemplate( mapCfg.bubble_template );
	
	mapCfg.map.activateMiniZoom( true );
	mapCfg.map.showMapTools();
	//====
	resetMap();

	return;
}

var oMapPictos = {
	pictoCentre:null,
	pictoDispo:null,
	pictoIndispo:null,
	pictoInvisible:null,
	pictoDispoBig:null,
	pictoIndispoBig:null,
	pictoInvisibleBig:null
};

var centerLayer = null;
	
function showCenterLayer(){
	if( centerLayer != null ){
		try{
			mapCfg.map.removeLayer( centerLayer );
		} catch( e ){}
	}
	centerLayer = new VMIconLayer(mapCfg.map.getCenter(), oMapPictos.pictoCentre );
	mapCfg.map.addLayer( centerLayer );	
}	
function initPictos(){
	oMapPictos.pictoCentre 	= new VMIcon ('/skins/51/images/puce.gif', 0, 0);
	oMapPictos.pictoDispo	= new VMIcon ('/skins/51/images/verte.gif', 0, 0);
	oMapPictos.pictoIndispo	= new VMIcon ('/skins/51/images/rouge.gif', 0, 0);
	oMapPictos.pictoInvisible = new VMIcon ('/skins/51/images/jaune.gif', 0, 0);
	oMapPictos.pictoDispoBig = new VMIcon ('/skins/51/images/verteG.gif', -10, -10);
	oMapPictos.pictoIndispoBig = new VMIcon ('/skins/51/images/rougeG.gif', -10, -10);
	oMapPictos.pictoInvisibleBig = new VMIcon ('/skins/51/images/grande_jaune.gif', -10, -10);
}

resetMap=function(){
	mapCfg.map.addEventHandler('onMapCenterChanged', showCenterLayer);	
	mapCfg.map.drawMap( mapCfg.def_center, mapCfg.def_zoom );
}
	
function filterResults(){}



