/* ***********************************************************
viewer.js
Javascript for viewer.asp page in Map Viewer
by Howie Sternberg (howies@snet.net)

Map Viewer is placed in the public domain and is "Freeware". 
Map Viewer may be freely used and redistributed, is provided 
"AS-IS" without warranty of any kind, and there is no technical 
support provided.
--------------------------------------------------------------
History
Sep 2004, Initial code for Map Viewer 2nd Edition
May 2005, Revised for Map Viewer 3rd Edition to only support  
		  W3C DOM compatible browsers 
************************************************************ */

// Sets map service
function setMapService(url,mapservice,mapaction) {
	// show download message
	showDownloadMessage()
	// submit form
	objMapForm.reset();
	objMapForm.mapserverurl.value = url;
	objMapForm.mapservice.value = mapservice;
	objMapForm.mapaction.value = mapaction;
	objMapForm.submit();	
}

// Sets form action
function loadPage(s) {
	// show download message
	showDownloadMessage()
	// submit form
	objMapEvent.cursor = "wait";
	objMapForm.reset();
	objMapForm.action = s;
	objMapForm.submit();
}

// Sets Map Option Level 2 
function setMapOptionLevel2(s) {
	// show download message
	showDownloadMessage()
	// submit form
	objMapEvent.cursor = "wait";
	objMapForm.reset();
	objMapForm.mapaction.value = "none";
	objMapForm.mapoptionlevel2.value = s;
	objMapForm.submit();
}

// Sets Map Option Level 3 
function setMapOptionLevel3(s) {
	// show download message
	showDownloadMessage()
	// submit form
	objMapEvent.cursor = "wait";
	objMapForm.reset();
	objMapForm.mapaction.value = "none";
	objMapForm.mapoptionlevel2.value = "none";
	objMapForm.mapoptionlevel3.value = s;
	objMapForm.submit();
}

// Clears Map Option Level 1 
function clearMapOptionLevel1() {
	// show download message
	showDownloadMessage()
	// submit form
	objMapEvent.cursor = "wait";
	objMapForm.reset();
	objMapForm.mapaction.value = "none";
	objMapForm.mapoptionlevel1.value = "none";
	objMapForm.submit();
}

// Clears Map Option Level 2 
function clearMapOptionLevel2() {
	// show download message
	showDownloadMessage()
	// submit form
	objMapEvent.cursor = "wait";
	objMapForm.reset();
	objMapForm.mapaction.value = "none";
	objMapForm.mapoptionlevel2.value = "none";
	objMapForm.submit();
}

// Clears Map Option Level 3 
function clearMapOptionLevel3() {
	// show download message
	showDownloadMessage()
	// submit form
	objMapEvent.cursor = "wait";
	objMapForm.reset();
	objMapForm.mapaction.value = "refreshmap";
	objMapForm.mapoptionlevel3.value = "none";
	objMapForm.submit();
}