




if (typeof RZlogin == "undefined") {
	var RZlogin = new Function("return false");
}

var showRelated = false;
var showOther = false;


var quickLinksHTML = '<select onchange="navigateWithQuickLinks(this)">'
                      + '<option>Quick Links</option>'
 
					  + '<option value="SCMAC.html">Animal Control</option>'
 
					  + '<option value="aboutus.html">Community Links</option>'
 
					  + '<option value="ccagendas.html">County Commission Meetings</option>'
 
					  + '<option value="http://www.chathamcounty.org/jims/">Court Case Lookups</option>'
 
					  + '<option value="chatcourts.html">Chatham County Courts</option>'
 
					  + '<option value="http://cema.chathamcounty.org">Chatham Emergency Management Agency (CEMA)</option>'
 
					  + '<option value="employment.asp">Employment Opportunities</option>'
 
					  + '<option value="prc.html">Property Record Cards</option>'
 
					  + '<option value="purchasing.html">Purchasing</option>'
 
					  + '<option value="http://www.scmpd.org">Savannah Chatham Metropolitan Police</option>'
 
					  + '<option value="browse_as_dropdown_T33_R3.html">School Help</option>'
 
					  + '<option value="generallist_T30_R13.html">SPLOST Information</option>'
 
					  + '<option value="department_freeform_T7_R132.html">Superior Court Clerk - Online Forms</option>'

                      + '</select>';

var bottomRowHTML = '<table cellspacing="0" cellpadding="0" border="0" width="100%" ><tr>';

 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="browseas1.html">Browse '
				+ 'as Resident</a></td>';
 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="browseas2.html">Browse '
				+ 'as Business</a></td>';
 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="browseas3.html">Browse '
				+ 'as Visitor</a></td>';

 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="">'
				+ '</a></td>';


bottomRowHTML += '</table>';


var browseAsHTML =				  
					'<table id="browseastable" width="100%" cellspacing="0" cellpadding="4" border="0">'
                    + '<tr>'
                      + '<td class="browseitalic"> Browse as: </td>';


var label = "Resident";

browseAsHTML 	+= ''
                      + '<td class="browse" onmouseover="onLabel=true; dropChange('
					  + '\'' + label + '\''
					  + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a class="browse" href="'
					  + 'browseas1.html'
					  + '">'
					  + 'Resident</a>' 
					  + '</td>'



var label = "Business";

browseAsHTML 	+= ''
                      + '<td class="browse" onmouseover="onLabel=true; dropChange('
					  + '\'' + label + '\''
					  + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a class="browse" href="'
					  + 'browseas2.html'
					  + '">'
					  + 'Business</a>' 
					  + '</td>'



var label = "Visitor";

browseAsHTML 	+= ''
                      + '<td class="browse" onmouseover="onLabel=true; dropChange('
					  + '\'' + label + '\''
					  + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a class="browse" href="'
					  + 'browseas3.html'
					  + '">'
					  + 'Visitor</a>' 
					  + '</td>'



                    + '</tr>'
                  + '</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('
					  + '\'\', 2);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a href="" class="tabs">'
					  + ''
					  + '</a>'
					  + '</td>'


                    + '</tr>'
                 + ' </table>';
var topTabsHTML =
		  	'<table id="toprighttable" border="0" cellspacing="0" cellpadding="0" align="right" valign="bottom">'
				+ '<tr>'

					+ '<td class="toprightlabels">'
					+ '<a href="index.html" class="toprightlabels">'
					+ 'Home'
					+ '</a>'
					+ '</td>'

					+ '<td class="toprightlabels">'
					+ '<a href="departments.html" class="toprightlabels">'
					+ 'Departments'
					+ '</a>'
					+ '</td>'

					+ '<td class="toprightlabels">'
					+ '<a href="contactus.html" class="toprightlabels">'
					+ 'Contact&nbsp;Us'
					+ '</a>'
					+ '</td>'

					+ '<td class="toprightsearch">'
					+ '</td>'
				+ '</tr>'
			+ '</table>';/*
					+ 'Search '
					+ '<span>'
					+ '<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="RZbase_url" value="http://revize.idetix.com/revize"/>'
					+ '<input type="hidden" name="RZbase_dir" value="c:\\inetpub\\wwwroot\\revize"/>'
					+ '<input type="hidden" name="RZlocation" value="portal_generic_county"/>'
					+ '<input type="hidden" name="RZfilenames" value="*.html"/>'
					+ '<input type="hidden" name="RZsubfolders" value="true"/> '
					+ '<input name="RZkeywords" class="searchinput" type="text"/> '
					+ '<input type="button" class="searchbutton" value="Go" onclick="document.searchForm.submit()"/>'
					+ '</span>'
*/


var onTable = false;
var onLabel = false;
var tableHeader = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" onmouseover="onTable = true; " onmouseout="onTable = false; setTimeout(\'revertDrop()\', 2000);">';
var tableFooter = '</tr></table>';
var filteredList;
var dropdownList;
var color1;
var color2;
var dropdownlist1 = new Array();
var dropdownlist2 = new Array();

function navigateWithQuickLinks(formElement) {
	location = formElement.value;
}

function setUpDropDowns() {
	//will be replaced with Revize enabling


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Business", "Vendor", "browse_as_dropdown_T33_R6.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Visitor", "Prospective Resident", "browse_as_dropdown_T33_R12.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Resident", "Student", "browse_as_dropdown_T33_R3.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Business", "License Seeker", "browse_as_dropdown_T33_R8.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Visitor", "Prospective Business", "browse_as_dropdown_T33_R13.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Business", "Site Seeker", "browse_as_dropdown_T33_R9.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Visitor", "Tourist", "browse_as_dropdown_T33_R14.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Resident", "Volunteer", "browse_as_dropdown_T33_R5.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Business", "Developer/Builder", "browse_as_dropdown_T33_R10.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Resident", "Job Hunter", "browse_as_dropdown_T33_R2.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Business", "Flood Zone Inquirer", "browse_as_dropdown_T33_R11.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Resident", "Property Owner/Tax Payer", "browse_as_dropdown_T33_R4.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Resident", "Juror", "browse_as_dropdown_T33_R7.html");




		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("How do I...?", "Click here for answers to Frequently Asked Questions.", "howdoi.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Your County", "Government", "government.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Your County", "Departments", "departments.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Your County", "Programs & Services", "countywideprograms.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Your County", "News", "countywidenews.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Your County", "Events", "countywideevents.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Your County", "Applications/Forms", "downloadforms.html");


}

function addTabs() {
	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");
		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.images.logoImage) {

		document.images.logoImage.src='Chatham/Seal02.gif';
		document.images.logoImage.alt='Chatham County Seal';
	}
	if (document.all && document.all != undefined) {
		document.all.quickLinksLayer.style.width = "350px";
		document.all.quickLinksLayer.style.textAlign = "right";
		document.all.quickLinksLayer.style.posRight = 35;
		document.all.quickLinksLayer.style.posTop = 23;
		document.all.quickLinksLayer.innerHTML = quickLinksHTML;
	} else if (document.getElementById("quickLinksLayer")) {
		var qL = document.getElementById("quickLinksLayer");
		qL.style.width = "350px";
		qL.style.textAlign = "right";
		qL.style.right = "27px";
		qL.style.top = "15px";
		qL.innerHTML = quickLinksHTML;
	}
}

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) {
	this.tabNumber = tabNumber;
	this.label = label;
	this.link = link;
}


function dropChange(tabLabel, listNumber) {
	dropdownlist = (listNumber == 1 ? dropdownlist1 : dropdownlist2);
	filteredList = getArrayForTabNumber(dropdownlist, tabLabel);
	color1 = (listNumber == 1 ? "993333" : "2C2972");
	color2 = (listNumber == 1 ? "F9E5B5" : "DDDDDD");
	var dropdownText = "";
	var cellWidth = 100 / (filteredList.length > 0 ? filteredList.length : 1) + 1;
	var dropdownrow = '<tr class="dropdownrow" style="color:' + color1 + '; background-color:' + color2 + ';">';
	for (i = 0; i < filteredList.length; i++) {
		if (i != 0) {
			//This is the border bar for the dropdowns.
			dropdownText += '<td width="1" bgcolor=' + color1 + '><img style="visibility:hidden; width:1" /></td>';
		}
		dropdownText += "<td align=\"center\" width=\"" + cellWidth + "%\" onclick=\"location='" + filteredList[i].link + "'\""
				+ " style=\"color:" + color1 + "\" 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 = tableHeader + "<td></td>" + tableFooter;
		} else {
			var horizdrop = document.getElementById("horizdrop");
			horizdrop.innerHTML = tableHeader + "<td></td>" + tableFooter;
		}
	}
}

function dropdownColorSwap(cell, over) {
	if (over) {
		cell.style.backgroundColor = color1;
		cell.style.color = "FFFFFF";
	} else {
		cell.style.backgroundColor = color2;
		cell.style.color = color1;
	}
}

function leftNavColorSwap(cell, over, lower) {
	var overColor = "000066";
	var overBackground = "CCCCCC";
	var overBorder = "000066";
	var offColor = "000066";
	var offBorder = (lower ? "FFFFFF" : "AAAACC");
	var offBackground = (lower ? "FFFFFF" : "AAAACC");
	if (over) {
		cell.style.borderWidth = "1px";
		cell.style.borderColor = "000066";
		cell.style.borderStyle = "solid";
		cell.style.backgroundColor = overBackground;
		cell.style.color = overColor;
	} else {
		cell.style.borderWidth = "1px";
		cell.style.backgroundColor = offBackground;
		cell.style.borderColor = offBorder;
		cell.style.color = offColor;

	}
}

function showRelatedAndOther(showRelated, showOther) {
	if (document.getElementById("relatedareas") != null) {
		if (showRelated || RZlogin()) {
			document.getElementById("relatedareas").style.display = "";
			showRelated = false;
		} 
	}
	if (document.getElementById("otherresources") != null) {
		if (showOther || RZlogin()) {
			document.getElementById("otherresources").style.display = "";
			showOther = false;
		} 
	}
}
