// WIYBY RELEASE 13.1
	// -----------------------------------------------------------------------------------------
	
	var welshOcirc = String.fromCharCode( 244 );
	//alert( "welshOcirc = " + welshOcirc );
					
	function submitPostcodeSearch( isViewingInWelsh )
	{
		//alert("submitPostcodeSearch");
		
		var searchTerm = document.getElementById("value").value;
		
		if ( isEmpty( searchTerm ) )
		{
			if ( isViewingInWelsh )
			{
				alert("Rhowch g" + welshOcirc + "d post cyn cyflwyno.");
			}
			else
			{
				alert("please enter a postcode before submitting.");
			}			
	
			return false;	
		}
		else if ( searchTerm.length < 3	)		
		{
			// make sure the search term is at least 3 characters.  even though we support
			// partial postcodes  ie "SO2" we would not want to allow a search on just "S"
			// as this would cane the server resources
			
			if ( isViewingInWelsh )
			{
				alert("Rhowch o leiaf 3 llythyren neu rif ar gyfer y c" + welshOcirc + "d post.");
			}
			else
			{
				alert("please enter at least 3 characters for the postcode.");
			}

			return false;					
		}	
				
		return true;
	}
	
	// -----------------------------------------------------------------------------------------

	function submitGazetteerSearchFromMapPage( isViewingInWelsh )
	{
		//alert("submitGazetteerSearchFromMapPage");
		
		var searchTerm = document.getElementById("value").value;
		var topic = document.gotoNewPlaceForm.topic.value;
		
		if ( isEmpty( searchTerm ) )
		{
			// as the user can enter postcode or place name, the message is different
			// to when they can only enter postcode
			
			if ( isViewingInWelsh )
			{
				alert("Rhowch g" + welshOcirc + "d post neu enw lle cyn cyflwyno.");
			}
			else
			{
				alert("please enter a postcode or place name before submitting.");
			}

			return false;	
		}
		else if ( searchTerm.length < 3	)		
		{
			// as the user can enter postcode or place name, the message is different
			// to when they can only enter postcode
			
			if ( isViewingInWelsh )
			{
				alert("Rhowch o leiaf 3 llythyren neu rif ar gyfer y c" + welshOcirc + "d post neu enw lle.");
			}
			else
			{
				alert("please enter at least 3 characters for the postcode or place name.");
			}

			return false;					
		}
					
		return true;
	}

	// -----------------------------------------------------------------------------------------
		
	function submitPostcodeOrPlacenameSearch( isViewingInWelsh )
	{
		//alert("submitPostcodeOrPlacenameSearch");
		
		var searchTerm = document.getElementById("value").value;
		
		if ( isEmpty( searchTerm ) )
		{
			// as the user can enter postcode or place name, the message is different
			// to when they can only enter postcode
			
			if ( isViewingInWelsh )
			{
				alert("Rhowch g" + welshOcirc + "d post neu enw lle cyn cyflwyno.");
			}
			else
			{
				alert("please enter a postcode or place name before submitting.");
			}

			return false;	
		}
		else if ( searchTerm.length < 3	)		
		{
			// as the user can enter postcode or place name, the message is different
			// to when they can only enter postcode
			
			if ( isViewingInWelsh )
			{
				alert("Rhowch o leiaf 3 llythyren neu rif ar gyfer y c" + welshOcirc + "d post neu enw lle.");
			}
			else
			{
				alert("please enter at least 3 characters for the postcode or place name.");
			}

			return false;					
		}
					
		return true;
	}
	
	// -----------------------------------------------------------------------------------------

	function isEmpty( inputValue ) 
	{
		var strValue = inputValue.replace(/ /gi, "");
	
	  if ( strValue == "" || strValue == null ) 
	  	return true;
	  else
			return false;
	}

	// -----------------------------------------------------------------------------------------		
	
