﻿$(document).ready(function() {
	if ($('#thisImage').length > 0){
		if ($('#thisImage')[0].width > 300){
			$('#thisImage').attr({'width':'300'});
		}
	}
});	



var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ie = (agt.indexOf("msie") != -1);
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.") == -1));
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = is_ie && is_major == 4 && agt.indexOf("msie 5.0") != -1;
var is_ie6 = is_ie && is_major == 4 && agt.indexOf("msie 6.0") != -1;
var is_ie7 = is_ie && is_major == 4 && agt.indexOf("msie 7.0") != -1;
var is_ie8 = is_ie && is_major == 4 && agt.indexOf("msie 8.0") != -1;
var is_ie55up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_aol = (agt.indexOf("aol") != -1);
var is_opera = (agt.indexOf("opera") != -1);
var is_webtv = (agt.indexOf("webtv") != -1);
var is_mac = (agt.indexOf("mac") != -1);
var is_sun = (agt.indexOf("sunos") != -1);
var is_irix = (agt.indexOf("irix") != -1);
var is_hpux = (agt.indexOf("hp-ux") != -1);
var is_aix = (agt.indexOf("aix") != -1);
var is_linux = (agt.indexOf("inux") != -1);
var is_sco = (agt.indexOf("sco") != -1) || (agt.indexOf("unix_sv") != -1);
var is_unixware = (agt.indexOf("unix_system_v") != -1);
mapWin = null;
photoWin = null;
VirtualTourWin = null;
window.offscreenBuffering = true
var ClearPixel, CatOn1, CatOn2, CatOff1, CatOff2;
var home_navigation, home_navigation_f2, home_navigation_f3, home_navigation_f4, home_navigation_f5, home_navigation_f6, home_navigation_f7, home_navigation_f8, home_navigation_f9;
var about_the_state, about_the_state_f2, about_the_state_f3, about_the_state_f4, about_the_state_f5, about_the_state_f6, about_the_state_f7, about_the_state_f8, about_the_state_f9;
var n = navigator.appName
if (n == "Microsoft Internet Explorer") {
	document.write("<style type='text/css'>");
	document.write(".content       {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".contentlabel1 {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".contentlabel2 {font-family:arial,sans-serif;font-size: 10pt;}");
	document.write(".contentlabel3 {font-family:arial,sans-serif;font-size: 11pt;}");
	document.write(".contentlabel4 {font-family:arial,sans-serif;font-size: 12pt;}");
	document.write(".demograph     {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".letterlist    {font-family:arial,sans-serif;font-size:  8pt;}");
	document.write(".menuitemlist  {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".menulist      {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".regionlist    {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".weathertype   {font-family:arial,sans-serif;font-size:  7pt;}");
	document.write(".description   {font-family:arial,sans-serif;}");
	document.write("form		   {margin-bottom: 0px;margin-top: 0px;}");
	document.write("</style>");
}
if (n == "Netscape") {
	document.write("<style type='text/css'>");
	document.write(".content       {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".contentlabel1 {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".contentlabel2 {font-family:arial,sans-serif;font-size: 10pt;}");
	document.write(".contentlabel3 {font-family:arial,sans-serif;font-size: 11pt;}");
	document.write(".contentlabel4 {font-family:arial,sans-serif;font-size: 12pt;}");
	document.write(".demograph     {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".letterlist    {font-family:arial,sans-serif;font-size:  8pt;}");
	document.write(".menuitemlist  {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".menulist      {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".regionlist    {font-family:arial,sans-serif;font-size:  9pt;}");
	document.write(".weathertype   {font-family:arial,sans-serif;font-size:  7pt;}");
	document.write("form		   {margin-bottom: 0px;margin-top: 0px;}");
	document.write("</style>");
}
function pageLoad(pageTitle, pageName, currentURL, targetTD, referringPage, footerImg, footerURL, navMapName, imgLocation) {
	if (properEnvironment()) {
		if (document.all.HomeHref) {
			var docname = document;
		} else {
			var docname = parent.document;
		}
		docname.title = pageTitle.replace("|", "'");
		docname.pageName = pageName;
		docname.currentURL = currentURL;
		imgLocation = imgLocation.replace("../", "")
		if (document.all.contentDiv) {
			parent.document.all.contentFrame.width = "100%";
			parent.document.all.contentFrame.style.display = "";
			parent.document.all.innercontentDiv.innerHTML = "";
		}
		docname.all.homenavigation.src = imgLocation + navMapName;
		parent.scrollTo(0, 0);
		if (docname.all.frmSearch) {
			if (docname.all.frmSearch.action.indexOf("targetTD") == -1) {
				docname.all.frmSearch.action = docname.all.frmSearch.action + "?targetTD=content";
			}
			docname.all.frmSearch.target = "contentFrame";
			docname.all.frmSearch.formTarget.value = "contentFrame";
		}
		if (pageName == "home.asp") {
			hideHomePageElements();
		} else {
			docname.all.HomeHref.style.visibility = "visible";
			docname.all.HomeHref.href = "home.asp";
			docname.all.ImgHomeHref.src = imgLocation + "test-gradient3.jpg";
			docname.all.HomeHrefLabel.innerText = " Home";
			docname.all.navFeatures.style.display = "";
		}
		if (targetTD == "content") {
			if (pageName == "content.asp" || pageName == "search.asp") {
				if (docname.all.footerImage.src != imgLocation + footerImg) {
					docname.all.footerImage.src = imgLocation + footerImg;
				}
				if (footerURL != "" && footerURL != null) {
					docname.all.footerImageHref.href = footerURL.replace("../", "");
					docname.all.footerImageHref.target = "_blank";
				} else {}
			} else {
				docname.all.footerImage.src = imgLocation + "clear-pixel.gif";
			}
			if (pageName == "content.asp") {
				docname.all.StatewideHref.style.visibility = "visible";
				docname.all.StatewideHref.href = "content.asp?Rgn=10000";
				docname.all.ImgStatewideHref.src = imgLocation + "test-gradient3.jpg";
				docname.all.StatewideHrefLabel.innerText = " Statewide";
			} else {
				docname.all.StatewideHref.style.visibility = "hidden";
			}
		}
		if (document.all.contentDiv) {
			var docHeight = Math.max(document.all.contentDiv.scrollHeight, (parent.document.all.lastDivider.offsetTop - 8));
			parent.document.all.contentFrame.height = docHeight;
		}
		parent.document.all.contentFrame.contentWindow.document.body.style.cursor = '';
		parent.document.body.style.cursor = '';
	}
}
function getHref(obj) {
	if (properEnvironment()) {
		parent.document.body.style.cursor = 'wait';
		if (parent.document.all.contentFrame.contentWindow.document != null) {
			parent.document.all.contentFrame.contentWindow.document.body.style.cursor = 'wait';
		}
		if (!obj.href) {
			if (!obj.action) {
				return;
			} else {
				if (obj.name == "frmCities") {
					obj.DescripOnly.value = "Yes";
					obj.target = "newContentFrame";
					obj.submit()
				}
				return;
			}
		}
		var oldHref = parent.document.currentURL;
		oldHref = oldHref.replace("javascript:newContent('", "");
		oldHref = oldHref.replace("&targetTD=content'", "");
		oldHref = oldHref.replace("?targetTD=content'", "");
		oldHref = oldHref.replace("&DescripOnly=Yes'", "");
		oldHref = oldHref.replace("&btnSubmit=Search&formTarget=contentFrame", "");
		oldHref = oldHref.replace("')", "");
		oldHref = oldHref.replace(")", "");
		var newHref = obj.href;
		newHref = newHref.replace("javascript:newContent('", "");
		newHref = newHref.replace("&targetTD=content'", "");
		newHref = newHref.replace("?targetTD=content'", "");
		newHref = newHref.replace("&DescripOnly=Yes'", "");
		newHref = newHref.replace("&btnSubmit=Search&formTarget=contentFrame", "");
		newHref = newHref.replace("')", "");
		newHref = newHref.replace(")", "");
		if (oldHref.indexOf("Rgn=") > -1 && newHref.indexOf("Rgn=") > -1) {
			var oldRegion = oldHref.substr(oldHref.indexOf("Rgn="), 9);
			var newRegion = newHref.substr(newHref.indexOf("Rgn="), 9);
			if (obj.name == "bannerNavMap" || obj.name == "StatewideHref") {
				if (document.pageName == "content.asp") {
					newHref = oldHref.replace(oldRegion, newRegion);
				}
				if (document.pageName != "content.asp") {
					newHref = newHref.replace("content.asp", "main.asp");
				}
			} else {
				newHref = newHref.replace(newRegion, oldRegion);
			}
		}
		if (false) {
			if (oldHref.indexOf("ESM=&") == -1) {
				if (oldHref.indexOf("ESM=") > -1 && newHref.indexOf("ESM=") == -1) {
					newHref = newHref + "&" + oldHref.substr(oldHref.indexOf("ESM="), (oldHref.indexOf("EEY=") + 7) - oldHref.indexOf("ESM=") + 1);
				}
				if (oldHref.indexOf("ESM=") == -1 && newHref.indexOf("ESM=") > -1) {
					newHref = newHref.replace(newHref.substr(newHref.indexOf("ESM=") - 1, (newHref.indexOf("EEY=") + 7) - newHref.indexOf("ESM=") + 1), "");
				}
			}
			if (oldHref.indexOf("ESM=&") > -1 || oldHref.indexOf("ESM=") == -1) {
				if (newHref.indexOf("ESM=&") > -1 || newHref.indexOf("ESM=") > -1) {
					newHref = newHref.replace(newHref.substr(newHref.indexOf("ESM=") - 1, (newHref.indexOf("EEY=") + 3) - newHref.indexOf("ESM=") + 1), "");
				}
			}
		}
		if (newHref.indexOf("javascript:newContent(") == -1) {
			newHref = "javascript:newContent('" + newHref;
		}
		if (newHref.indexOf("&DescripOnly=") == -1) {
			if (newHref.indexOf("StrtLtr=") > -1 || newHref.indexOf("Dir=") > -1 || newHref.indexOf("CtyLU=") > -1) {
				newHref = newHref + "&DescripOnly=Yes";
			} else {
				newHref = newHref.replace("SrchCity=", "SC=")
			}
		}
		if (newHref.indexOf("&targetTD=") == -1) {
			newHref = newHref + "&targetTD=content";
		}
		newHref = newHref + "')";
		newHref = newHref.replace(".asp=&", ".asp?");
		newHref = newHref.replace(".asp&", ".asp?");
		obj.href = newHref;
	}
}
function newContent(strURL) {
	if (strURL.indexOf("DescripOnly=Yes") > -1) {
		parent.document.all.newContentFrame.contentWindow.document.location.href = strURL;
	} else {
		parent.document.all.contentFrame.contentWindow.document.location.href = strURL;
	}
}
function descripLoad() {
	if (parent.document.all.newContentFrame.contentWindow.document.all.divDescrip && parent.document.all.newContentFrame.contentWindow.document.all.divDescrip != null) {
		var strHTML = parent.document.all.newContentFrame.contentWindow.document.all.divDescrip.innerHTML;
		parent.document.all.contentFrame.contentWindow.document.all.divDescrip.innerHTML = strHTML;
		var docHeight = Math.max(parent.document.all.contentFrame.contentWindow.document.all.contentDiv.scrollHeight, (parent.document.all.lastDivider.offsetTop - 8));
		parent.document.all.contentFrame.height = docHeight;
	} else {}
	parent.document.all.contentFrame.contentWindow.document.body.style.cursor = '';
	parent.document.body.style.cursor = '';
}
function hideHomePageElements() {
	if (properEnvironment()) {
		parent.document.all.HomeHref.style.visibility = "hidden";
		parent.document.all.HomeHref.href = "";
		parent.document.all.StatewideHref.style.visibility = "hidden";
		parent.document.all.StatewideHref.href = "";
	}
}
function setHomePageSearchTarget() {
	if (!document.currentURL) {
		document.currentURL = "home.asp"
	}
	if (!document.pageName) {
		document.pageName = "home.asp"
	}
	if (properEnvironment()) {
		if (parent.document.all.frmSearch) {
			if (parent.document.all.frmSearch.action.indexOf("targetTD") == -1) {
				parent.document.all.frmSearch.action = parent.document.all.frmSearch.action + "?targetTD=content";
			}
			parent.document.all.frmSearch.target = "contentFrame";
			parent.document.all.frmSearch.formTarget.value = "contentFrame";
		}
	}
}
function preloadImages(strImagesLocation) {
	var d = parent.document;
	if (d.images) {
		ClearPixel = new Image();
		ClearPixel.src = strImagesLocation + "clear-pixel.gif";
		CatOn1 = new Image();
		CatOn1.src = strImagesLocation + "test-gradient2-blue.jpg";
		CatOn2 = new Image();
		CatOn2.src = strImagesLocation + "test-gradient4-blue.jpg";
		CatOff1 = new Image();
		CatOff1.src = strImagesLocation + "test-gradient-blue.jpg";
		CatOff2 = new Image();
		CatOff2.src = strImagesLocation + "test-gradient3-blue.jpg";
		home_navigation = new Image();
		home_navigation.src = strImagesLocation + "home-navigation.gif";
		home_navigation_f2 = new Image();
		home_navigation_f2.src = strImagesLocation + "home-navigation_f2.gif";
		home_navigation_f3 = new Image();
		home_navigation_f3.src = strImagesLocation + "home-navigation_f3.gif";
		home_navigation_f4 = new Image();
		home_navigation_f4.src = strImagesLocation + "home-navigation_f4.gif";
		home_navigation_f5 = new Image();
		home_navigation_f5.src = strImagesLocation + "home-navigation_f5.gif";
		home_navigation_f6 = new Image();
		home_navigation_f6.src = strImagesLocation + "home-navigation_f6.gif";
		home_navigation_f7 = new Image();
		home_navigation_f7.src = strImagesLocation + "home-navigation_f7.gif";
		home_navigation_f8 = new Image();
		home_navigation_f8.src = strImagesLocation + "home-navigation_f8.gif";
		home_navigation_f9 = new Image();
		home_navigation_f9.src = strImagesLocation + "home-navigation_f9.gif";
		about_the_state = new Image();
		about_the_state.src = strImagesLocation + "about-the-state.gif";
		about_the_state_f2 = new Image();
		about_the_state_f2.src = strImagesLocation + "about-the-state_f2.gif";
		about_the_state_f3 = new Image();
		about_the_state_f3.src = strImagesLocation + "about-the-state_f3.gif";
		about_the_state_f4 = new Image();
		about_the_state_f4.src = strImagesLocation + "about-the-state_f4.gif";
		about_the_state_f5 = new Image();
		about_the_state_f5.src = strImagesLocation + "about-the-state_f5.gif";
		about_the_state_f6 = new Image();
		about_the_state_f6.src = strImagesLocation + "about-the-state_f6.gif";
		about_the_state_f7 = new Image();
		about_the_state_f7.src = strImagesLocation + "about-the-state_f7.gif";
		about_the_state_f8 = new Image();
		about_the_state_f8.src = strImagesLocation + "about-the-state_f8.gif";
		about_the_state_f9 = new Image();
		about_the_state_f9.src = strImagesLocation + "about-the-state_f9.gif";
		welcome_to_va = new Image();
		welcome_to_va.src = strImagesLocation + "welcome.gif";
		travel_guide = new Image();
		travel_guide.src = strImagesLocation + "travelguide.jpg";
	}
}
function rollMouse(imgName, newImage) {
	if (parent.document.images) {
		if (parent.document[imgName]) {
			parent.document[imgName].src = eval(newImage).src;
		} else {
			if (document[imgName]) {
				document[imgName].src = parent.eval(newImage).src;
			}
		}
	}
}
function openMap(theURL) {
	var n = navigator.appName;
	if (n == "Microsoft Internet Explorer") {
		if (mapWin) {
			mapWin.close();
		}
		var ch = parent.window.document.body.clientHeight + 65;
	}
	if (n == "Netscape") {
		if (mapWin) {
			if (mapWin.document) {
				mapWin.close();
			}
		}
		var ch = parent.window.innerHeight + 65;
	}
	var winParms = "width=620,height=" + ch + ",scrollbars=yes,resizable=yes,menubar=no";
	mapWin = open(theURL, "mapWin", winParms, false);
	mapWin.document.close()
	mapWin.focus();
}
function openMap2(theURL) {
	var n = navigator.appName;
	if (n == "Microsoft Internet Explorer") {
		if (mapWin) {
			mapWin.close();
		}
		var ch = parent.window.document.body.clientHeight + 65;
	}
	if (n == "Netscape") {
		if (mapWin) {
			if (mapWin.document) {
				mapWin.close();
			}
		}
		var ch = parent.window.innerHeight + 65;
	}
	var winParms = "width=650,height=" + ch + ",scrollbars=yes,resizable=yes,menubar=no";
	mapWin = open(theURL, "mapWin", winParms, false);
	mapWin.document.close()
	mapWin.focus();
}
function openPhoto(thePhoto, winTitle) {
	var n = navigator.appName;
	if (n == "Microsoft Internet Explorer") {
		if (photoWin) {
			photoWin.close();
		}
	}
	if (n == "Netscape") {
		if (photoWin) {
			if (photoWin.document) {
				photoWin.close();
			}
		}
	}
	var crlf = String.fromCharCode(13) + String.fromCharCode(13);
	photoWin = window.open("", "photoWin", "scrollbars=no,menubar=no,resizable=yes,height=100,width=100", true);
	photoWin.document.write("<HTML>" + crlf);
	photoWin.document.write("<HEAD>" + crlf);
	photoWin.document.write("<TITLE>" + winTitle + "</TITLE>" + crlf);
	photoWin.document.write("</HEAD>" + crlf);
	photoWin.document.write("<BODY background='../images/background.jpg'>" + crlf);
	if (n == "Microsoft Internet Explorer") {
		photoWin.document.write("<IMG name='photo' SRC='" + thePhoto + "' ALT='" + winTitle + "' TITLE='" + winTitle + "' vspace=0 hspace=0 border=0 onload='window.resizeTo(this.width+30,this.height+60)'>" + crlf);
	} else {
		photoWin.document.write("<IMG name='photo' SRC='" + thePhoto + "' ALT='" + winTitle + "' TITLE='" + winTitle + "' vspace=0 hspace=0 border=0 onload='window.resizeTo(this.width+20,this.height+20)'>" + crlf);
	}
	photoWin.document.write("</BODY>" + crlf);
	photoWin.document.write("</HTML>" + crlf);
	photoWin.document.close();
	photoWin.focus();
}
function resizeImage(theImage) {
	if (theImage.width > 300) {
		theImage.width = 300;
	}
}
function openVirtualTour(theURL) {
	var n = navigator.appName;
	if (n == "Microsoft Internet Explorer") {
		if (VirtualTourWin) {
			VirtualTourWin.close();
		}
	}
	if (n == "Netscape") {
		if (VirtualTourWin) {
			if (VirtualTourWin.document) {
				VirtualTourWin.close();
			}
		}
	}
	var crlf = String.fromCharCode(13) + String.fromCharCode(13);
	VirtualTourWin = window.open(theURL, "VirtualTourWin", "scrollbars=no,menubar=no,resizable=yes,height=475,width=400", true);
}
function saveToTrip(CharacteristicID) {
	var cookieDate = new Date();
	cookieDate.setTime(cookieDate.getTime() + (1000 * 60 * 60 * 24 * 30));
	var cookieExpire = new Date();
	cookieExpire.setTime = cookieDate.getTime();
	var cookieStr = unescape(document.cookie)
	if (cookieStr.indexOf("." + CharacteristicID + ".") == -1) {
		startpos = cookieStr.indexOf("TripID=") + 7;
		endpos = cookieStr.lastIndexOf(".");
		cookieLength = endpos - startpos;
		cookieStr = cookieStr.substr(startpos, cookieLength) + "." + CharacteristicID + ".";
		document.cookie = "TripID=" + escape(cookieStr) + ";expires=" + cookieDate.toGMTString();
	}
	alert('This item has been saved to your Trip Planner.\rNow click Trip Planner at the top of the page\rto review and print your tailored Virginia itinerary.');
	return;
}
function removeFromTrip(CharacteristicID) {
	var cookieDate = new Date();
	cookieDate.setTime(cookieDate.getTime() + (1000 * 60 * 60 * 24 * 30));
	var cookieExpire = new Date();
	cookieExpire.setTime = cookieDate.getTime();
	var n = navigator.appName
	if (n == "Microsoft Internet Explorer") {
		var strDelimiter = ".";
	}
	if (n == "Netscape") {
		var strDelimiter = ".";
	}
	var cookieStr = unescape(document.cookie);
	startpos = cookieStr.indexOf("TripID=") + 7;
	endpos = cookieStr.lastIndexOf(strDelimiter) + 1;
	cookieLength = endpos - startpos;
	cookieStr = cookieStr.substr(startpos, cookieLength);
	cookieStr = cookieStr.replace(strDelimiter + CharacteristicID + strDelimiter, strDelimiter);
	document.cookie = "TripID=0;expires=" + cookieExpire.toGMTString();
	if (cookieStr.length > 1) {
		document.cookie = "TripID=" + escape(cookieStr) + ";expires=" + cookieDate.toGMTString();
	}
	document.location.reload(true);
}
function removeAllTrip() {
	var cookieDate = new Date();
	cookieDate.setTime(cookieDate.getTime() + (1000 * 60 * 60 * 24 * 30));
	var cookieExpire = new Date();
	cookieExpire.setTime = cookieDate.getTime();
	var n = navigator.appName
	if (n == "Microsoft Internet Explorer") {
		var strDelimiter = ".";
	}
	if (n == "Netscape") {
		var strDelimiter = ".";
	}
	document.cookie = "TripID=0;expires=" + cookieExpire.toGMTString();
	document.location.reload(true);
}
function initializeCategories() {
	document.frmSearch.ddlCategories.options.length = arrItems.length;
	var strOut = "No categories : " + arrItems.length + "\n";
	for (var i = 1; i < arrItems.length; i++) {
		frmSearch.ddlCategories.options[i].text = arrItems[i][0];
		frmSearch.ddlCategories.options[i].value = arrItems[i][1];
	}
	frmSearch.ddlCategories.options[0].text = "All Categories";
	frmSearch.ddlCategories.options[0].value = 0;
	frmSearch.ddlItems.options[0].selected = true;
}
function selectCity(objForm) {
	var i = objForm.ddlRegions.selectedIndex;
	var OldCity = objForm.ddlCities.value;
	var NewRegion = true;
	if (i > 0) {
		objForm.ddlCities.options.length = arrCities[i].length - 1;
		for (var j = 1; j < arrCities[i].length; j++) {
			objForm.ddlCities.options[j - 1].text = arrCities[i][j];
			objForm.ddlCities.options[j - 1].value = arrCities[i][j];
			if (arrCities[i][j] == OldCity) {
				objForm.ddlCities.options[j - 1].selected = true;
				NewRegion = false;
			}
		}
		if (NewRegion == true) {
			objForm.ddlCities.options[0].selected = true;
		}
	} else {}
}
function selectCityLocality(objForm) {
	var i = objForm.ddlLocalities.value;
	var a = objForm.ddlLocalities.selectedIndex;
	var OldCity = objForm.ddlCities.value;
	var NewLocality = true;
	var array_num = "";
	if (a > 0) {
		for (var k = 1; k < 135; k++) {
			if (arrCityLocality[k][0] == i) {
				array_num = k;
			}
		}
		objForm.ddlCities.options.length = arrCityLocality[array_num].length - 1;
		for (var j = 1; j < arrCityLocality[array_num].length; j++) {
			objForm.ddlCities.options[j - 1].text = arrCityLocality[array_num][j];
			objForm.ddlCities.options[j - 1].value = arrCityLocality[array_num][j];
			if (arrCityLocality[array_num][j] == OldCity) {
				objForm.ddlCities.options[j - 1].selected = true;
				NewLocality = false;
			}
		}
		if (NewLocality == true) {
			objForm.ddlCities.options[0].selected = true;
		}
	} else {
		objForm.ddlCities.options.length = 1;
		objForm.ddlCities.options[0].text = "All Cities";
		objForm.ddlCities.options[0].value = "";
		objForm.ddlCities.options[0].selected = true;
	}
}
function selectLocality(objForm) {
	var i = objForm.ddlRegions.selectedIndex;
	var OldLocality = objForm.ddlLocalities.value;
	var NewRegion = true;
	if (i > 0) {
		objForm.ddlLocalities.options.length = arrLocalities[i].length - 1;
		for (var j = 1; j < arrLocalities[i].length; j++) {
			objForm.ddlLocalities.options[j - 1].text = arrLocalities[i][j];
			objForm.ddlLocalities.options[j - 1].value = arrLocalities[i][j];
			if (arrLocalities[i][j] == OldLocality) {
				objForm.ddlLocalities.options[j - 1].selected = true;
				NewRegion = false;
			}
		}
		if (NewRegion == true) {
			objForm.ddlLocalities.options[0].selected = true;
		}
	} else {
		objForm.ddlLocalities.options.length = 1;
		objForm.ddlLocalities.options[0].text = "All Localities";
		objForm.ddlLocalities.options[0].value = "";
		objForm.ddlLocalities.options[0].selected = true;
	}
}
function selectProperCities(objForm) {
	var i = objForm.ddlLocalities.selectedIndex;
	var j = objForm.ddlRegions.selectedIndex;
	if (i > 0) {
		selectCityLocality(objForm);
	} else if (j > 0) {
		selectCity(objForm);
	} else {
		objForm.ddlCities.options.length = 1;
		objForm.ddlCities.options[0].text = "All Cities";
		objForm.ddlCities.options[0].value = "";
		objForm.ddlCities.options[0].selected = true;
	}
}
function selectItems(objForm) {
	var i = objForm.ddlCategories.selectedIndex;
	var OldItem = objForm.ddlItems.value;
	var NewCategory = true;
	if (i > 0) {
		objForm.ddlItems.options.length = arrItems[i].length - 1;
		for (var j = 1; j < arrItems[i].length; j++) {
			objForm.ddlItems.options[j - 1].text = arrItems[i][j];
			objForm.ddlItems.options[j - 1].value = arrItems[i][j];
			if (arrItems[i][j] == OldItem) {
				objForm.ddlItems.options[j - 1].selected = true;
				NewCategory = false;
			}
		}
		if (objForm.ddlCategories.options[objForm.ddlCategories.selectedIndex].value == "11") {
			var n = navigator.appName;
			if (n == "Netscape") {
				document.tags.TR.display = 'list-item';
			} else {
				objForm.document.all.trEventDates.style.display = 'block';
			}
		} else {
			var n = navigator.appName;
			if (n == "Netscape") {
				document.tags.TR.display = 'none';
			} else {
				objForm.document.all.trEventDates.style.display = 'none';
			}
		}
		if (NewCategory == true) {
			objForm.ddlItems.options[0].selected = true;
		}
	} else {
		objForm.ddlItems.options.length = 1;
		objForm.ddlItems.options[0].text = "All Sub-Categories";
		objForm.ddlItems.options[0].value = "";
		objForm.ddlItems.options[0].selected = true;
	}
}
function properEnvironment() {
	var goodEnvironment = false;
	if (is_ie && !is_aol && !is_mac && !is_sun && !is_ie5 && !is_ie55up && !is_ie6 && !is_ie7 && !is_ie8) {
		goodEnvironment = true;
	}
	return goodEnvironment;
}
function ValidateDateFields(objForm) {
	var ESM = objForm.ESM.options[objForm.ESM.selectedIndex].value;
	var ESD = objForm.ESD.options[objForm.ESD.selectedIndex].value;
	var ESY = objForm.ESY.options[objForm.ESY.selectedIndex].value;
	var EEM = objForm.EEM.options[objForm.EEM.selectedIndex].value;
	var EED = objForm.EED.options[objForm.EED.selectedIndex].value;
	var EEY = objForm.EEY.options[objForm.EEY.selectedIndex].value;
	if (! (ESM == "" && ESD == "" && ESY == "" && EEM == "" && EED == "" && EEY == "")) {
		if (ESM == "") {
			alert("You must enter a starting month.");
			return false;
		}
		if (ESD == "") {
			alert("You must enter a starting day.");
			return false;
		}
		if (ESY == "") {
			alert("You must enter a starting year.");
			return false;
		}
		if (EEM == "") {
			alert("You must enter an ending month.");
			return false;
		}
		if (EED == "") {
			alert("You must enter an ending day.");
			return false;
		}
		if (EEY == "") {
			alert("You must enter an ending year.");
			return false;
		}
		if (ESY > EEY) {
			alert("The starting date is after the ending date.");
			return false;
		}
		if ((ESY == EEY) && (parseInt(ESM) > parseInt(EEM))) {
			alert("The starting date is after the ending date.");
			return false;
		}
		if ((ESY == EEY) && (ESM == EEM) && (parseInt(ESD) > parseInt(EED))) {
			alert("The starting date is after the ending date.");
			return false;
		}
	}
}
function MM_popupMsg(msg) {
	alert(msg);
}
function MM_swapImgRestore() {
	var i, x, a = document.MM_sr;
	for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}
function MM_findObj(n, d) {
	var p, i, x;
	if (!d) d = document;
	if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
		d = parent.frames[n.substring(p + 1)].document;
		n = n.substring(0, p);
	}
	if (! (x = d[n]) && d.all) x = d.all[n];
	for (i = 0; ! x && i < d.forms.length; i++) x = d.forms[i][n];
	for (i = 0; ! x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
	if (!x && d.getElementById) x = d.getElementById(n);
	return x;
}
function MM_swapImage() {
	var i, j = 0,
	x, a = MM_swapImage.arguments;
	document.MM_sr = new Array;
	for (i = 0; i < (a.length - 2); i += 3) if ((x = MM_findObj(a[i])) != null) {
		document.MM_sr[j++] = x;
		if (!x.oSrc) x.oSrc = x.src;
		x.src = a[i + 2];
	}
}
