// set tool
function setTool(newTool) {
	var newCmd = "REFRESH";
	var m = parent.MapFrame;
	if (newTool == "ZOOMIN") {
		m.mapBoxAsZoom = true;
		m.setZoomBoxColor("#ff0000");
		m.setZoomBoxWidth(1);
	} else if (newTool == "ZOOMOUT") {
		m.mapBoxAsZoom = true;
		m.setZoomBoxColor("#ff0000");
		m.setZoomBoxWidth(1);
	} else if (newTool == "PAN") {
	} else if (newTool == "SELECT") {
		newCmd = "SELECT";
	} else if (newTool == "IDENTIFY") {
		newCmd = "IDENTIFY";
	}
	setToolImage(newTool);
	m.curTool = newTool;
	m.document.frmMain.tool.value = newTool;
	m.document.frmMain.cmd.value = newCmd;
}



// set Tool Image
function setToolImage(tool) {
		// Dull all images first.
		document.B_ZOOMIN.src = 'images/'+ 'b_zoomin.gif';
		document.B_ZOOMOUT.src = 'images/'+ 'b_zoomout.gif';
		document.B_PAN.src = 'images/'+ 'b_pan.gif';
		document.B_SELECT.src = 'images/'+ 'b_select.gif';
		document.B_IDENTIFY.src = 'images/'+ 'b_identify.gif';
		
		//Then brighten the passed tool.
		if (tool == "ZOOMIN") {
			document.B_ZOOMIN.src = 'images/'+ 'b_zoomin_on.gif';
		}
		if (tool == "ZOOMOUT") {
			document.B_ZOOMOUT.src = 'images/'+ 'b_zoomout_on.gif';
		}
		if (tool == "PAN") {
			document.B_PAN.src = 'images/'+ 'b_pan_on.gif';
		}
		if (tool == "SELECT") {
			document.B_SELECT.src = 'images/'+ 'b_select_on.gif';
		}
		if (tool == "IDENTIFY") {
			document.B_IDENTIFY.src = 'images/'+ 'b_identify_on.gif';
		}
}


// show text form
function showTextForm(sForm) {
	
	if(sForm == "PRINT"){
		theURL = "map_print.htm";

	}else if(sForm == "LAYERS"){
		theList = parent.MapFrame.document.frmMain.layerlist.value;
		theURL = "map_layers.asp?layerlist="+theList;

	}else if(sForm == "LEGEND"){
		theURL = "map_legend.asp?legURL="+parent.MapFrame.sLegend;

	}else if(sForm == "SEARCH"){
		theURL = "search_frame.asp";

	}else if(sForm == "HOME"){
		theURL = "default.htm";

	}else if(sForm == "HELP"){
		theURL = "help.htm";

	}

	if(sForm == "HOME"){
		parent.location = theURL;
	}else{
		parent.TextFrame.location = theURL;
	}
}
