I just right-clicked and went to view->source and found this function in the header:
function distanceCalculate(){
var from = document.getElementById("street1").value+", "+document.getElementById("city").value+", "+document.getElementById("state_province").value+", "+document.getElementById("postcode").value;
var to = "add your address here";
var oDir = new GDirections(null, null); // new directions object
GEvent.addListener(oDir, 'load', function(){
document.getElementById("distance").value= Math.round(parseFloat(oDir.getDistance().html)); // Fill miles into form
});
oDir.load('from: '+from+' to: '+to, {getSteps: true});
}
I removed some of the stuff you won't need, but there is a function that has all the necessary code.