var icon=new GIcon();
icon.image="/images/marker.png";
icon.shadow="/images/shadow50.png";
icon.iconSize=new GSize(20,34);
icon.shadowSize=new GSize(37,34);
icon.iconAnchor=new GPoint(10,34);
var directionsPanel;
var directions;
var map;
var point;
var postcodeAddress;
var marker;
var name;
var localSearch=new GlocalSearch();
window.unload=GUnload();
var reasons=[];
reasons[G_GEO_SUCCESS]="Success";
reasons[G_GEO_MISSING_ADDRESS]="Location not found.";
reasons[G_GEO_UNKNOWN_ADDRESS]="Location not found.";
reasons[G_GEO_UNAVAILABLE_ADDRESS]="Location not found. Address unavailable.";
reasons[G_GEO_BAD_KEY]="Directions not found. Key error.";
reasons[G_GEO_TOO_MANY_QUERIES]="Directions not found. Quota error.";
reasons[G_GEO_SERVER_ERROR]="Directions not found. Server error.";
reasons[G_GEO_BAD_REQUEST]="Location not found. Technical fault.";
reasons[G_GEO_MISSING_QUERY]="Location not found.";
reasons[G_GEO_UNKNOWN_DIRECTIONS]="Directions unavailable, please try a postcode.";
function focusGoogleMap(a,c,d){postcodeAddress=a;
var b=document.getElementById("addressBubble").innerHTML;
localSearch.setSearchCompleteCallback(null,function(){if(c!=null&&d!=null){point=new GLatLng(c,d);
if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map_container"));
map.setCenter(point,13);
map.openInfoWindowHtml(point,b);
marker=new GMarker(point,icon);
GEvent.addListener(marker,"click",function(){map.openInfoWindowHtml(point,b)
});
map.addOverlay(marker);
map.setUIToDefault()
}}else{if(localSearch.results[0]){var e=localSearch.results[0].lat;
var f=localSearch.results[0].lng;
point=new GLatLng(e,f);
if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map_container"));
map.setCenter(point,13);
map.openInfoWindowHtml(point,b);
marker=new GMarker(point,icon);
GEvent.addListener(marker,"click",function(){map.openInfoWindowHtml(point,b)
});
map.addOverlay(marker);
map.setUIToDefault()
}}else{alert("Map unavailable")
}}});
localSearch.execute(a+", UK")
}function toHere(a){name=a;
var b='<div id="directions_form">Starting location:<form action="javascript:getDirections()"><input type="text" name="saddr" id="saddr" value="" /><br/><div id="directions-errors" style="display:none"></div><span class="isThisYourCpyButton"><a rel="nofollow" href="javascript:getDirections()">Get Directions</a></span><br /></form></div>';
map.openInfoWindowHtml(point,b)
}function getDirections(){if(directions){directions.clear()
}document.getElementById("directions-errors").innerHTML="";
document.getElementById("directions-errors").style.display="none";
directionsPanel=document.getElementById("directions_container");
directionsPanel.innerHTML="";
directions=new GDirections(map,directionsPanel);
var a=document.getElementById("saddr").value;
directions.load("from: "+a+" to: "+name+"@"+point.lat()+","+point.lng());
GEvent.addListener(directions,"error",function(){var b=directions.getStatus().code;
var c="Code "+b;
if(reasons[b]){c=reasons[b]
}document.getElementById("directions-errors").innerHTML=c;
document.getElementById("directions-errors").style.display="block"
});
GEvent.addListener(directions,"load",function(){map.removeOverlay(marker);
map.closeInfoWindow()
});
GEvent.addListener(directions,"addoverlay",function(){sideburnColumns()
})
}function resetMap(){var a=document.getElementById("addressBubble").innerHTML;
map.setCenter(point,13);
map.openInfoWindowHtml(point,a)
};
