$(document).ready(function(){if (GBrowserIsCompatible()){$("#map_canvas img").hide();$(window).unload(function(){GUnload();});var map=new GMap2(document.getElementById("map_canvas"));var point=new GLatLng(43.324944,-8.383877);map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());map.setCenter(point,15);var mark=new GMarker(point);map.addOverlay(mark);var panel_container=document.getElementById("directions");var directions=new GDirections(map, panel_container);var geocoder=new GClientGeocoder(new GGeocodeCache());var from="";var to="Alcalde Electo Carballo 4, 15174, Culleredo, España";$("#address").append("

Ex: Plaza de Pontevedra, A Coruña

");$("#geo-directions-button").click(function(){from=$("#geo-directions").attr("value").replace(/^s+|s+$/g,"");if (from != ""){directions.clear();directions.load("from: "+from+" to: "+to, {"locale":"gl"});mark.closeInfoWindow();}});GEvent.addListener(directions, "error", function(){geocoder.getLocations(from, function(response){if (directions.getStatus().code==G_GEO_UNKNOWN_ADDRESS){if(response.Placemark.length==1){from=response.Placemark[0].address;directions.clear();directions.load("from: "+from+" to: "+to, {"locale":"gl"});}else{var dir_html="

A dirección dada non é correcta. Por favor, elixa unha das seguintes:

");$("#directions a").click(function(){from=$(this).text();$("#directions").html("");directions.clear();directions.load("from: "+from+" to: "+to, {"locale":"gl"});return false;});}}else{mark.openInfoWindow(address_cont);alert("Non se puido encontrar a dirección solicitada. Por favor, comprobe que os datos introducidos son correctos");}});});var address_cont=document.getElementById("address");mark.openInfoWindow(address_cont);GEvent.addListener(mark,"click",function(){mark.openInfoWindow(address_cont);});}});