var baseUrlServer = 'http://luzparatodos.o3midia.com.br/';
	
	$('#btn_cadastrar_usuario').click(function(){
		
		dadosForm = $('#form_login').serialize();
		
		console.log(dadosForm);
		
	});
	
	// Wait for device API libraries to load
	//
	document.addEventListener("deviceready", onDeviceReady, false);

	// device APIs are available
	//
	function onDeviceReady()
	{
		$('#btn_login').click(function(){
			
			dadosForm = $('#form_login').serialize();
			
			$.post(baseUrlServer,dadosForm,function(r){
				
			});
		});
	}

	var endereco = 'VAZIO';

	// onSuccess Geolocation
	//
	function onSuccess(position) {

	//	var element = document.getElementById('geolocation');
	//	element.innerHTML = 'Latitude: '           + position.coords.latitude              + '<br />' +
	//	var msg = 'Latitude: '           + position.coords.latitude              + '<br />' +
	//						'Longitude: '          + position.coords.longitude             + '<br />' +
	//						'Altitude: '           + position.coords.altitude              + '<br />' +
	//						'Accuracy: '           + position.coords.accuracy              + '<br />' +
	//						'Altitude Accuracy: '  + position.coords.altitudeAccuracy      + '<br />' +
	//						'Heading: '            + position.coords.heading               + '<br />' +
	//						'Speed: '              + position.coords.speed                 + '<br />' +
	//						'Timestamp: '          + position.timestamp                    + '<br />';
		var urlGmaps = 'http://maps.googleapis.com/maps/api/geocode/json?' + 'latlng='+position.coords.latitude+','+position.coords.longitude+'&sensor=false';

		$.getJSON(urlGmaps,function(dataJson){
			endereco = dataJson.results[0].formatted_address;
			$('#paragrafo_tela_estou_aqui').html(endereco);
			$('#btn_salvar_endereco_tela_estou_aqui,#observacao_tela_estou_aqui').show();
			$.mobile.loading('hide');
		});
	}

	$('#tela-estou-aqui').on('pagehide',function(){
		$('#paragrafo_tela_estou_aqui').html('');
		$('#btn_salvar_endereco_tela_estou_aqui,#observacao_tela_estou_aqui').hide();
	});

	$('#tela-estou-aqui').on('pageshow',function(){
		$.mobile.loading('show');
		navigator.geolocation.getCurrentPosition(onSuccess, onError);
	});

	$('#btn_salvar_endereco_tela_estou_aqui').click(function(){
		alert(endereco);
	});
	// onError Callback receives a PositionError object
	//
	function onError(error) {
		alert('code: '    + error.code    + '\n' +
			  'message: ' + error.message + '\n');
	}