	var minLongitude ;
	var maxLongitude ;
	var minLatitude ;
	var maxLatitude ;
	function createMarkerPto(point, index, info, entradilla, imagen) {
		var icono = new GIcon(G_DEFAULT_ICON);
    		//icono.image = "/MODULOS/global/admin/interfaces/img/iconos/ico_marcador.gif";
    		//icono.shadow = null;
    		//icono.iconSize = new GSize(13, 13);
    		//icono.iconAnchor = new GPoint(5, 10);
    		//icono.infoWindowAnchor = new GPoint(9, 2);
    		//icono.infoShadowAnchor = new GPoint(18, 25);
			//icono.printImage = "/MODULOS/global/admin/interfaces/img/iconos/ico_marcador.gif";
        	//icono.mozPrintImage = "/MODULOS/global/admin/interfaces/img/iconos/ico_marcador.gif";
			// Set up our GMarkerOptions object
			markerOptions = { icon:icono };
        	var marker = new GMarker(point, markerOptions);
			GEvent.addListener(marker, "mouseover", function() {
       		var html = imagen+"<div style='width: 170px'>"+info+"<br />"+entradilla+"</div>";
	       	marker.openInfoWindowHtml(html);
        	});
        	return marker;
	}

	function cargaPois(url){
        var conn = new XHConn();
        if(!conn){
            alert("XMLHTTP not available");
            return false;
        }
        var fnWhenDone = function (oXML){
            if(oXML.readyState == 4){
                xml = oXML.responseXML.documentElement;
                cont = 0;
                if(xml.getElementsByTagName('marcas').length > 0){
                    for(i = 0; i < xml.getElementsByTagName('marcas').length; i++){
                        var marcas = xml.getElementsByTagName('marcas')[i];
                        if(marcas.getElementsByTagName('latitud')[0].firstChild && marcas.getElementsByTagName('longitud')[0] && marcas.getElementsByTagName('info')[0]){
                        	var latitud = marcas.getElementsByTagName('latitud')[0].firstChild.data;
                            var longitud = marcas.getElementsByTagName('longitud')[0].firstChild.data;
                            if(marcas.getElementsByTagName('entradilla')[0]){
                            	var entradilla = marcas.getElementsByTagName('entradilla')[0].firstChild.data;
                            }
						    if(! minLongitude){
						    	minLongitude = longitud ;
						    }
						    if(! maxLongitude){
						    	maxLongitude = longitud ;
						    }
						    if(! minLatitude){
						    	minLatitude = latitud ;
						    }
						    if(! maxLatitude){
						    	maxLatitude = latitud ;
						    }
						    minLongitude = Math.min(minLongitude, longitud);
						    maxLongitude = Math.max(maxLongitude, longitud);
						    minLatitude = Math.min(minLatitude, latitud);
						    maxLatitude = Math.max(maxLatitude, latitud);
                            var point = new GLatLng(latitud, longitud);

				            var node = marcas.getElementsByTagName("info")[0];
				            var lObj = eval(marcas.getElementsByTagName("info")[0]);
							if(lObj != null){
			                	var larr = lObj.childNodes;
			                	for(var iCounter = 0; iCounter< larr.length; iCounter++){
			                  		var vv = eval(larr[iCounter]);
			                  		if(vv != null) {
			                    		var lvalue = vv.nodeValue;
			                    		if(lvalue.length > 0){
			                        		var info = lvalue.substring(7,lvalue.length-2);
			                    		}
			                  		}
			                	}
			              	}
                            if(marcas.getElementsByTagName("imagen")[0]){
					            var nodeImg = marcas.getElementsByTagName("imagen")[0];
					            var lObjImg = eval(marcas.getElementsByTagName("imagen")[0]);
								if(lObjImg != null){
				                	var larrImg = lObjImg.childNodes;
				                	for(var iCounter = 0; iCounter< larrImg.length; iCounter++){
				                  		var vv = eval(larrImg[iCounter]);
				                  		if(vv != null) {
				                    		var lvalue = vv.nodeValue;
				                    		if(lvalue.length > 0){
				                        		var imagen = lvalue.substring(7,lvalue.length-2);
				                    		}
				                  		}
				                	}
				              	}
							}
			              	if(info || imagen){
			              		map.addOverlay(createMarkerPto(point, xml.getElementsByTagName('marcas').length, info, entradilla, imagen));
			              	}
                        }
                        cont ++;
                    }
	                centerLatitude = minLatitude + (maxLatitude - minLatitude) / 2;
		   	   		centerLongitude = minLongitude + (maxLongitude - minLongitude) / 2;
		       		var b = new GLatLngBounds(new GLatLng(minLatitude,minLongitude),  new GLatLng(maxLatitude,maxLongitude));
		       		var z = map.getBoundsZoomLevel(b);
		       		if(cont > 1){
		       			map.setCenter(new GLatLng(centerLatitude, centerLongitude), z);
		       		}else{
			       		map.setCenter(new GLatLng(latitud, longitud), 5);
		       		}
                }
                if (cont==0){
				    // Si no hay marcas definimos un centro fijo para q aparezca el mapa
					map.setCenter(new GLatLng(39.740986355883564,-3.779296875), 3);
                }
            }
        };
        var sUrl    = url;
        var sMethod = "POST";
        var sVars   = "";
        conn.connect(sUrl, sMethod, sVars, fnWhenDone);
        return true;
    }