       //<![CDATA[
       var map;
       var geocoder;
       var bounds;
       var gmarkers = []; 
       var icons=new Array();

      function iconoCerca(){
       icons['cerca'] = new GIcon(G_DEFAULT_ICON);
       icons['cerca'].image = 'http://infoviedo.com/img/_maps/user.png';
       icons['cerca'].iconSize = new GSize(12, 22);  
       icons['cerca'].shadow = '';
       icons['cerca'].iconAnchor = new GPoint(6, 16);
      }
     
      function crearIconos(){
        // Definiendo iconos por defecto
        iconoCerca();
        for(i=1;i<=15;i=i+1){
          crearIcono(i);
        }
      }
      
      function crearIcono(numero){
               icons[numero] = new GIcon(G_DEFAULT_ICON);
               icons[numero].image = "/img/_maps/lightblue"+numero+".png";
               icons[numero].shadow = ""; 
               icons[numero].iconSize = new GSize(17, 19);  
               icons[numero].iconAnchor = new GPoint(0, 19);
               icons[numero].infoWindowAnchor = new GPoint(15, 1);
      }


      function iniciaMapa(){
          crearIconos();
          var point = new GLatLng('43.363823','-5.851018');
          map.setCenter(point, 13);
          map.addControl(new GSmallMapControl());
          map.hideControls();
          //'mouseover' listener shows controls 
          GEvent.addListener(map, "mouseover", function(){ 
          map.showControls(); 
          }); 
          //'mouseout' listener hides controls 
          GEvent.addListener(map, "mouseout", function(){ 
          map.hideControls(); 
          }); 

      
      }

      function crearMarcador(x,y,enlace,icono,markerID){
            var point = new GLatLng(x,y);
            var marker = createMarker(point,enlace,icono)
            marker.id=markerID;
            gmarkers[marker.id]=marker;
            bounds.extend(point);
            map.addOverlay(marker);
      }


      // Hasta aki todo OK hay que revisar para que es lo demás ...

       function addAddressToMap(response) {
         map.clearOverlays();
         if (!response || response.Status.code != 200) {
            alert("Sorry, we were unable to geocode that address");
         } else {
            place = response.Placemark[0];
            point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
            map.setCenter(new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]), 16);
            marker = new GMarker(point);
            map.addOverlay(marker);
            //marker.openInfoWindowHtml('<div align="center" class="azuloscuro"><?=$prueba->local["localNombre"];?></div>' + '<div align="center" style="font: bold 10px verdana;"><?=$prueba->local["localDomicilio"];?></div><br /><div align="center" style="font: normal 10px verdana;">Tlf: <?=$prueba->local["localTelefono"];?> - Fax: <?=$prueba->local["localFax"];?></div>');
         }
       }

      function createMarker(point,html,icono) {
        if(icono) var marker = new GMarker(point,icons[icono]);
        else var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          window.location.href="/guia/"+html+"/";
          //marker.openInfoWindowHtml(html);
        });

        // The new marker "mouseover" listener        
        GEvent.addListener(marker,"mouseover", function() {
        var tabla='local'+marker.id;
        $('.'+tabla+' a.textoGrande').css("color","red");
        });        

        GEvent.addListener(marker,"mouseout", function() {
        var tabla='local'+marker.id;
        $('.'+tabla+' a.textoGrande').css("color","#3399ff");
        }); 
        return marker;
      }
      
      
      function prueba(id){
        //alert(id);
        imagen=gmarkers[id].getIcon().image.replace("light","dark");
        gmarkers[id].setImage(imagen);
        original=gmarkers[id].getIcon().image;
        
         
      }

      function prueba2(id){
        //alert(id);
        gmarkers[id].setImage(original);
         
      }
   
      function creaMarcador(longi,lati,categoria) {
          var point = new GLatLng(longi,lati);
          var marker = new GMarker(point);
          bounds.extend(point);
          GEvent.addListener(marker, "click", function() {
           //marker.openInfoWindowHtml('<br /><img src="/img/loading.gif" alt="Cargando ..." /><br /><br /><strong>Cargando informaci&oacute;n ...</strong>');
           $.post("/site/_ajax/datosMapa.php",{ 
            longi: longi,
            lati: lati,
            cat: categoria
            }
           ,function(data) {
           marker.openInfoWindowHtml(data);
          });


          });
          map.addOverlay(marker);       
      }
    
    
    
       //]]>
