/* ***********************************************************
ca.js
Connecticut Coastal Access Guide 
by Howie Sternberg (howard.sternberg@po.state.ct.us)
************************************************************ */

// History - June 2004, Howie Sternberg - initial code

//*************************
// functions in searchi.asp

function submitSearch(f) {
	var doit = false
	for (var i = 0; i < f.length; i++) {
		var e = f.elements[i]
		if (e.type == "checkbox") {
			if (e.checked) {
				doit = true }
		}
	}
if (doit)
	f.submit()
else
	window.alert("Please select one or more Facilities, Acitivies or Environmental Settings to search.")
}


//*************************
// function in searchri.asp

function getPage(n) {
  document.search.page.value = n
  document.search.submit()
}


//******************************
// functions in imagemaptown.asp

function submitTown(f) {
	var iNo = new Number (0)
	iNo = f.townno.options[f.townno.selectedIndex].value
	if (iNo > 0) 
		f.submit()
	else
  	window.alert("To go to a town, please choose a town from the list or select a town on the map.")
}

//*************************************************
// functions in sitemapi.asp and searchtownmapi.asp

function doOnMouseOver(n) {
  if (n == 1) top.window.status="Zoom in by selecting on the map";
  if (n == 2) top.window.status="Zoom out by selecting on the map";
  if (n == 3) top.window.status="Pan and move the map by selecting where to re-center";
  if (n == 4) top.window.status="Get information about a coastal access site by selecting one on map";
  if (n == 5) top.window.status="Zoom out to view the State of Connecticut";
  if (n == 6) top.window.status="Zoom in on center of map";
  if (n == 7) top.window.status="Zoom out from center of map";
  if (n == 8) top.window.status="Show names of Coastal Access Sites on map";
  if (n == 9) top.window.status="Do not show names of Coastal Access Sites on map";
  if (n == 10) top.window.status="Get a description of the coastal access site";
  if (n == 11) top.window.status="Re-center map on the coastal access site";
  return true;
}
 
function doOnMouseOut() {
	top.window.status="";
}

function setMapTool(n) {
  if (document.map.maptool.value == 1) document.zoomin.src="images/zoomin_1.gif";
  if (document.map.maptool.value == 2) document.zoomout.src="images/zoomout_1.gif";
  if (document.map.maptool.value == 3) document.pan.src="images/pan_1.gif";
  if (document.map.maptool.value == 4) document.identify.src="images/ca_1.gif";
  if (n == 1) document.zoomin.src="images/zoomin_2.gif";
  if (n == 2) document.zoomout.src="images/zoomout_2.gif";
  if (n == 3) document.pan.src="images/pan_2.gif";
  if (n == 4) document.identify.src="images/ca_2.gif";
  document.map.act.value = 2
  document.map.maptool.value = n
}

function setMapAction(n) {
	document.map.act.value = 1
  document.map.mapaction.value = n
  document.map.submit()
}

function setAction(n) {
  document.map.act.value = n
  document.map.submit()
}