function loadExternalPage()
{
var dropObj = document.getElementById("hostDrop");
window.location.href = dropObj.options[dropObj.selectedIndex].value;
}

function enableSearchSubmit () {
	document.getElementById('searchSubmit').style.visibility='visible';
}

function searchRefinement (){
	//Load form element
	var searchCrit = document.getElementById("searchCriteria").value;

	//Remove quotes (Previous searches)
	searchCrit = searchCrit.replace(/"/g," ");

	//Replace Search AND / OR / NOT (Previous Searches)
	searchCrit = searchCrit.replace(/\bAND\b/g,"");
	searchCrit = searchCrit.replace(/\bOR\b/g,"");	
	
	//convert double spaces to single
	searchCrit = searchCrit.replace(/ {2,}/g,' ');

	//Trim start and end of string
	searchCrit = searchCrit.replace(/^\s\s*/, '').replace(/\s\s*$/, '');

	//Check for empty search
	if (searchCrit.length == 0)
	{
		alert("Please enter some characters into your search");
		return false;
	}

	//Check for invalid Wildcard *
	if ((searchCrit.charAt(0) == "*") || searchCrit.indexOf(" *") != -1)
	{
		alert("No word in your search can start with an asterisk '*' (Wildcard). Please include at least one character first.");
		return false;
	}

	//Check for invalid Wildcard ?
	if ((searchCrit.charAt(0) == "?") || searchCrit.indexOf(" ?") != -1)
	{
		alert("No word in your search can start with an question mark '?' (Wildcard). Please include at least one character first.");
		return false;
	}

	//Check for invalid Fuzzy
	if ((searchCrit.charAt(0) == "~"))
	{
		alert("Your search cannot begin with the Fuzzy Search operator '~', please move this after a character.");
		return false;
	}

	//Check for ranges [ ]
	if ((searchCrit.indexOf("[") != -1) || (searchCrit.indexOf("]") != -1))
	{
		alert("Live Site search does not support date ranges, please remove all square brackets '[ ]' from your search.");
		return false;
	}

	//Check for ranges { }
	if ((searchCrit.indexOf("{") != -1) || (searchCrit.indexOf("}") != -1))
	{
		alert("Live Site search does not support word ranges, please remove all parentheses '{ }' from your search.");
		return false;
	}

	//Check for specific field
	if (searchCrit.indexOf(":") != -1)
	{
		alert("Live Site search does not support direct field searches, please remove all colons ':' from your search.");
		return false;
	}

	//Check for search boosting
	if (searchCrit.indexOf("^") != -1)
	{
		alert("Live Site search does not support search boosting, please remove all carets '^' from your search.");
		return false;
	}

	//Check for search required terms
	if (searchCrit.indexOf("+") != -1)
	{
		alert("Live Site search does not support required terms, please remove all plus symbols '+' from your search.");
		return false;
	}

	//Check for search not terms (Minus)
	if (searchCrit.indexOf("-") != -1)
	{
		alert("Live Site search does not support minus terms, please remove all minus symbols '-' from your search.");
		return false;
	}

	//Check for search not terms (NOT)
	if (searchCrit.indexOf("NOT") != -1)
	{
		alert("Live Site search does not support capital 'NOT' terms, please remove all capital 'NOT' words from your search.");
		return false;
	}

	//Check for grouping (Brackets)
	if ((searchCrit.indexOf("(") != -1) || (searchCrit.indexOf(")") != -1))
	{
		alert("Live Site search does not support brackets '( )', please remove all brackets from your search.");
		return false;
	}

	//Check for double ampersand
	if (searchCrit.indexOf("&&") != -1)
	{
		alert("Live Site search does not double ampersands '&&', please remove all double ampersands from your search.");
		return false;
	}

	//Check for double pipe
	if (searchCrit.indexOf("||") != -1)
	{
		alert("Live Site search does not double pipes '||', please remove all double pipes from your search.");
		return false;
	}

	//Check for exclamation mark
	if (searchCrit.indexOf("!") != -1)
	{
		alert("Live Site search does not support exclamation marks '!', please remove all exclamation marks from your search.");
		return false;
	}
	
	//Split the search string up
	var searchCritArray = searchCrit.split(" ");

	var searchString = "";

	var searchMode = "default";

	//Find the selected Search mode from radio buttons
	for (var i=0; i < document.advancedSearch.searchMode.length; i++)
	{
	   if ( document.advancedSearch.searchMode[i].checked)
	   {
		  searchMode =  document.advancedSearch.searchMode[i].value;
	   }
	}

	//All of the words
	if (searchMode == "All")
	{
		searchString = searchCrit.replace(/\s/g,' AND ');
	}
	
	//Exact Phrase
	if (searchMode == "Exact")
	{
		searchString = "\"" + searchCrit + "\"";
	}

	//Any of the words
	if (searchMode == "Any")
	{
		searchString = searchCrit;
	}

	//Update the query
	document.getElementById("searchCriteria").value = searchString;

	//Pass through the original search (For 'Your search for...')
	document.getElementById("searchedText").value = searchCrit;

	//Submit the search form
	document.advancedSearch.submit();
		
}
