function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function MM_displayStatusMsg(msgStr) { //v1.0
	status=msgStr;
	document.MM_returnValue = true;
}

function bioLink(url)
{
	if(opener){
		if(opener.top){
			//alert("opener.top is an object  url : " + url);
			opener.top.location.href = url;
		}
		else if(opener.parent){
			//alert("opener.parent is an object url : " + url);
			opener.parent.location.href = url;
		}
		else{
			//alert("opener is an object  url : " + url);
			opener.document.location.href = url;
		}
	}
	else
		alert("opener is not an object");
	
	window.close();
}

function submitForm(){
	//read parameters, create a URL with query string, and bring up popup form
	
	//alert(document.forms.length);	
	
	// Do not continue if input(s) has invalid character(s)
	if(hasInvalidCharacters(document.forms[0]))
	{
		return;
	}	
	var category = document.forms[0].filterName.value;
	var keyword = document.forms[0].keywords.value;
		
	var showAllCheckBox = document.forms[0].showAll;
	
	var showAll = "false";
	if(showAllCheckBox != null && showAllCheckBox.checked)
	{
		showAll = "true";
	}
	else
	{
		showAll = "false";
	}

	//alert(showAll);
	//alert(keyword);
	//alert(category);
	var url = "";
		
	if(!category)
		category = "Name";
	
	if(!keyword)
		keyword = "";	
	
	if(keyword == "")
		url = "../searchResults/SearchEngine.aspx?index=" + category + "&field_keywords=&#032" + "&showAll=" + showAll;
	else
		url = "../searchResults/SearchEngine.aspx?index=" + category + "&field_keywords=" + keyword.replace(/ /g, '+') + "&showAll=" + showAll;

	//if(keyword == "")
	//	url = "../searchResults/SearchEngine.aspx?index=" + category + "&field_keywords=&#032";
	//else
		//url = "../searchResults/SearchEngine.aspx?index=" + category + "&field_keywords=" + keyword.replace(/ /g, '+');
		
	top.name = "attractions";
	var width = 420;//420
	var height = 480;//480
	var x = (screen.availWidth - width)/2;
	var y = (screen.availHeight - height)/2;	
	MM_openBrWindow(url, "SearchResults", "width="+width+",height="+height+",left=" + x + ",screenX=" + x + ",top=" + y + ",screenY=" + y + ",alwaysRaised=yes");
}
