<html>
<head>
<script type="text/javascript" src="http://js.sapo.pt/Bundles/SAPOMapsAPI.js"></script>
<script type="text/javascript">
window.onload = init;
var map, sd;
function init(){
map = new SAPO.Maps.Map("map");
}
function getDirections(){
sd = new SAPO.Maps.Directions(map, "results");
sd.registerEvent("completed", this, function(directions){
var x = 1;
});
sd.getDirections(new OpenLayers.LonLat(-9.125926, 38.75445), new OpenLayers.LonLat(-9.147653, 38.729256), {description: "textmap"});
}
</script>
</head>
<body>
<div id="map" style="width: 50%; height: 400px; float:left;"></div>
<div id="results" style='width:40%; float:right; height: 400px; overflow-y: scroll;'></div>
<div style='clear:both;'>
<input type="button" onclick="getDirections();" value="Get directions"/>
</div>
</body>
</html>