<!--
var backcol   = "#FEE4B5";
var border1   = "solid 1px #FEE4B5";
var border2   = "solid 1px #A52A2A";

function PopOut(sURL,sTitle,iHeight,iWidth) {
	var objWin;
	objWin = window.open(sURL, sTitle, "name='popwin',height="+iHeight+",width="+iWidth+",scrollbars,statusbar,resizable");
}

function setToolImage(tool) {
	document.getElementById("ZoomInCell").style.backgroundColor = backcol;
	document.getElementById("ZoomInCell").style.border = border1;
	document.getElementById("ZoomOutCell").style.backgroundColor = backcol;
	document.getElementById("ZoomOutCell").style.border = border1;
	document.getElementById("FullExtentCell").style.backgroundColor = backcol;
	document.getElementById("FullExtentCell").style.border = border1;
	document.getElementById("PanCell").style.backgroundColor = backcol;
	document.getElementById("PanCell").style.border = border1;
	document.getElementById("SelectCell").style.backgroundColor = backcol;
	document.getElementById("SelectCell").style.border = border1;
	document.getElementById("ClearCell").style.backgroundColor = backcol;
	document.getElementById("ClearCell").style.border = border1;
	document.getElementById("CoordsCell").style.backgroundColor = backcol;
	document.getElementById("CoordsCell").style.border = border1;
	document.getElementById(tool+"Cell").style.backgroundColor = "#FFFFFF";
	document.getElementById(tool+"Cell").style.border = border2;
	document.getElementById("toolcell").innerHTML = "Active Tool: " + tool + "";
}


function SaveToolState(navtool) {
	if (navtool == "ZoomIn") {
		document.getElementById('theTop').style.cursor = "crosshair";
		document.getElementById('theMap').style.cursor = "crosshair";
	} else {
		document.getElementById('theTop').style.cursor = "hand";
		document.getElementById('theTop').style.cursor = "hand";
	}
	document.mapcontrol.theTool.value = navtool;
}


function ActivateTool(maptool) {
	setToolImage(maptool)
	document.mapcontrol.theaction.value = maptool;
	document.mapcontrol.target = '';
	document.mapcontrol.action = 'default.asp';
	setState(maptool)
}

function ControlForm(val,num,type) {
	document.mapcontrol.theaction.value = '';
	document.mapcontrol.target = '';
	document.mapcontrol.action = 'default.asp';

	if (num == 1) {
		document.mapcontrol.layeraction.value = val;  //set layers visible
		document.mapcontrol.thequeryaction.value = 'Refresh';
		showLoad();
	}
	if (num == 2) {
		document.mapcontrol.thetab.value = val;  //tab settings
		var tabName = val;
	}
	if (num == 3) {
		document.mapcontrol.theLayer.value = val;  //set active layer
		document.mapcontrol.IdentLayer.value = val;
	}
	if (num == 4) {
		document.mapcontrol.thepanaction.value = val;  //pan with arrows
		showLoad();
	}
	if (num == 5) {
		document.mapcontrol.thequeryaction.value = val;  //query actions
		showLoad();
	}
	if (num == 6) {
		document.mapcontrol.thequeryaction.value = val;  //Clears The Map
		document.mapcontrol.thetab.value = 'Layers';
		showLoad();
	}
	if (num == 7) {
		document.mapcontrol.thetab.value = val;  //Legend Forward/Back
		var tabName = val;
		document.mapcontrol.legtype.value = type;
	}
	if (num == 8) {
		var theme = document.mapcontrol.censusval.value; //Add Census Themes
		document.mapcontrol.action = 'default.asp?addTheme=' + theme + '';
		document.mapcontrol.thequeryaction.value = val;

	}

	document.mapcontrol.submit();
}

	function noenter() {
		return !(window.event && window.event.keyCode == 13);
	}

	function submitForm(qnum) { 
		var charCode = window.event.keyCode 
		if (charCode == 13) { 

			if (qnum == 1) {
				mapQuery('parcel');
			}

			if (qnum == 2) {
				mapQuery('address');
			}
		} 
	} 

	function revertZoomLevel() {
			document.getElementById("zoom1").src="images/zoom_normal_1.gif";
			document.getElementById("zoom2").src="images/zoom_normal_2.gif";
			document.getElementById("zoom3").src="images/zoom_normal_3.gif";
			document.getElementById("zoom4").src="images/zoom_normal_4.gif";
			document.getElementById("zoom5").src="images/zoom_normal_5.gif";
			document.getElementById("zoom6").src="images/zoom_normal_6.gif";
			document.getElementById("zoom7").src="images/zoom_normal_7.gif";
			document.getElementById("zoom8").src="images/zoom_normal_8.gif";
			document.getElementById("zoom9").src="images/zoom_normal_9.gif";
			document.getElementById("zoom10").src="images/zoom_normal_10.gif";
		}
				
		function setZoomLevel(level) {
			revertZoomLevel();
			var zoomLevel = 'zoom' + level + '';
			document.getElementById(zoomLevel).src='images/zoom_select_' + level + '.gif';
		}

		function zoomToScale(level) {
			document.mapcontrol.theaction.value = '';
			document.mapcontrol.thequeryaction.value = "ZoomToScale";
			document.mapcontrol.action = 'default.asp?zoomlevel=' + level + '';
			document.mapcontrol.submit();		
		}


function changeMapSize(size) {
	document.mapcontrol.target = "_self";
	document.mapcontrol.theaction.value = "";
	document.mapcontrol.mSize.value = size;
	document.mapcontrol.action = 'default.asp?change=1';
	document.mapcontrol.submit();
}

function showMetaData(thelay) {
	document.mapcontrol.thetab.value = "Info";
	document.mapcontrol.target = "_self";
	document.mapcontrol.theaction.value = "";
	document.mapcontrol.action = 'default.asp?query=metadata&layername=' + thelay + '';
	document.mapcontrol.submit();
}

function mapQuery(type) {
	document.mapcontrol.thetab.value = "Info";
	document.mapcontrol.target = "_self";
	document.mapcontrol.theaction.value = "";
	if (type == 'address') {
		var addString = escape(document.mapcontrol.addressval.value);
		document.mapcontrol.action = 'default.asp?query=findaddress&addressval=' + addString + '';
	}
	if (type == 'parcel') {
		document.mapcontrol.action = 'default.asp?query=findparcel&pidval=' + document.mapcontrol.pidval.value +  '';
	}
	
	document.mapcontrol.submit();
}

function LndMrkQuery() {
	var lmValue = document.mapcontrol.lmval.value;
	document.mapcontrol.target = "_self";
	document.mapcontrol.theaction.value = "";
	document.mapcontrol.thequeryaction.value = "zoomtolandmark";
	document.mapcontrol.action = 'default.asp?lmval=' + lmValue +  '';
	document.mapcontrol.submit();
}

function mapAddress(xGeo,yGeo,addText) {
		document.mapcontrol.thequeryaction.value = 'zoomtogeocode'
		document.mapcontrol.theaction.value = '';
		document.mapcontrol.target = '';
		document.mapcontrol.action = 'default.asp?pntx=' + xGeo + '&pnty=' + yGeo + '&addText=' + escape(addText) + '';
		document.mapcontrol.submit();
	}

function getReport(bufferX,bufferY,thepid) {
	document.mapcontrol.thetab.value = "Report";
	document.mapcontrol.target = "_self";
	document.mapcontrol.theaction.value = "";
	document.mapcontrol.action = 'default.asp?query=genReport&pntx=' + bufferX + '&pnty=' + bufferY + '&miles=1&pid=' + thepid +'';
	document.mapcontrol.submit();
}

function bufferPoint(bufferX,bufferY,thepid) {
	var miles = document.mapcontrol.searchdist.value;
	document.mapcontrol.thetab.value = "Report";
	document.mapcontrol.target = "_self";
	document.mapcontrol.theaction.value = "";
	document.mapcontrol.action = 'default.asp?query=genReport&pntx=' + bufferX + '&pnty=' + bufferY + '&miles=' + miles + '&pid=' + thepid +'';
	document.mapcontrol.submit();
}

function censusSearch(bufferX,bufferY,searchloc,searchtype) {
	//Get Buffer Distance
	var bufferdist = document.mapcontrol.censusradius.value;	
	//Open Window With The Demographic Report
	nfw = window.open('reportcensusdp1.asp?miles=' + bufferdist + '&pntx=' + bufferX + '&pnty=' + bufferY + '&searchloc=' + searchloc + '&searchtype=' + searchtype + '','demographicswindow','width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
		document.mapcontrol.mBuffer.value = bufferdist;
	nfw.focus();
	}

function nhcSearch() {
  var searchloc = document.mapcontrol.nhood.value;
  var searchtype = "nhc";
  nfw = window.open('reportcensusdp1.asp?searchloc=' + document.mapcontrol.nhood.value + '&searchtype=' + searchtype + '','demographicswindow','width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
  nfw.focus();
}

function zipSearch() {
  var searchloc = document.mapcontrol.nhood.value;
  var searchtype = "zip";
  nfw = window.open('reportcensusdp1.asp?searchloc=' + document.mapcontrol.zipcode.value + '&searchtype=' + searchtype + '','demographicswindow','width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
  nfw.focus();
}

function changeLayers(group) {
	document.mapcontrol.theaction.value = '';
	document.mapcontrol.target = '_self';
	document.mapcontrol.action = 'default.asp';
	document.mapcontrol.thetab.value = 'Layers';
	document.mapcontrol.layerGroup.value = group;
	document.mapcontrol.submit();
}

function CheckTool() {
	if (document.mapcontrol.theaction.value == 'Select') {
		alert("Select");
		document.mapcontrol.thetab.value = "Info";
		document.mapcontrol.target = "_self";
		document.mapcontrol.action = 'default.asp?query=Select';
	}
}

function DL_GetElementLeft(eElement)
{
   if (!eElement && this)
   {
      eElement = this;
   }
   var DL_bIE = document.all ? true : false;
   var nLeftPos = eElement.offsetLeft;
   var eParElement = eElement.offsetParent; 

   while (eParElement != null)
   {
      if(DL_bIE)
      {
         if(eParElement.tagName == "TD")
         {
            nLeftPos += eParElement.clientLeft;
         }
      }
      else
      {
         if(eParElement.tagName == "TABLE")
         {
            var nParBorder = parseInt(eParElement.border);
            if(nParBorder > 0)
            {
               nLeftPos += nParBorder;
            }
         }
      }
      nLeftPos += eParElement.offsetLeft;
      eParElement = eParElement.offsetParent;
   }
   return nLeftPos;
}

function DL_GetElementTop(eElement)
{
   if (!eElement && this)
   {
      eElement = this;
   }

   var DL_bIE = document.all ? true : false;
   var nTopPos = eElement.offsetTop;
   var eParElement = eElement.offsetParent;

   while (eParElement != null)
   {
      if(DL_bIE)
      {
         if(eParElement.tagName == "TD")
         {
            nTopPos += eParElement.clientTop;
         }
      }
      else
      {
         if(eParElement.tagName == "TABLE")
         {
            var nParBorder = parseInt(eParElement.border);
            if(nParBorder > 0)
            {
               nTopPos += nParBorder;
            }
         }
      }
      nTopPos += eParElement.offsetTop;
      eParElement = eParElement.offsetParent;
   }
   return nTopPos;
}

function showLoad() {
	var loadDiv = document.getElementById('loadMapDiv');
	loadDiv.style.visibility = "visible";
}

function resetMap() {
	var reloadTimer=0;
	window.clearTimeout(reloadTimer);
	reloadTimer = window.setTimeout("document.mapcontrol.thequeryaction.value = ''; document.mapcontrol.theaction.value = ''; document.mapcontrol.submit();",500);
}
// -->