function runSearch() {
	var searchChoice = document.searchform.searchtype[document.searchform.searchtype.selectedIndex].value;
	var searchText = document.searchform.searchtext.value;
	if (searchText == "") {
		if (searchChoice == "archive") window.location.href = "http://www.pantagraph.com/info/archive_search.php";
		if (searchChoice == "recent") window.location.href = "http://www.pantagraph.com/shared-content/search/";
		if (searchChoice == "classifieds") window.location.href = "http://www.pantagraph.com/classifieds/";
		if (searchChoice == "jobs") window.location.href = "http://www.pantagraph.com/jobs/";
		if (searchChoice == "web") window.location.href = "http://search.yahoo.com/web/advanced?ei=UTF-8";
	}
	else {
		if (searchChoice == "archive") window.location.href = "http://nl.newsbank.com/nl-search/we/Archives?p_product=BL&p_theme=bl&p_action=search&p_maxdocs=200&p_sort=YMD_date:D&p_text_search-0=" + escape(searchText);
		if (searchChoice == "recent") window.location.href = "http://www.pantagraph.com/shared-content/search/?search=go&l=25&q=" + escape(searchText);
		if (searchChoice == "classifieds") window.location.href = "http://www.pantagraph.com/classifieds/?query=" + escape(searchText);
		if (searchChoice == "jobs") window.location.href = "http://hotjobs.yahoo.com/job-search?partner=bloomington&locations=Bloomington,+IL&metro_search_proxy=1&metro_search=1&kw="+escape(searchText);
		if (searchChoice == "web") window.location.href = "http://search.yahoo.com/search?ei=UTF-8&p=" + escape(searchText);
	}
}

if (location.href == "http://www.pantagraph.com/"
	|| location.href == "http://pantagraph.com/"
) var searchfieldsize = 20;
else var searchfieldsize = 18;

document.write('<form name="searchform" class="searchform" id="searchform" onsubmit="runSearch(); return false;">'
+'<table id="searchtable" border="0" cellspacing="0" cellpadding="0">'
+'<tr><td><div align="left"><b>Search:</b></div></td>'
+'<td><div align="right"><a href="http://www.pantagraph.com/search/tips.php">Tips</a> | <a href="http://www.pantagraph.com/search/">Advanced options</a></div>'
+'</td></tr>'
+'<tr><td colspan="2"><input type="text" name="searchtext" size="'+searchfieldsize+'" /> <select name="searchtype" size="1">'
+'<option value="archive">Archive</option>'
+'<option value="recent">Last 14 days</option>'
+'<option value="classifieds">Classifieds</option>'
+'<option value="jobs">Area jobs</option>'
+'<option value="web">Web (Yahoo!)</option>'
+'</select><input type="button" onClick="runSearch();" value="Go" /></td>'
+'</tr></table></form>');

