/*
* Minified Location Services
* Global Version 5.1
*/
var initialLocation;var geocoder;var processedLocation;function getLocationName(input){var processedLocation;geocoder=new google.maps.Geocoder();var latlngstr=input.split(",",2);var lat=parseFloat(latlngstr[0]);var lng=parseFloat(latlngstr[1]);var latlng=new google.maps.LatLng(lat,lng);geocoder.geocode({'latLng':latlng},function(results,status){if(results[1]){if(status==google.maps.GeocoderStatus.OK){processedLocation=results[6];var town=processedLocation.address_components[1].long_name;var county=processedLocation.address_components[2].long_name;if(town.length<4||county.length<4)
{$('#detected').val('Unable to resolve location');return;}
var address=town+', '+county;$('#detected').val(address);$('#usedetect').removeAttr("disabled");}}else{$('#detected').val('Sorry Unavailable.');}});}
function getLongLatLocation(){var browserSupportFlag=new Boolean();if(navigator.geolocation){browserSupportFlag=true;navigator.geolocation.getCurrentPosition(function(position){initialLocation=position.coords.latitude+', '+position.coords.longitude;getLocationName(initialLocation);return;});}else if(google.gears){browserSupportFlag=true;var geo=google.gears.factory.create('beta.geolocation');geo.getCurrentPosition(function(position){initialLocation=position.latitude+', '+position.longitude;getLocationName(initialLocation);return;});}else{browserSupportFlag=false;$('#detected').val('Sorry Unavailable.');return;}}

