window.name="newswindow";
window.onerror = stopError;

function stopError(){return true}
function gettopic(){return true}
function openlink(linkURL){if (linkURL == null)linkURL = "";linkwindow = window.open(linkURL,"linkwindow",'toolbar=1,location=1,menubar=1,scrollbars=1,resizable=1,width=615,height=500,status=1,top=screen.availTop,left=screen.availLeft');linkwindow.focus}
function mom(linkURL){if (linkURL == null)linkURL = "";son = window.open(linkURL,"son",'toolbar=0,location=0,menubar=0,scrollbars=1,resizable=0,width=540,height=460,status=1,top=screen.availTop,left=screen.availLeft');son.focus}
function pop(linkURL){if (linkURL == null)linkURL = "";popwindow = window.open(linkURL,"popwindow",'toolbar=0,location=0,menubar=0,scrollbars=1,resizable=1,width=540,height=550,status=1,top=screen.availTop,left=screen.availLeft');popwindow.focus}
function pixpop(linkURL){if (linkURL == null)linkURL = "";pixwindow = window.open(linkURL,"pixwindow",'toolbar=0,location=0,menubar=0,scrollbars=1,resizable=1,width=615,height=550,status=1,top=screen.availTop,left=screen.availLeft');pixwindow.focus}
function openwingsgallery(gallery) {pixpop("http://data.detnews.com/wingsgallery/frame.hbs?project=" + gallery)}
function openjoyridesgallery(gallery) {pixpop("http://data.detnews.com/joyridesgallery/frame.hbs?project=" + gallery)}
function openrvmgallery(gallery) {pixpop("http://data.detnews.com/rvmgallery/frame.hbs?project=" + gallery)}
function opennewsgallery(gallery) {pixpop("http://data.detnews.com/newsgallery/frame.hbs?project=" + gallery)}
function opensportsgallery(gallery) {pixpop("http://data.detnews.com/sportsgallery/frame.hbs?project=" + gallery)}
function openautosgallery(gallery) {pixpop("http://data.detnews.com/autosgallery/frame.hbs?project=" + gallery)}
function opengallery(gallery) {pixpop("http://data.detnews.com/slideshow/frame.hbs?project=" + gallery)}
function galleryindex(){pixpop("http://data.detnews.com/slideshow/galleryindex.htm")}
function autosgalleryindex(){pixpop("http://data.detnews.com/autosgallery/galleryindex.htm")}
function gothere(form){if(form.pick.options[form.pick.selectedIndex].value != "")openlink(form.pick.options[form.pick.selectedIndex].value)}
function morningstar(){pop("http://poweredby.morningstar.com/CoverPages/CoBrandstocksWI.html?CN=DTN725&PC=1")}
function companybox(Ticker){pop("http://poweredby.morningstar.com/Stocks/Snapshot/_" + Ticker + ".html?CN=DTN725&PC=1")} 
function shareit() {pop("http://data.detnews.com/slideshow/linktoshare.hbs?referer=" + window.location)}
function comments(forum) {pop("http://data.detnews.com/" + forum + "/writeus.hbs?referer=" + window.location)}
function searchform(form){var search = ((document.search.searchtext.value == "") ? mom("http://detnews.com/search/fulltext.htm") : scriptsearch(document.search.searchtext.value, "phrase"))}
function searchsection(form){var search = ((document.searchsection.sectiontext.value == "") ? mom("http://detnews.com/search/fulltext.htm") : scriptsearch(document.searchsection.sectiontext.value, document.searchsection.typeofsearch.value, document.searchsection.sectionname.value))}
function findreplace(inString, removeString, replaceString) {
	var outString = "", i = 0;
	while (i <= (inString.length - 1)) {
		if ((i <= (inString.length - removeString.length)) && (inString.substring(i, i + removeString.length)) == removeString){outString += replaceString; i += removeString.length}
		else {outString += inString.charAt(i); i++}
	} 
	return outString;
}
function removeSpaces(inString) {
	var outString = "";
	for (i = 0; i < inString.length; i++ ){if (inString.charAt(i) == " " && inString.charAt(i + 1) == " "){continue}outString += inString.charAt(i)}
	if (outString.charAt(0) == " "){outString = outString.substring(1, outString.length - 1)}
	if (outString.charAt(outString.length - 1) == " "){outString = outString.substring(0, outString.length - 1)}
	return outString;
}
function scriptsearch(searchterm, searchtype, selectedsection, dateline){
	document.startsearch.getit.value = searchterm;
    var s = "\\*'*=*>*<*)*(*{*}*!*@*&*[*\"*]*.*,* and * not *;*?";
	var a = s.split("*");
	for (i = 0; i < a.length; i++) searchterm = findreplace(searchterm, a[i], "");
	if (searchtype == "phrase"){searchterm = findreplace(removeSpaces(searchterm), " ", "<SENTENCE>")}
	if (searchtype == "anywords"){searchterm = findreplace(removeSpaces(new String(searchterm.toLowerCase())), " ", "<OR>")}
	if (searchtype != "phrase" && searchtype != "anywords"){searchterm = findreplace(removeSpaces(new String(searchterm.toLowerCase())), " ", "<AND>");searchtype = "allwords"}
	if (selectedsection != "" && selectedsection != null){searchterm = "(SECTION=" + removeSpaces(new String(selectedsection.toLowerCase())) + ")<AND>" + searchterm} 
	if (dateline != "" && dateline != null){searchterm = "(DATELINE=" + removeSpaces(new String(dateline.toUpperCase())) + ")<AND>" + searchterm} 
	searchterm += "<IN>blockquote";
	document.startsearch.SearchType.value = searchtype;
	document.startsearch.QueryText.value = searchterm;
	mom(); 
	document.startsearch.submit();
}
document.write('<form method="post" action="http://sol.bizserve.com/search97cgi/s97_cgi" name="startsearch" target="son"><INPUT TYPE="hidden" NAME="Action" VALUE="Search"><INPUT TYPE="hidden" NAME="ResultTemplate" VALUE="popupresults.hts"><INPUT TYPE="hidden" NAME="SortField" VALUE="FILEDATE"><INPUT TYPE="hidden" NAME="Collection" VALUE="detnews2"><INPUT TYPE="hidden" NAME="QueryText" VALUE=""><INPUT TYPE="hidden" NAME="getit" VALUE=""><INPUT TYPE="hidden" NAME="SearchType" VALUE=""><INPUT TYPE="hidden" NAME="SortOrder" VALUE="desc"></form>');