

  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 = 'map.asp';
  }
  
  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 = 'map.asp';
  }
  
  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 = 'map.asp';
  }
  
  function ActivateIdentify(targetwin,imgPrefix) {
  //Used by SingleClick Client except Basic Viewer
  //imgPrefix is optional... used by Chameleon Interface
	if (imgPrefix == null) {
		imgPrefix = "";
		}	
    setToolImage('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 ShowLogin(inFunctionType, inBuffer, inWidth, inHeight, inWc) {
var width=330; //330 ;
var height=230; //200;
 var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;

if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
 }

	var win;
	var vURL;

	vURL = "loginForm.asp?BufferVal=" + inBuffer + "&mW=" + inWidth + "&mH=" + inHeight + "&mFun=" + escape(inFunctionType) + "&mWc=" + inWc;
	//alert("inWC" + inWc + " == " + vURL);
        win = window.open(vURL, "LoginWindow",str);
        if (parseInt(navigator.appVersion) >=4) win.window.focus();
}

function ShowLoginPre(inFunctionType, inBuffer, inWidth, inHeight, inWc) {

	var win;
	var vURL;
	
	vURL = "loginForm.asp?BufferVal=" + inBuffer + "&mW=" + inWidth + "&mH=" + inHeight + "&mFun=" + escape(inFunctionType) + "&mWc=" + inWc;
	//alert("inWC" + inWc + " == " + vURL);
        //win = window.open(vURL, "LoginWindow","height=200,width=330");
        win = window.open(vURL, "LoginWindow","height=200,width=330");
        if (parseInt(navigator.appVersion) >=4) win.window.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;
		}
	if (tool == "ZOOMOUT") {
		document.ZOOMOUT.src = imageFile;
		}
	if (tool == "PAN") {
		document.PAN.src = imageFile;
		}
	if (tool == "IDENTIFY") {
		document.IDENTIFY.src = imageFile;
		}
}

//-----------------------------------------------------------------------------
// Get client area width.

function getClientWidth()
{
  var w = 0;
  if (is.nav4up) {
    w = window.innerWidth;
    if (document.height > window.innerHeight) // has vert scrollbar
      w -= 16;
    if (is.nav) w += 4;
  }
  else if (is.ie4up) {
    w = document.body.clientWidth;
  }
  else if (is.opera) {
    w = window.innerWidth;
  }
  return w;
}

//-----------------------------------------------------------------------------
// Get client area height.

function getClientHeight()
{
  var h = 0;
  if (is.nav4up) {
    h = window.innerHeight;
    if (document.width > window.innerWidth) // has horz scrollbar
      h -= 16;
    if (is.nav) h += 4 ;
  }
  else if (is.ie4up) {
    h = document.body.clientHeight;
  }
  else if (is.opera) {
    h = window.innerHeight;
  }
  return h;
}

// ClientSnifferJr.js
// ClientSnifferJr Object Constructor.
// This is a simplified version of the Client Sniffer code found at
// http://www.mozilla.org/docs/web-developer/sniffer/browser_type_oo.html
//
// Michael Foster, December 8, 2000
// mfoster@cybrtyme.com
// http://lineoflight.com/
// http://www.mikefoster.f2s.com/


function ClientSnifferJr()
{

    var agent = navigator.userAgent.toLowerCase();
    this.NN  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.IE   = (agent.indexOf("msie") != -1);
    this.WIN = (agent.indexOf("win") != -1);
    this.IE5 = (this.IE && (agent.indexOf('5') != -1));


  this.ua = navigator.userAgent.toLowerCase();
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  this.nav   = (
    (this.ua.indexOf('mozilla')!=-1)
    && ((this.ua.indexOf('spoofer')==-1)
    && (this.ua.indexOf('compatible') == -1))
  );
  this.nav4  = (this.nav && (this.major == 4));
  this.nav4up= (this.nav && (this.major >= 4));
  this.nav5up= (this.nav && (this.major >= 5));
  this.gecko = (this.ua.indexOf('gecko') != -1); 
  this.ie    = (this.ua.indexOf("msie") != -1);
  this.ie3   = (this.ie && (this.major == 2));
  this.ie4   = (
    this.ie && (this.major == 4)
    && (this.ua.indexOf("msie 5.0")==-1)
  );
  this.ie4up = (this.ie  && (this.major >= 4));
  this.ie5up = (this.ie && !this.ie3 && !this.ie4);
  this.opera = (this.ua.indexOf("opera") != -1);
  this.hotjava = (this.ua.indexOf("hotjava") != -1); 
  this.webtv = (this.ua.indexOf("webtv") != -1);
  this.aol   = (this.ua.indexOf("aol") != -1); 
}

var is = new ClientSnifferJr();