process_EB = function(doc) {
	var jsonData = eval('(' + doc + ')');			// === Parse the JSON document === 
	var doSetupPoly = false;
	side_bar_html[3] = '';
	for (var i=0; i<jsonData.eb.length; i++) {
		var point = new GLatLng(jsonData.eb[i].lat, jsonData.eb[i].lng);
		var markereb = createMarker(point, jsonData.eb[i].tipo_ebici, jsonData.eb[i].nom_ebici, jsonData.eb[i].descripcion_iw, jsonData.eb[i].icono_url,3,'eb');
		batch_eb.push(markereb);																																	//map.addOverlay(marker); 	
		var coordenadasPoly = new Array(); 
		if (jsonData.eb[i].polygon.puntos.length>0){
			doSetupPoly = true;
			for (var k=0; k<jsonData.eb[i].polygon.puntos.length; k++){ 
				coordenadasPoly[k] = new GLatLng(parseFloat(jsonData.eb[i].polygon.puntos[k].lat),parseFloat(jsonData.eb[i].polygon.puntos[k].lng)); 
			}
			p_SColor = jsonData.eb[i].polygon.SColor;
			p_SWeight = parseFloat(jsonData.eb[i].polygon.SWeight);
			p_SOpacity = parseFloat(jsonData.eb[i].polygon.SOpacity);
			p_FColor = jsonData.eb[i].polygon.FColor;
			p_FOpacity = parseFloat(jsonData.eb[i].polygon.FOpacity);
			p_opts = jsonData.eb[i].polygon.opts;
			polygons[i] = new google.maps.Polygon(coordenadasPoly,p_SColor, p_SWeight, p_SOpacity,p_FColor, p_FOpacity,p_opts);
		}
	}
	setupMarkersEB();
	if (doSetupPoly){setupPolygons();}
	updateIH('divEstBici', side_bar_html[3],'input');
	side_bar_html[3]="";
}

function updateMarkersEB(){
	var bounds = map.getBounds();
	var northEast = bounds.getNorthEast();
	var southWest = bounds.getSouthWest();
	var nivelZoom = map.getZoom();
	GDownloadUrl(im_vars.d+im_vars.b, process_EB,"NElng="+northEast.lng()+"&NElat="+northEast.lat()+"&SWlng="+southWest.lng()+"&SWlat="+southWest.lat()+"&NivelZoom="+nivelZoom+"&strCapa=eb&IMKey="+im_vars.c, im_vars.e);
}
		
function removedorEB(){
	var markerInfo=false;
	infoWindow=map.getInfoWindow();
	if(!infoWindow.isHidden()){
		var infoWindowPoint=infoWindow.getPoint();
	}
	for(var i = 0; i < batch_eb.length; i++){
		var latlng=batch_eb[i].getLatLng();
		if(!infoWindow.isHidden()){
			if(latlng.lat()==infoWindowPoint.y && latlng.lng()==infoWindowPoint.x){
				markerInfo=batch_eb[i];
			}else{
				mgr.removeMarker(batch_eb[i]);
			}
		}else{
			mgr.removeMarker(batch_eb[i]);
		}
	}
	batch_eb = [];
	objGmarkers.eb = [];
	objHtmls.eb = [];			
	batch_eb.length = 0;
	side_bar_html[3] = "";
	updateIH('divEstBici', side_bar_html[3],'input');
	if(markerInfo){
		batch_eb[0]=markerInfo;
		mgr.addMarker(batch_eb[0],1);
	}
}
 
function setupMarkersEB() {
	mgr.addMarkers(batch_eb, 12); // Capa estacionamientos
	mgr.refresh();
}
function setupPolygonsEB() { 
	if (map.getZoom()>12){
		for (var i = 0; i < polygons_eb.length; i++){
			map.addOverlay(polygons_eb[i]);
		}
	}			
}
		
function removedorPolygonEB(){
	for(var i = 0; i < polygons_eb.length; i++){
		if (polygons_eb[i]!=undefined){
			map.removeOverlay(polygons_eb[i]);
		}
	}/**/
	//map.clearOverlays();
	/*coordenadasPoly_e = [];
	coordenadasPoly_e.length = 0;*/
	polygons_eb = [];
	polygons_eb.length = 0;
}
