
var localSearch = new GlocalSearch();

function usePointFromPostcode(postcode, callbackFunction) {
	
	localSearch.setSearchCompleteCallback(null, 
		function() {
			
			if (localSearch.results[0])
			{		
				
				var resultLat = localSearch.results[0].lat;
				var resultLng = localSearch.results[0].lng;
				var point = new GLatLng(resultLat,resultLng);
			
	              	callbackFunction(point);
			}else{
				alert("Postcode not found!");
			}
		});	
	localSearch.execute(postcode + ", UK");
	
}

function placeMarkerAtPoint(point)
{

/*document.write('<body onload="document.paypal_form.submit();" >');
document.write('<meta http-equiv="refresh" content="1">');
document.write('<form name="paypal_form" method="post" action="component/option,com_simplelists/Itemid,60/category_id,14/layout,basic/view,simplelist/">');
document.write('<input type="hidden" name="lat" value='+point.lat()+'>');
document.write('<input type="hidden" name="lang" value='+point.lng()+'>');
document.write('</form></body>'); */
window.location='/index.php?option=com_simplelists&Itemid=60&category_id=14&view=simplelist&layout=basic&lat='+point.lat()+'&langti='+-point.lng()+'';
}


