







var quickLinksHTML = '<select onchange="navigateWithQuickLinks(this)">'
                      + '<option>Quick Links</option>'
 
					  + '<option value="http://cityofriverview.pegcentral.com/">Government Access Channel Video Recordings</option>'
 
					  + '<option value="generallist_T30_R371.html">Boards and Commissions and Commitees</option>'
 
					  + '<option value="boatramp.html">Boat Ramp</option>'
 
					  + '<option value="http://www.cityofriverview.com/department_forms_T47_R366.html">Budget Information</option>'
 
					  + '<option value="citycouncilgovernment.html">City Council Members</option>'
 
					  + '<option value="agendas.html">City Council Meeting Agendas</option>'
 
					  + '<option value="meetings.html">City Council Meeting Minutes</option>'
 
					  + '<option value="http://library.municode.com/index.aspx?clientID=10715&stateID=22&statename=Michigan">City of Riverview Charter and Ordinances</option>'
 
					  + '<option value="http://www.municode.com/Resources/ClientCode_List.asp?cn=Riverview&sid=22&cid=11811">City of Riverview Zoning Ordinance</option>'
 
					  + '<option value="http://www.cityofriverview.com/suggestions.html">City Suggestion Form</option>'
 
					  + '<option value="downloadforms.html">Download Forms</option>'
 
					  + '<option value="http://gwarchive:8080/revize/riverview/generallist_T30_R376.html">Fee Schedule</option>'
 
					  + '<option value="riverview/2011phonelists.pdf">Helpful Phone Numbers</option>'
 
					  + '<option value="index.html">Home</option>'
 
					  + '<option value="department_jobs_T39_R221.html">Jobs</option>'
 
					  + '<option value="http://riverviewcity.is.bsasoftware.com">Online Tax Information</option>'
 
					  + '<option value="LP.html">Riverview Land Preserve</option>'
 
					  + '<option value="voter_information.html">Voter and Election Information</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="calendar_app">Browse '
				+ 'as Event Calendar</a></td>';

 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="aboutus.html">'
				+ 'City of Riverview</a></td>';
 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="http://www.cityofriverview.com/riverview/StreetRepairPlanning.pdf">'
				+ 'City Map</a></td>';
 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="government.html">'
				+ 'Government Info</a></td>';
 
bottomRowHTML += '<td align="center"> <a style="font-size: 8pt" href="howdoi.html">'
				+ 'How do I...?</a></td>';


bottomRowHTML += '</table>';

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

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


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


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


                      + '<td class="browse" onmouseover="onLabel=true; dropChange('
					  + '\'Event Calendar\''
					  + ', 1);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a class="browse" href="'
					  + 'calendar_app'
					  + '">'
					  + 'Event Calendar</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('
					  + '\'City of Riverview\', 2);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a href="aboutus.html" class="tabs">'
					  + 'City of Riverview'
					  + '</a>'
					  + '</td>'

                      + '<td width="2" class="tabs" onmouseover="onLabel=true; dropChange('
					  + '\'City Map\', 2);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a href="http://www.cityofriverview.com/riverview/StreetRepairPlanning.pdf" class="tabs">'
					  + 'City Map'
					  + '</a>'
					  + '</td>'

                      + '<td width="2" class="tabs" onmouseover="onLabel=true; dropChange('
					  + '\'Government Info\', 2);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a href="government.html" class="tabs">'
					  + 'Government Info'
					  + '</a>'
					  + '</td>'

                      + '<td width="2" class="tabs" onmouseover="onLabel=true; dropChange('
					  + '\'How do I...?\', 2);" onmouseout="onLabel=false; setTimeout(\'revertDrop()\', 2000);"> '
					  + '<a href="howdoi.html" class="tabs">'
					  + 'How do I...?'
					  + '</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 Us'
					+ '</a>'
					+ '</td>'

					+ '<td class="toprightsearch">'
					+ 'Search '
					+ '<span>'
					+ '<input type="hidden"  name="sitesearch" value="www.cityofriverview.com"/>'
					+ '<input name="q" class="searchinput" type="text"/> '
					+ '<input type="submit" class="searchbutton" value="Go"/>'
					+ '</span>'
					+ '</td>'
				+ '</tr>'
			+ '</table>';


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("Visitor", "Informational links", "browse_as_dropdown_T33_R7.html");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Resident", "Online Tax Information", "http://riverviewcity.is.bsasoftware.com");


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Business", "Important Phone Numbers", "riverview/city_services_directory.htm");


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


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Resident", "Border Crossing Info", "browse_as_dropdown_T33_R14.html");


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


		dropdownlist1.length++;
		dropdownlist1[dropdownlist1.length - 1] = new DropdownItem("Event Calendar", "Event Calendar", "browse_as_dropdown_T33_R17.html");




		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("City of Riverview", "Departments", "departments.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("City of Riverview", "Employment", "department_jobs_T39_R221.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("City of Riverview", "City Council", "citycouncilgovernment.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("How do I...?", "Online Tax Info", "http://riverviewcity.is.bsasoftware.com");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("City of Riverview", "Programs & Services", "allprograms.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("City of Riverview", "Committees", "generallist_T30_R238.html");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Government Info", "Government Access Channel Recordings", "http://cityofriverview.pegcentral.com/");


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Government Info", "Government Access Channel Program Guide", "RTVGuide.html");


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


		dropdownlist2.length++;
		dropdownlist2[dropdownlist2.length - 1] = new DropdownItem("Government Info", "Download 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='riverview/newriverviewlogosmall.gif';
	}
	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;

	}
}

