
var address="66 Old Princes Highway, Beaconsfield, Victoria 3807";var map;var geocoder;var directions;var firstload=0;function initialize(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map_canvas"));geocoder=new GClientGeocoder();geocoder.getLocations(address,addAddressToMap);}}
function addAddressToMap(response){if(!response||response.Status.code!=200){alert("\""+address+"\" not found");}else{place=response.Placemark[0];point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);map.setCenter(point,16);marker=new GMarker(point);map.addOverlay(marker);var street=place.AddressDetails.Country.AdministrativeArea.Locality.Thoroughfare.ThoroughfareName;var suburb=place.AddressDetails.Country.AdministrativeArea.Locality.LocalityName;var state=place.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName;var postcode=place.AddressDetails.Country.AdministrativeArea.Locality.PostalCode.PostalCodeNumber;marker.openInfoWindowHtml('<font style="font-weight:bold;font-size:14px;>Database By Design</font> <br>Office 1, Level 1 <br>'+'70 Old Princes Highway'+'<br>'+suburb+' '+state+' '+postcode+'<br><br><span id=\'dirtohere\' style=\'font-size:12px;\'>Get Directions To: <a href=javascript:ShowToHere(0); >Database By Design</a></span><div id=\'tohere\' style=\'visibility:hidden;font-size:small;line-height:normal;\'><input id=\'txttohere\' type=\'text\' style=\'border:1px #000000 inset;width:80%;vertical-align:top;\'/><div style=\'display:inline;margin:0.5em 0 0 0.1em;padding:0;\'><input type=\'button\' style=\'border:2px #000000 outset;width:15%;\' id=\'btntohere\' onclick=\'fnToHere()\' value=\'Go\'></div><div><a href=javascript:ShowToHere(1); style=\'color:#7777CC;font-size:0.85em;\'>&laquo; Back</a></div></div>');map.setUIToDefault();}}
function ShowToHere(intVar){if(intVar==0){document.getElementById("tohere").style.visibility="visible";document.getElementById("dirtohere").innerHTML="Get Directions To: <font style=\'font-weight:bold;\'>Database By Design</font>";}
else if(intVar==1){document.getElementById("tohere").style.visibility="hidden";document.getElementById("dirtohere").innerHTML="Get Directions To: <a href=javascript:ShowToHere(0); >Database By Design</a>";}}
function fnToHere(){if(firstload==0){firstload=1;directions=new GDirections(map);}
var txtAdd=document.getElementById("txttohere").value;directions.clear();directions.load("from: "+txtAdd+" to: 70 Old Princes Highway, Beaconsfield, Victoria 3807");document.getElementById("tohere").style.visibility="hidden";document.getElementById("dirtohere").innerHTML="Get Directions To: <a href=javascript:ShowToHere(0); >Database By Design</a>";}