
<!-- begin script
var isDOM = (document.getElementById ? true : false);
var isIE4 = (document.all ? true : false);
var isNS4 = (document.layers ? true : false);

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

// Mac date bug. 
function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); 
  if (skew > 0)  
    date.setTime (date.getTime() - skew);
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
	i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
//////////////////////////////////////////////////////////////////

//Set the cookie
function addProperty(propertyID){
	var expdate = new Date();
	FixCookieDate (expdate); // Correct for Mac date bug
	expdate.setTime (expdate.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30 days from now 
	var bp = GetCookie("bp");
	bp = bp+"-"+propertyID;
	SetCookie ("bp",bp,expdate,"/",null,false);
	toggle_visibility('timerpanel')
	setTimeout("toggle_visibility('timerpanel')",2000)
}

function showTimer(time){
	toggle_visibility('timerpanel')
	setTimeout("toggle_visibility('timerpanel')",time)
}

function toggle_visibility(panelname){
	var winW = 630, winH = 460;

	if (parseInt(navigator.appVersion)>3) {
 		if (navigator.appName=="Netscape") {
  			winW = window.innerWidth;
  			winH = window.innerHeight;
 		}
 		if (navigator.appName.indexOf("Microsoft")!=-1) {
  			winW = document.body.offsetWidth;
  			winH = document.body.offsetHeight;
 		}
	}
	winH=(winH/2)-300;
	winW=(winW/2)-150;
	//
	var e = document.getElementById(panelname);
	e.style.left=winW;
	//e.style.top=winH;
	if(e.style.display == 'block')
		e.style.display = 'none';
	else
		e.style.display = 'block';
}
function loadVT(vturl){
	toggle_visibility("vtpanel");
	//document.frames["vtframe"].location.href=vturl;
	document.getElementById("vtframe").src=vturl;
}

function toggle_searchtype(panelname){
	document.getElementById('tabA').style.display = 'none';
	document.getElementById('tabB').style.display = 'none';
	//
	var expdate = new Date();
	FixCookieDate (expdate); // Correct for Mac date bug
	expdate.setTime (expdate.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30 days from now 
	SetCookie ("searchlayer",panelname,expdate,"/",null,false);
	//
	var e = document.getElementById(panelname);
	if(e.style.display == 'block')
		e.style.display = 'none';
	else
		e.style.display = 'block';
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

//////////////////////////////////////////////
//Layer Scripting
function changeLayer(whatclick) {
		for (var y = 1; y < 27; y++ ) {
			hideLayer("highlight"+y);
		}
		
		showLayer("highlight"+whatclick);		
}

function showText( whatclick )
{
		for (var y = 1; y < 27; y++ ) {
			hideLayer("text"+y);
		}
		
		showLayer("text"+whatclick);	
}

//Returns the correct syntax for calling the layer
function getRef( strName ) {
	if (isDOM) return document.getElementById( strName );
	if (isIE4) return document.all[ strName ];
	if (isNS4) return document.layers[ strName ];
	}
		
function showLayer( strName ) {
	objRef = getRef( strName )
	if( isDOM || isIE4 ) {
			objRef.style.visibility = 'visible';
	} else {
			objRef.visibility = "show";
	}
}

function hideCounty( strName ) {
	//hideLayer('highlight_'+strName);
}

function revealCounty( strCounty )
{
	//None
}

function hideLayer( strName ) {
	objRef = getRef( strName )
	if( isDOM || isIE4 ) {
		objRef.style.visibility = 'hidden';
	} else {
		objRef.visibility = "hide";
	}
}

