





//var quickLinksHTML = '<select onchange="navigateWithQuickLinks(this)">'
//                      + '<option>Quick Links</option>'
var quickLinksHTML = '<select onchange="navigateWithQuickLinks(this)">'
                      + '<option>Quick Links</option>'

                      + '</select>';
/*					  
//BEGIN body of ADA
// ###############################################################################
quickLinksHTML=quickLinksHTML
+ '<div id="adacomp">'
+ '                  <SELECT NAME="browser" onChange="'
+ '			  switch (this.options[this.selectedIndex].value) { '
+ '			  case \'1\': sizeme(1); break;'
+ '			  case \'2\': sizeme(2); break;'
+ '			  case \'3\': sizeme(3); break;'
+ '			  case \'11\': colorme(1); break;'
+ '			  case \'12\': colorme(2); break;		'
+ '			  case \'13\': colorme(3); break;'
+ '			  case \'21\': bcolorme(1); break;'
+ '			  case \'22\': bcolorme(2); break;		'
+ '			  case \'23\': bcolorme(3); break;'
+ '			  case \'31\': html2text(); break;'
+ '			  case \'32\': radiolinks(); break;'
+ '			  case \'100\': window.location.reload(); break;'
+ '			  }">'
+ '                    <option  selected="selected">ADA MENU</option>'
+ '                    <OPTGROUP LABEL="Change font size">'
+ '                    <option value="1">Small (10pt)</option>'
+ '                    <option  value="2">Medium (13pt)</option>'
+ '                    <option value="3">Large (16pt)</option>'
+ '                    </OPTGROUP>'
+ '                    <OPTGROUP LABEL="Change Text color">'
+ '					 <option style="color:#FFf;background-color:#000000" value="13">White</option>'
+ '                    <option style="color:#E2DDB5;background-color:#000000" value="12">Cream</option>'
+ '                    <option style="color:#000000" value="11">Black</option>'
+ '                   '
+ '                    </OPTGROUP>'
+ '                    <OPTGROUP LABEL="Change Background color">'
+ '                    <option style="background-color:#FFF;color:#000000" value="21">White</option>'
+ '                    <option style="background-color:#E2DDB5;color:#000000" value="22">Cream</option>'
+ '                    <option style="background-color:#000000;color:#FFf;" value="23">Black</option>'
+ '                    </OPTGROUP>'
+ '                    <OPTGROUP id="content"  LABEL="Content">'
+ '                    <option  value="31">Plain Text</option>'
+ '                    <option  value="32">Highlight Links</option>'
+ '                    </OPTGROUP>'
+ '                    <option  value="100" style="color:#FF0000;font-weight:bold;">Reset settings</option>'
+ '                  </SELECT>'
+ '                </div>';
// ###############################################################################					  
//END body of ADA	
*/

					  + '<option value="http://www.co.crow-wing.mn.us/sheriff/Warrant2.html|_new">Active Warrants</option>'

					  + '<option value="../auditor/business-related_licenses.html|_self">Business Related Licenses</option>'

					  + '<option value="../treasurer/index.html|_self">Certificates</option>'

					  + '<option value="../county_government/county_board/agendas_and_minutes_2008.html|_new">County Board Agenda</option>'

					  + '<option value="..//department_listing.html|_self">County Departments</option>'

					  + '<option value="../auditor/finance.html|_self">County Finances</option>'

					  + '<option value="../auditor/elec/index.html|_self">Elections</option>'

					  + '<option value="../gis/gis_mapping.html|_self">GIS-Interactive Mapping</option>'

					  + '<option value="../social_services/human_rights_commission.html|_self">Human Rights Commission</option>'

					  + '<option value="http://www.co.crow-wing.mn.us/Sheriff/Jail/custody1.html|_new">In-Custody List</option>'

					  + '<option value="../legal_notices_/index.html|_self">Legal Notices</option>'

					  + '<option value="../sheriff/civil_process_division/civilmortgage_foreclosures.html|_self">Mortgage Foreclosures</option>'

					  + '<option value="../treasurer/notary_pulic.html|_self">Notary Public</option>'

					  + '<option value="../county_commisioners/county_ordinances.html|_self">Ordinances</option>'

					  + '<option value="../county_government/outside_links.html|_self">Outside Links</option>'

					  + '<option value="../treasurer/index.html|_self">Passports</option>'

					  + '<option value="..//department_listing.html|_self">Phone Numbers</option>'

					  + '<option value="../treasurer/index.html|_self">Vital Records</option>'

                      + '</select>';
//----- Bottom Nav table
var bottomRowHTML = '<table cellspacing="0" cellpadding="0" border="0" width="100%" class="lowernavlinks"><tr>';


bottomRowHTML += '<td align="center" height="30" class="lowernavlinks"> <a style="font-size: 8pt"'
			   + ' href="county_development.html"'
			   + ' target="_self">'
			   + 'County Development</a></td>';

bottomRowHTML += '<td align="center" height="30" class="lowernavlinks"> <a style="font-size: 8pt"'
			   + ' href="index_of_services/index.html"'
			   + ' target="_self">'
			   + 'County Services</a></td>';

bottomRowHTML += '<td align="center" height="30" class="lowernavlinks"> <a style="font-size: 8pt"'
			   + ' href="judicial.html"'
			   + ' target="_self">'
			   + 'Judicial</a></td>';

bottomRowHTML += '<td align="center" height="30" class="lowernavlinks"> <a style="font-size: 8pt"'
			   + ' href="public_safety/index.html"'
			   + ' target="_self">'
			   + 'Public Safety</a></td>';

bottomRowHTML += '<td align="center" height="30" class="lowernavlinks"> <a style="font-size: 8pt"'
			   + ' href="planning___zoning/index.html"'
			   + ' target="_self">'
			   + 'Planning & Zoning</a></td>';

bottomRowHTML += '<td align="center" height="30" class="lowernavlinks"> <a style="font-size: 8pt"'
			   + ' href="property___taxes.html"'
			   + ' target="_self">'
			   + 'Property & Taxes</a></td>';


bottomRowHTML += '<td align="center" height="30" class="lowernavlinks"> <a style="font-size: 8pt"'
			   + ' href="our_gov/index.html"'
			   + ' target="_self">'
			   + 'Our Government</a></td>';


bottomRowHTML += '</table>';

//----- Left Tabs Table
var browseAsHTML =
				'<table id="browseastable" class="topleftlinks" width="100%" cellspacing="0" cellpadding="4" border="0">'
              + '<tr>'
              + '<td class="browseitalic"></td>';


var label = "18";

browseAsHTML += ''
			 + '<td valign="middle" class="browse" onmouseover="onLabel=true; dropChange('
			 + '\'' + label + '\''
			 + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
			 + '<a class="browse" href="'
			 + 'county_development.html'	//remove ../
			 + '" target="'
			 + '_self'
			 + '">'
			 + 'County&nbsp;Development</a>'
			 + '</td>'


var label = "5";

browseAsHTML += ''
			 + '<td valign="middle" class="browse" onmouseover="onLabel=true; dropChange('
			 + '\'' + label + '\''
			 + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
			 + '<a class="browse" href="'
			 + 'index_of_services/index.html'	//remove ../
			 + '" target="'
			 + '_self'
			 + '">'
			 + 'County&nbsp;Services</a>'
			 + '</td>'


var label = "82";

browseAsHTML += ''
			 + '<td valign="middle" class="browse" onmouseover="onLabel=true; dropChange('
			 + '\'' + label + '\''
			 + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
			 + '<a class="browse" href="'
			 + 'judicial.html'	//remove ../
			 + '" target="'
			 + '_self'
			 + '">'
			 + 'Judicial</a>'
			 + '</td>'


var label = "4";

browseAsHTML += ''
			 + '<td valign="middle" class="browse" onmouseover="onLabel=true; dropChange('
			 + '\'' + label + '\''
			 + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
			 + '<a class="browse" href="'
			 + 'public_safety/index.html'	//remove ../
			 + '" target="'
			 + '_self'
			 + '">'
			 + 'Public&nbsp;Safety</a>'
			 + '</td>'


var label = "105";

browseAsHTML += ''
			 + '<td valign="middle" class="browse" onmouseover="onLabel=true; dropChange('
			 + '\'' + label + '\''
			 + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
			 + '<a class="browse" href="'
			 + 'planning___zoning/index.html'	//remove ../
			 + '" target="'
			 + '_self'
			 + '">'
			 + 'Planning&nbsp;&&nbsp;Zoning</a>'
			 + '</td>'


var label = "113";

browseAsHTML += ''
			 + '<td valign="middle" class="browse" onmouseover="onLabel=true; dropChange('
			 + '\'' + label + '\''
			 + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
			 + '<a class="browse" href="'
			 + 'property___taxes.html'	//remove ../
			 + '" target="'
			 + '_self'
			 + '">'
			 + 'Property&nbsp;&&nbsp;Taxes</a>'
			 + '</td>'

             + '</tr>'
             + '</table>';
//----- Right Tabs Table
var mainTabsHTML = '<table id="maintabstable"  align="center" width="100%" cellspacing="0" cellpadding="0" border="0">'
                 + '<tr>'

                    + '<td width="2" class="tabs" onmouseover="onLabel=true; dropChange('
					+ '\'60\', 2);"'
					+ ' onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					+ '<a href="our_gov/index.html"'
					+ ' target="_self"'
					+ ' class="toprightlabels">'
					+ 'Our&nbsp;Government'
					+ '</a>'
					+ '</td>'

                    + '</tr>'
                 + ' </table>';
var topTabsHTML =
//----- Search and top links table
				  '<span style="vertical-align: bottom;">'
                  + '<table id="toprighttable" class="toprighttable" border="0" cellspacing="0" cellpadding="0" align="right">'

					+ '<tr>'
					+ '<td class="toprightlabels">'
					+ '<span class="toprightsearch">'
					+ '<form name="searchForm" action="search_results.jsp" method="post" style="margin-bottom:0px; text-align:right;">'
					+ '<input type="hidden" name="RZoption" value="OR" />'
					+ '<input type="hidden" name="RZscope" value="FILE" />'
					+ '<input type="hidden" name="RZpath_option" value="URL" />'
					+ '<input type="hidden" name="RZlocation" value="" />'
					+ '<input type="hidden" name="RZfilenames" value="*.html" />'
					+ '<input type="hidden" name="RZsubfolders" value="true" /> '
					+ '<input type="hidden" name="RZexclude_dirs" value="revize,revizelogin,setup,pdm" />'
					+ '<input name="RZkeywords" type="text" class="searchinput" value="search" onfocus="clearSearch(this)"/>'
					+ '<input type="button" class="searchbutton" value=" Go " '
					+ 'onclick="document.searchForm.submit()"/>'
					+ '</form>'
					+ '</span>'
					+ '</td>'
				+ '</tr>'
			+ '</table>'
			+ '</span>';

var onTable = false;
var onLabel = false;
//----- Dropdown menu table
var tableHeader = '<table width="100%" height="100%" border="0" class="dropdown" cellpadding="0" cellspacing="0" onmouseover="onTable = true; " onmouseout="onTable = false; setTimeout(\'revertDrop()\', 2000);">';
var tableFooter = '</tr></table>';
var filteredList;
var dropdownList;
var color1; var bgNormal; //new, easier-to-understand names
var color2; var bgHover;
var color3; var textNormal;
var color4; var textHover;
var dropdownlist1 = new Array();
var dropdownlist2 = new Array();

function navigateWithQuickLinks(formElement)
{
	var url = formElement.value;
	if (url == '') return;
	var targer = "";
	var pos = url.indexOf("|");
	if (pos != -1)
	{
		target = url.substring(pos+1);
		url = url.substring(0,pos);
	}
	url = replacesubstring(url,"../","");
	RZgoto(url, target);
}

function RZsubstring(str, startpos, endpos)
{
	if (typeof endpos == 'undefined') endpos = str.length + 1

	//----- Validate input string
	if (str == null || str.length == 0)	//if null or empty string
		return "";						//...return empty string

	//----- Validate end position
	if (endpos > str.length )			//greater than string length
		endpos = str.length;			//...set to length

	else if( endpos <= 0 )				//if end position before 1st character
		return "";						//...return empty string

	//----- Validate start position
	if( startpos >= endpos )  			//if start position greater than ending position
		return "";						//...return empty string

	else if (startpos < 0) 				//if start position less than 0
		startpos = 0;					//...assume 0

	//----- Return the substring
	return str.substring(startpos,endpos);
}
function replacesubstring( inStr, fromString, toString )
{
	var pos = 0
	if (inStr == null
	|| typeof inStr.length == 'undefined' //true or false
	|| inStr.length == 0) return '';

	var fromLen = fromString.length
	if (fromLen == 0) return inStr

	while (true)
	{
		pos = inStr.indexOf(fromString,pos)
		if (pos == -1) break
		inStr = RZsubstring( inStr, 0, pos )
		      + toString
		      + RZsubstring( inStr, pos + fromLen )
		pos += toString.length
	}
	return inStr
}


function setUpDropDowns() {

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "82",
								"County Attorney",
								"http://cwc-wsus/revize/crowwing/attorney2/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "113",
								"Assessor",
								"http://cwc-wsus/revize/crowwing/assessor/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "5",
								"Index of Services",
								"http://cwc-wsus/revize/crowwing/index_of_services/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "82",
								"Drug Court",
								"http://cwc-wsus/revize/crowwing/attorney2/drug_court/drug_court.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "4",
								"Community Corrections",
								"http://cwc-wsus/revize/crowwing/corrections/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "82",
								"Ninth District Court",
								"http://cwc-wsus/revize/crowwing/court/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "113",
								"Auditor",
								"http://cwc-wsus/revize/crowwing/auditor/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "18",
								"GIS",
								"http://cwc-wsus/revize/crowwing/gis/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "18",
								"Highway",
								"http://cwc-wsus/revize/crowwing/highway/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "4",
								"Detention / Jail",
								"http://cwc-wsus/revize/crowwing/sheriff/detention/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "18",
								"Land",
								"http://cwc-wsus/revize/crowwing/land/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "5",
								"Waste Disposal Site",
								"http://cwc-wsus/revize/crowwing/solid_waste/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "4",
								"Emergency Management",
								"http://cwc-wsus/revize/crowwing/emergency_management/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "18",
								"Maps",
								"http://cwc-wsus/revize/crowwing/surveyor/cwc_maps.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "18",
								"Parks",
								"http://cwc-wsus/revize/crowwing/parks/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "5",
								"Health Services",
								"http://cwc-wsus/revize/crowwing/health/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "113",
								"Recorder",
								"http://cwc-wsus/revize/crowwing/recorder/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "4",
								"Sheriff",
								"http://cwc-wsus/revize/crowwing/sheriff/index3.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "113",
								"Surveyor",
								"http://cwc-wsus/revize/crowwing/surveyor/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "113",
								"Treasurer",
								"http://cwc-wsus/revize/crowwing/treasurer/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "5",
								"Social Services",
								"http://cwc-wsus/revize/crowwing/social_services/index2.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "5",
								"U of MN Extension Service",
								"http://cwc-wsus/revize/crowwing/u_of_mn_extension/index.html",
								"_self");

		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1]
			= new DropdownItem( "5",
								"Veteran Services",
								"http://cwc-wsus/revize/crowwing/verteran_srvices/index.html",
								"_self");




		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"About US",
								"http://cwc-wsus/revize/crowwing/our_county/index.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"FAQ's",
								"http://cwc-wsus/revize/crowwing/faq_s/index.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"Administration",
								"http://cwc-wsus/revize/crowwing/administration06/index.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"Calendar of Events",
								"http://cwc-wsus/revize/crowwing/calendar_app/index.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"Cities & Towns",
								"http://cwc-wsus/revize/crowwing/surveyor/cwc_maps.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"County Commissioners",
								"http://cwc-wsus/revize/crowwing/county_commisioners/index2.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"Departments",
								"http://cwc-wsus/revize/crowwing/departments/index.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"Elections",
								"http://cwc-wsus/revize/crowwing/auditor/elec/index.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"Employment",
								"http://cwc-wsus/revize/crowwing/administration/employment_2/employment.html",
								"_self");

		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1]
			= new DropdownItem( "60",
								"Volunteer Oppurtunities",
								"http://cwc-wsus/revize/crowwing/social_services/volunteers_-_rsvp/index.html",
								"_self");

}

function FixMenu(){



	//vertical align
	var ob =document.getElementById("browseas").getElementsByTagName("td");
	for(var i=0;i<ob.length;i++) ob[i].style.verticalAlign='top';
	
	var ob =document.getElementById("maintabs").getElementsByTagName("td");
	for(var i=0;i<ob.length;i++)  ob[i].style.verticalAlign='top';
	//end vertical align



	//select left side  menulinks
	var html_left=document.getElementById("browseas").getElementsByTagName("a");
	//select right side  menulinks
	var html_right=document.getElementById("maintabs").getElementsByTagName("a");
	
	
	
	// calculate number of characters allowed per line	
	var length_to_verify=50/(html_left.length+html_right.length);	
	
	var space=/&nb[s]p;/g;
	
	//left side menu
	for(var i=0;i<html_left.length;i++) 
	{	
		html_left[i].innerHTML=html_left[i].innerHTML.replace( space, ' ' );
		var alink=html_left[i].innerHTML;
		html_left[i].style.textAlign='center';
		
		if(alink.length>length_to_verify){
		var asplit=alink.indexOf(" ",length_to_verify);
		if (asplit!=-1) html_left[i].innerHTML=alink.substr(0,asplit)+"<br>"+alink.substr(asplit,alink.length);
		}		
	}
	
	//right side menu
	for(var i=0;i<html_right.length;i++) 
	{	
		html_right[i].innerHTML=html_right[i].innerHTML.replace( space, ' ' );
		var alink=html_right[i].innerHTML;
		html_right[i].style.textAlign='center';
		
		if(alink.length>length_to_verify){
		var asplit=alink.indexOf(" ",length_to_verify);
		if (asplit!=-1) html_right[i].innerHTML=alink.substr(0,asplit)+"<br>"+alink.substr(asplit,alink.length);
		}		
	}



}
//END javascript WORD WRAP
// ###############################################################################
function addTabs() {
	setTimeout('FixMenu()', 100); // WORD WRAP FIX execution
	if (document.getElementById("browseas")) {
		var browseascell = document.getElementById("browseas");
		browseascell.innerHTML = browseAsHTML;
		var maintabscell = document.getElementById("maintabs");
		maintabscell.innerHTML = mainTabsHTML;
		var toptabscell = document.getElementById("toptabs");
		if(toptabscell != null)
			toptabscell.innerHTML = topTabsHTML;
		var bottomnavcell = document.getElementById("lowerNavRow");
		bottomnavcell.innerHTML = bottomRowHTML;
	} else {
		document.all.browseas.innerHTML = browseAsHTML;
		document.all.maintabs.innerHTML = mainTabsHTML;
		document.all.toptabs.innerHTML = topTabsHTML;
		if (document.all.lowerNavRow) {
			document.all.lowerNavRow.innerHTML = bottomRowHTML;
		}
	}

	if (document.all && document.all != undefined && document.all.quickLinksLayer != undefined) {
		document.all.quickLinksLayer.innerHTML = quickLinksHTML;
	} else if (document.getElementById("quickLinksLayer")) {
		var qL = document.getElementById("quickLinksLayer");
		qL.innerHTML = quickLinksHTML;
	}
	document.body.style.marginTop = "0px";
}

function getArrayForTabNumber(dropdownlist, tabNumber) {
	var resultArray = new Array();
	for (var i = 0; i < dropdownlist.length; i++) {
		if (dropdownlist[i].tabNumber == tabNumber) {
			resultArray.length++;
			resultArray[resultArray.length - 1] = dropdownlist[i];
		}
	}
	return resultArray;
}

function DropdownItem(tabNumber, label, link, target) {
	this.tabNumber = tabNumber;
	this.label = label;
	this.link = link;
	this.target = target;
}

function RZgoto(url, target)
{
	url = RZbaseurl(url)
	if (target != 'true' && target != '_new')
		location = url;
	else
		window.open(url)	//always new window, no features
//		RZpopupUrl( '', url )	//always new window, no features
}

function RZbaseurl(url)
{
	//----- Append baseurl to url (location does not honor html <link...> tag)
	//		TODO: validate all browsers ignore html <link...> tag
	//		(also may need to consider links starting with ../)
	if (url.substring(0,4) != "http" && url.substring(0,4) != "www.")
		url = RZ.baseurlprefix + url
	return url
}


function dropChange(tabLabel, listNumber) {
	dropdownlist = (listNumber == 1 ? dropdownlist1 : dropdownlist2);
	filteredList = getArrayForTabNumber(dropdownlist, tabLabel);
	
	bgNormal = "#205100";
	bgHover = "#339933";
	textNormal = "#FFFFFF";
	textHover = "#FFFFFF";
	var dropdownText = "";
	var cellWidth = 100 / (filteredList.length > 0 ? filteredList.length : 1) + 1;
	var dropdownrow = '<tr class="dropdownrow" style="color:' + bgHover + '; background-color:' + bgNormal + ';">';
	for (i = 0; i < filteredList.length; i++) {
		if (i != 0) {
			//This is the border bar for the dropdowns.
			dropdownText += '<td width="1" bgcolor=' + bgHover + '>'
			              + '<img style="visibility:hidden; width:1" /></td>';
		}
		dropdownText += '<td align="center" width="' + cellWidth + '%"'
		        	  + ' onclick="RZgoto('
		        	  + 	"'"
		        	  + 	filteredList[i].link
					  + 	"','"
					  + 	filteredList[i].target
		        	  + 	"'"
					  + 	')"'
					  + ' style="color:' + textNormal + '"'
					  + ' onmouseover="dropdownColorSwap(this, true);"'
					  + ' onmouseout="dropdownColorSwap(this, false);">'
					  + filteredList[i].label
					  + '</td>';
	}
	if (document.all && document.all != undefined) {
		document.all["horizdrop"].innerHTML = tableHeader + dropdownrow + dropdownText + tableFooter;
	} else if (document.getElementById("horizdrop")) {
		var horizdrop = document.getElementById("horizdrop");
		horizdrop.innerHTML = tableHeader + dropdownrow + dropdownText + tableFooter;
	}
}

function revertDrop(tabNumber) {
	if (!onTable && !onLabel) {
		if (document.all && document.all != undefined) {
			document.all["horizdrop"].innerHTML = "";
		} else {
			var horizdrop = document.getElementById("horizdrop");
			horizdrop.innerHTML = "";
		}
	}
}

function dropdownColorSwap(cell, over) {
	if (over) {
		cell.style.backgroundColor = bgHover; //previously color2
		cell.style.color = textHover; //previously undefined color4
	} else {
		cell.style.backgroundColor = bgNormal; //previously color1
		cell.style.color = textNormal; //previously color3;
	}
}

function clearSearch(theText) {
    if (theText.value == theText.defaultValue) {
        theText.value = ""
    }
}
