
// Call the search page
function Search(searchTermInput) {
	
	// Get the search term and build the search Url
	var searchTerm = searchTermInput.value;
	searchTerm = searchTerm.trim();
	searchTerm = escape(searchTerm);

	// Ensure a search term has been supplied
	if (searchTerm.length == 0) {
		alert ('Please enter your search criteria.');
		return;
	}
	
	// Get the search url and querystring that is stored in the form
    var searchUrl = unescape(document.forms[0].searchUrl.value) + searchTerm;
	
	window.location.href = searchUrl;
}
if ($) {
    $(function() {
        $("#search_form").submit(function(e) {
            var searchTerm = document.getElementById("search_text").value;
            var trimmedSearchTerm = $.trim(searchTerm);
            if (trimmedSearchTerm.length === 0) {
                return false;
            }
        });
    });
}

