function getLocation(address) {
	
	//check if geolocation is enabled
	if (navigator.geolocation) {
		
		// Get location no more than 10 minutes old. 600000 ms = 10 minutes.
		navigator.geolocation.getCurrentPosition( function(position)
		{
			//show directions from current location to address in google maps
			window.location.href = 'http://maps.google.com/maps?saddr=+' + position.coords.latitude + ',' + position.coords.longitude + '&daddr='+ address;
			
		}, showError, {enableHighAccuracy:true,maximumAge:600000});
		
	} else {
		
		window.location.href = 'http://m.google.com/maps?daddr='+ address;
		//alert("I'm sorry, but geolocation services are not supported by your browser.");  
		
	}
}

function showError(error) {
	//alert(error.code + ' ' + error.message);	
	alert("I'm sorry, but geolocation services are not supported by your browser.");  
}
