function directions(address1,point1,address2,point2) {	
	var a = address1 + "@" + point1.toUrlValue(6);	
	var b = address2 + "@" + point2.toUrlValue(6);	
	a = "from: " + a + " to: " + b;		
	gdir.load(a, {getPolyline:true});
}
//--------------------------------------------------------------
function CallBackGoogleMaps(point)
{	
	if(marker != null)
	{
		map.removeOverlay(marker);
	}
	
	if(null == point)
	{
		alert("address not found");		
		return;
	}	
	
	
	marker = addPlace(point.lat(), point.lng());
	//marker = createSimpleMarker(map, point);		
	
	
	var point1 = new GLatLng(y,x);	
	var point2 = point;		
	//var point3 = findPointBetweenTwoPoints(point1, point2);	
	//map.setCenter(point3, 3);		
	var placeName = document.getElementById("place").value;
	directions(placeName, point2, "", point1);
}
//--------------------------------------------------------------
function findDirection()
{
	
		
	var placeName = document.getElementById("place").value;
	if(placeName == "")
		return;
    if(null != poly)
		map.removeOverlay(poly);
				
	placeName = trim(placeName);
	if(searchInCity.checked)
	{
		var city = document.getElementById('cityName').value;
		placeName += " " + city;		
	}	
	
	if(null != placeName && placeName != "")
	{	
		var point = getPoint(placeName, "CallBackGoogleMaps");		
	}
}
//--------------------------------------------------------------