// *********************************************************
  function ZoomToFull() {
    document.frmNavigation.Cmd.value = 'ZOOMFULL';
    document.frmNavigation.target="";
    document.frmNavigation.action = sApplication;
	showLayer("loadLayer");
	document.frmNavigation.submit();
  }

  function ActivateLandmark() {
    document.frmNavigation.Cmd.value = 'SNAPSHOT';
    document.frmNavigation.ShowWhat.value = 'LANDMARK';
    document.frmNavigation.target="";
    document.frmNavigation.action = sApplication;
	document.frmNavigation.submit();
  }
  
  function ActivateOrtho(imgPrefix) {
//	Used by SingleClick Client except Basic Viewer
//	imgPrefix is optional... used by Chameleon Interface
	if (imgPrefix == null) {
		imgPrefix = "";
	}	
	    document.frmNavigation.Cmd.value = 'ORTHO';
	    if (document.frmNavigation.Orthophoto.value == 'YES') {
	    document.frmNavigation.Orthophoto.value = "";
	    } else {
	    document.frmNavigation.Orthophoto.value = 'YES';
	    }
	    
	    document.frmNavigation.target="";
	    document.frmNavigation.action = sApplication;
		showLayer("loadLayer");
		document.frmNavigation.submit();
}
// *********************************************************

  function ActivateZoomIn(imgPrefix) {
  //Used by SingleClick Client except Basic Viewer
  //imgPrefix is optional... used by Chameleon Interface
	if (imgPrefix == null) {
		imgPrefix = "";
		}	
    setToolImage('ZOOMIN','2',imgPrefix); 
    document.frmNavigation.Cmd.value = 'ZOOMIN';
    document.frmNavigation.target="";
    document.frmNavigation.action = sApplication;
  }
  
  function ActivateZoomOut(imgPrefix) {
  //Used by SingleClick Client except Basic Viewer
  //imgPrefix is optional... used by Chameleon Interface
	if (imgPrefix == null) {
		imgPrefix = "";
		}	
    setToolImage('ZOOMOUT','2',imgPrefix); 
    document.frmNavigation.Cmd.value = 'ZOOMOUT';
    document.frmNavigation.target="";
    document.frmNavigation.action = sApplication;
  }
  
  function ActivatePan(imgPrefix) {
  //Used by SingleClick Client except Basic Viewer
  //imgPrefix is optional... used by Chameleon Interface
	if (imgPrefix == null) {
		imgPrefix = "";
		}	
    setToolImage('PAN','2',imgPrefix); 
    document.frmNavigation.Cmd.value = 'PAN';
    document.frmNavigation.target="";
    document.frmNavigation.action = sApplication;
  }
  
  function ActivateIdentify(targetwin,imgPrefix) {
  //Used by SingleClick Client except Basic Viewer
  //imgPrefix is optional... used by Chameleon Interface
	if (imgPrefix == null) {
		imgPrefix = "";
		}	
    setToolImageZ('IDENTIFY','2',imgPrefix); 
    document.frmNavigation.Cmd.value = 'IDENTIFY';
    document.frmNavigation.target = targetwin;
    document.frmNavigation.action = 'identify.asp';
  }
  
function PopOut(sURL,sTitle,iHeight,iWidth,ynScroll,ynResize) {
	var objWin;
	objWin = window.open(sURL, sTitle, "height="+iHeight+",width="+iWidth+",scrollbars="+ynScroll+",resizeable="+ynResize+"");
	if (parseInt(navigator.appVersion) >=4) objWin.window.focus();
}

function PopOut2(sURL,sTitle,ynScroll,ynResize) {
	var objWin2;
	objWin2 = window.open(sURL, sTitle, "scrollbars="+ynScroll+",resizeable="+ynResize+"");
	if (parseInt(navigator.appVersion) >=4) objWin2.window.focus();
}

// show help
function showHelp(sURL){
	if (typeof helpWin == 'undefined'){
		helpWin = window.open(sURL, "Help", "width=700,height=500,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=340,top=0");
		helpWin.opener = self;
	} else {
		if (helpWin.closed){
			helpWin = window.open(sURL, "Help", "width=700,height=500,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=340,top=0");
			helpWin.opener = self;
		} else {			
			helpWin.focus();
		}
	}
}

// Show PA Page
function ShowPAPage(PA_QS) {
	var winPAPage;
	winPAPage = window.open("../myhome/propmap.asp?app=propmap&cmd=FINDADDR"+PA_QS, "PAPage", "width=800,height=500,status=1,toolbar=0,menubar=1,scrollbars=1,resizable=1,left=0,top=0");
	winPAPage.focus();
}

// Show Code Detail
function ShowCodeDetail(sURL) {
	var winCodeDetail;
	winCodeDetail = window.open(sURL, "CodeDetail", "width=800,height=500,status=1,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0");
	winCodeDetail.focus();
}

// Show Crime Detail
function ShowCrimeDetail(sURL) {
	var winCrimeDetail;
	winCrimeDetail = window.open(sURL, "CrimeDetail", "width=250,height=300,status=1,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0");
	winCrimeDetail.focus();
}

// Show Picture Detail
function showSexDetail(s){
	var winSexDetail
	winSexDetail = window.open("sex_detail.asp?case="+s, "SexDetail", "width=800,height=600,scrollbars=1,resizable=1,toolbar=0,menubar=0");
	winSexDetail.focus();
}

// Show Capital Detail
function ShowCapitalDetail(sURL) {
	var winCapitalDetail;
	winCapitalDetail = window.open(sURL, "CapitalDetail", "width=800,height=500,status=1,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0");
	winCapitalDetail.focus();
}

// Show Sales Detail
function ShowSalesDetail(sURL) {
	var winSalesDetail;
	winSalesDetail = window.open(sURL, "SalesDetail", "width=950,height=600,status=1,toolbar=0,menubar=1,scrollbars=1,resizable=1,left=0,top=0");
	winSalesDetail.focus();
}

// Show Flood Detail
function ShowFloodDetail(sURL) {
	var winFloodDetail;
	winFloodDetail = window.open(sURL, "FloodDetail", "width=800,height=500,status=1,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0");
	winFloodDetail.focus();
}

// Show MPO Detail
function ShowMPODetail(sURL) {
	var winMPODetail;
	winMPODetail = window.open(sURL, "MPODetail", "width=800,height=500,status=1,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0");
	winMPODetail.focus();
}

// Show ZONE Detail
function ShowZoneDetail(sURL) {
	var winZoneDetail;
	winZoneDetail = window.open(sURL, "ZoneDetail", "width=800,height=500,status=1,toolbar=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0");
	winZoneDetail.focus();
}

// Show Calendar
function showCalendar(){
	var calWin
	calWin = window.open("support/calendar.htm", "Calendar", "width=260,height=280,toolbar=0,menubar=0,scrollbars=0,resizable=0,left=340,top=200");
	calWin.opener = self;
	calWin.focus();
}

// Show Generic Window
function ShowWin(sURL,sTitle,iHeight,iWidth,ynstatus,yntoolbar,ynmenubar,ynScroll,ynResize,ynleft,yntop) {
	var objWin;
	objWin = window.open(sURL, sTitle, "height="+iHeight+",width="+iWidth+",status="+ynstatus+",toolbar="+yntoolbar+",menubar="+ynmenubar+",scrollbars="+ynScroll+",resizable="+ynResize+",left="+ynleft+",top="+yntop+"");
	objWin.focus();
}

function setToolImage(tool, mode, prefix) {

	//Used by Graphical Button Clients.
	//prefix is an optional argument to the image file name.
	if (prefix == null) {
		prefix = "";
		}
	var imageFile = 'images/' + prefix + tool + mode + '.gif';	

	// Dull all images first.
	document.ZOOMIN.src = 'images/'+ prefix +'zoomin1.gif';
	document.ZOOMOUT.src = 'images/'+ prefix +'zoomout1.gif';
	document.PAN.src = 'images/'+ prefix +'pan1.gif';
	document.IDENTIFY.src = 'images/'+ prefix +'identify1.gif';

	//Then brighten the passed tool.
	if (tool == "ZOOMIN") {
		document.ZOOMIN.src = imageFile;
		document.B_ACTIVETOOL.src = 'images/'+ 'at_zoomin2.gif';
		}
	if (tool == "ZOOMOUT") {
		document.ZOOMOUT.src = imageFile;
		document.B_ACTIVETOOL.src = 'images/'+ 'at_zoomout2.gif';
		}
	if (tool == "PAN") {
		document.PAN.src = imageFile;
		document.B_ACTIVETOOL.src = 'images/'+ 'at_pan2.gif';
		}
	if (tool == "IDENTIFY") {
		document.IDENTIFY.src = imageFile;
		document.B_ACTIVETOOL.src = 'images/'+ 'at_identify2.gif';
		}
}


function swap(OBJ, newImg) {
	if (document.images){
		if (document.images) document[OBJ].src = eval(newImg + ".src");
	}
}

function showApp(theApp) {
	var QS
	//QS = "?Cmd=INIT"
	QS = "?"

	QS = QS + "&ExtentLeft=" + document.frmNavigation.MinX.value;
	QS = QS + "&ExtentRight=" + document.frmNavigation.MaxX.value;
	QS = QS + "&ExtentBottom=" + document.frmNavigation.MinY.value;
	QS = QS + "&ExtentTop=" + document.frmNavigation.MaxY.value;

	if (!document.frmNavigation.GeocodeLabel.value == "") {
		QS = QS + "&GeoLabelFlag=" + escape(document.frmNavigation.GeoLabelFlag.value);
		QS = QS + "&GeocodeLabel=" + escape(document.frmNavigation.GeocodeLabel.value);
		QS = QS + "&GeocodePoint_X=" + escape(document.frmNavigation.GeocodePoint_X.value);
		QS = QS + "&GeocodePoint_Y=" + escape(document.frmNavigation.GeocodePoint_Y.value);
	}

	QS = QS + "&Orthophoto="  + escape(document.frmNavigation.Orthophoto.value);

	QS = QS + "&HN1="  + escape(document.frmNavigation.HN1.value);
	QS = QS + "&Dir1=" + escape(document.frmNavigation.Dir1.value);
	QS = QS + "&StN1=" + escape(document.frmNavigation.StN1.value);
	QS = QS + "&StT1=" + escape(document.frmNavigation.StT1.value);
	QS = QS + "&ZC1=" + escape(document.frmNavigation.ZC1.value);
		
	QS = QS + "&LM=" + escape(document.frmNavigation.LM.value);
		
	QS = QS + "&IDir1=" + escape(document.frmNavigation.IDir1.value);
	QS = QS + "&IStN1=" + escape(document.frmNavigation.IStN1.value);
	QS = QS + "&IStT1=" + escape(document.frmNavigation.IStT1.value);
		
	QS = QS + "&IDir2=" + escape(document.frmNavigation.IDir2.value);
	QS = QS + "&IStN2=" + escape(document.frmNavigation.IStN2.value);
	QS = QS + "&IStT2=" + escape(document.frmNavigation.IStT2.value);

	var url
	url = theApp + ".asp" + QS;
	document.location = url;

	showLayer("loadLayer");
}
