function jumpToLocation(theSelectBox) {
	/* This function should populate the hidden fields location coordinates and location name 
	as well as telling the Google map to update it's location */
	
	var strCoords = theSelectBox.value;
	var strName = theSelectBox.options[theSelectBox.selectedIndex].text;
	var aCoords;
	aCoords = strCoords.split(",");

	document.getElementById("LocationCoordinates").value = strCoords;
	document.getElementById("LocationNameHiddenField").value = strName;

	// Reset other drop downs
//	var tempIndex = theSelectBox.selectedIndex;
//	clearLocation(true,false);
//	theSelectBox.selectedIndex = tempIndex;

	ChangeLocation(strCoords);
}

function AutoJumpToLocation(text, coord) {	
	ChangeLocation(coord);
}

function SetGLocation(coords){
	document.getElementById("LocationCoordinates").value = coords;
	document.getElementById("LocationNameHiddenField").value = "OS Grid: " + coords;
}

function clearLocation(sender, clearMap) {
	// Clear all text boxes and drop downs apart from the that called this function.
	if (sender.id != "Airports") document.formSearchLoc.Airports.selectedIndex = 0;
	if (sender.id != "Seaports") document.formSearchLoc.Seaports.selectedIndex = 0;
	if (sender.id != "TubeStations") document.formSearchLoc.TubeStations.selectedIndex = 0;
	if (sender.id != "RailwayStation") document.formSearchLoc.RailwayStation.value = "";
	if (sender.id != "JunctionName") document.formSearchLoc.JunctionName.value = "";
	if (sender.id != "TownCityName") document.formSearchLoc.TownCityName.value = "";
	if (sender.id != "County") document.formSearchLoc.County.value = "";
	if (sender.id != "TownCityName") document.formSearchLoc.TownCityName.value = "";
	if (sender.id != "County") document.formSearchLoc.County.value = "";
	if (sender.id != "Postcode") document.formSearchLoc.Postcode.value = "";	
	if (clearMap) resetMap();
}
