$(function() {	
	//$("#get_location").bind("click", get_location);
	// get_location();
})

function handler(position) {
	$("input[name='user_lat']").val(position.coords.latitude);
	$("input[name='user_lng']").val(position.coords.longitude);
	// get the span, show the coordinates
	// var coords = $("#get_location").html("Your Latitude: "+position.coords.latitude+"<br/>Your Longitude: "+position.coords.longitude);
}

function get_location()
{
	// get the span, show loading graphic
	// var load = $("#get_location").html("Loading... <img src='/assets/img/mobile/loader.gif' />");
	navigator.geolocation.getCurrentPosition(handler, showError, {enableHighAccuracy:true,maximumAge:600000});
}

function showError(error) {
	var error = $("#get_location").html("Your browser does not support location awareness.");
}
