	function gerarRota(){  
		from = document.getElementById("partida").value; 
		to = document.getElementById("destino").value;  
		if ( geocoder ) {  
			geocoder.getLatLng(from,   
			function(point){   
				if ( !point ) {  
				alert(from + " não encontrado");  
			}   
		}  
	);  
		
	geocoder.getLatLng(to, function(point){  
		if ( !point ) {  
			alert(to + " não encontrado");  
		}   
	}  
	);  
	
	var string = "from: " + from + " to: "+to;  
		directions.clear();  
		directions.load(string);  
		GEvent.addListener(directions, "error", erroGetRoute);  
	} else {  
		alert("GeoCoder não identificado");  
	}  
	}  
	
	function erroGetRoute(){  
		alert("Não foi possivel traçar a rota de: " + from + " para: " + to );  
	}  

