// function to create the map and it's listeners and connect them

function setDrivingDirectionsTo(overlay,point) {

	if (window.innerframe &&
		window.innerframe.document.drivingdirections &&
		window.innerframe.document.drivingdirections.to) {

		if (!point) {
			point=top.map.map.getCenter();
		}

		window.innerframe.document.
			drivingdirections.to.value=
				point.lat()+','+point.lng();
	}
}

function createGoogleMap(element,center,zoom,
			draggablecursor,draggingcursor,navigationstartpage) {

	var	map=new googlemap(element,center,zoom,
				draggablecursor,draggingcursor,
				navigationstartpage,17);

	google.maps.Event.addListener(map.map,"click",setDrivingDirectionsTo);
	google.maps.Event.addListener(map.map,"moveend",setDrivingDirectionsTo);
	
	return map;
}
