// Search Toggler	
function toggleSearch()
{
	if(document.getElementById("search-box").style.display == 'block')
	{
		hideSearch();
	}
	else
	{
		showSearch();
	}
}

function hideSearch() {
		document.getElementById("search-box").style.display = 'none';
	
}
function showSearch(e) {
	document.getElementById("search-box").style.display = 'block';
	if (!e) var e = window.event;
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
	return false;
}



// Search postcode-to-coords
function processAddress(form, address) {
	var geocoder = null;
	if (GBrowserIsCompatible()) {
		geocoder = new GClientGeocoder();			
		geocoder.getLatLng(address+',UK', function(point) {
			
			if (!point) {
				alert("Postcode Not Found");
			} 
			else {
				document.getElementById('lat').value = point.lat();
				document.getElementById('long').value = point.lng();						
				
				document.getElementById('search_postcode').submit();

			}
		});				
	}		
	
	return false;
}

// Map location animator
function animate(nlat, nlong, title)
{
	map.panTo(new GLatLng(nlat, nlong));
	map.openInfoWindow(new GLatLng(nlat, nlong), document.createTextNode(title));
}