var currentTool = "Pan_Tool";
var IDImage = new Image();  IDImage.src = "../../images/id_UnSel.gif";
var IDImageSel = new Image();  IDImageSel.src = "../../images/id_Sel.gif";
var PanImage = new Image();  PanImage.src = "../../images/recenterUnSel.png";
var PanImageSel = new Image();  PanImageSel.src = "../../images/recenterSel.png";
var mainframe = top.searchframe, mframe = top.mapsframe;
var searchMode;
var element;
var lot;
var sPermit;
/**************************************************************************************************
*                                                            EVENT HANDLERS (ALPHABETIZED)                                                                    *
**************************************************************************************************/

function Header_MouseOut(e)
{
	if (!e) var e = window.event;
	var oTarget = (e.target) ? e.target : e.srcElement;
	
	if (oTarget.id != "")
	{
		theSrcE = document.getElementById(oTarget.id);
		theSrc = theSrcE.id;
		thePos = theSrc.indexOf("_");
		theSrcE.style.borderColor = "rgb(234,244,234)";
		window.status = "";
	}
}

function Header_MouseOver(e)
{
	if (!e) var e = window.event;
	var oTarget = (e.target) ? e.target : e.srcElement;
	
	if (oTarget.id != "")
	{
		
			theSrcE = document.getElementById(oTarget.id);
			theSrc = theSrcE.id;
			thePos = theSrc.indexOf("_");
			theSrcE.style.borderColor = "darkred";
			showStatus(oTarget.id);
		//else HelpHTML = "";
	}
	//else HelpHTML = "";
	
	//HelpText.innerHTML = HelpHTML;
}
function lotSearch()
{
top.document.getElementById("bottomframeset").cols = "0,*";	//set width of map frame
mainframe.location = 'pinsearch.html';
//mainframe.document.getElementById("addressframe").src = '../../searchfrm.php';
document.getElementById("tools").style.visibility = "hidden";
}

function newSearch()
{
top.document.getElementById("bottomframeset").cols = "0,*";	//set width of map frame
mainframe.location = '../../searchfrm.php';
document.getElementById("tools").style.visibility = "hidden";
}

function RegisterEvents()
{
	// event registration for HTML elements; alphabetically ordered by the element's id
	
	var oElement; // this object is reused for each element's event registration
	
	oElement = document.body;
	oElement.onmouseover = Header_MouseOver;
	oElement.onmouseout = Header_MouseOut;
	
	oElement = document.getElementById("Pan_Tool");
	oElement.onclick = Tool_Select;
	
	oElement = document.getElementById("ID_Tool");
	oElement.onclick = Tool_Select;
	
	}

	function showStatus(tool)
	{

	if (tool == "Pan_Tool") window.status = "Recenter tool: click map to recenter, or click and drag to pan";
	if (tool == "ID_Tool") window.status = "ID tool: click map to select a new lot, or click and drag to pan";
	}
	function Tool_Select(e)
{
	if (e == "Load") var sTool = "Pan_Tool";
	else
	{
		if (!e) var e = window.event;
		var oTarget = (e.target) ? e.target : e.srcElement;
		var sTool = oTarget.id;
	}
	
	element = document.getElementById("ID_Tool");
	if (sTool == "ID_Tool") 
		{
		searchMode = "taxlot"
		element.src = IDImageSel.src;
		mframe.changecursor("help");
	  mframe.document.getElementById("divMap").style.cursor="help";//ie
		mframe.document.body.style.cursor = "help";//ff
		}
	else element.src = IDImage.src;
	element = document.getElementById("Pan_Tool");
	if (sTool == "Pan_Tool") {
		element.src = PanImageSel.src;
		mframe.document.getElementById("divMap").style.cursor="crosshair";//ie
		mframe.document.body.style.cursor = "crosshair";//ff
		}
	else element.src = PanImage.src;
	
	currentTool = sTool;
	
	
}