/// <summary>
/// 	avoid double-posts - these result in broken path
/// </summary>
var hasRedirected = false;

/// <summary>
/// 	redirect to search result page if search text has been entered - this script 
/// 	should be included on all pages that have a search form 
/// </summary>
function redirectToSearch(SearchForm) {
	if (hasRedirected == true) return;
	
	if (SearchForm.searchText.value.length >= minSearchTextLength) {
		hasRedirected = true;
		window.location = searchResultsPage + "?" + escape(SearchForm.searchText.value);
	} else {
		alert("Please enter text of " + minSearchTextLength + " or more characters.");
	}
}