<!-- 
function jtab( activetab, activetabbody ){

var atab = document.getElementById(activetab);
var atabbody = document.getElementById(activetabbody);

var totTabs = 2;
var tabs=new Array("ttab1","ttab2");
var tabbodys=new Array("tab1","tab2");

var inactiveBorderBot = "0px solid";
//var inactiveBackImage = "url('images/search_left_green.jpg')";
var inactiveBackImage = "#FFFFFF";
var activeBorderBot = "0px none";
var activeBackCol = "#FFFFFF";

atab.style.borderBottom=activeBorderBot;
atab.style.background=activeBackCol;
atabbody.style.display="block";

for (var x = 0; x < totTabs; x++)
   {
      var tabnow = document.getElementById( tabs[x] );
      var tabbodynow = document.getElementById( tabbodys[x] );

if (tabnow != atab) {
      tabnow.style.borderBottom=inactiveBorderBot;
      tabnow.style.background=inactiveBackImage;
      tabbodynow.style.display="none"
     }
   }

}

document._domino_target = "_self";
function _doClick(v, o, t, h) {
  var form = document._tabs;
  if (form.onsubmit) {
     var retVal = form.onsubmit();
     if (typeof retVal == "boolean" && retVal == false)
       return false;
  }
  var target = document._domino_target;
  if (o.href != null) {
    if (o.target != null)
       target = o.target;
  } else {
    if (t != null)
      target = t;
  }
  form.target = target;
  form.__Click.value = v;
  if (h != null)
    form.action += h;
  form.submit();
  return false;
}

// Original Javascript

function checklogin()
{
// function checks for correct number of digits in password, must be 4 digits
	if (document.realestate.password.value.length < 4)
	{
		alert("Password must have 4 or more characters")
		document.realestate.password.focus();
		document.realestate.password.select();
		return false;
	}

// function checks for correct number of digits in password, must be 4 digits
	if (document.realestate.username.value.length < 4)
	{
		alert("User name must have 4 or more characters")
		document.realestate.username.focus();
		document.realestate.username.select();
		return false;
	}
	
	if (document.realestate.username.value == "username")
	{
		alert("Enter a user name")
		document.realestate.username.focus();
		document.realestate.username.select();
		return false;
	}
}

var newWindow;
function open_window()
// this function checks screen resolution and places pop up window in middle of browser window to search zip codes
{
	var winTop = (screen.height / 2 ) - 130;
	var winLeft = (screen.width / 2 ) - 170;
// make a url that contains the state variable 
	var windowurl = "search_zip/searchzip.cfm?newstate=AN"; 
	var windowFeatures = "width=340,height=260,";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop;
//	newWindow = window.open("search_zip/searchzip.cfm","myWindow",windowFeatures);
	newWindow = window.open(windowurl,"myWindow",windowFeatures);
}

function open_whatisthis()
// this function checks screen resolution and places pop up window in middle of browser window for help re: saved listings
{
	var winTop = (screen.height / 2 ) - 200;
	var winLeft = (screen.width / 2 ) - 190;
	var windowFeatures = "width=380,height=400,";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop + "," + "scrollbars=yes";
	newWindow = window.open("help/helpsaved.cfm","myWindow",windowFeatures);
}

function regExpIs_valid(text)
// function is called to check for invalid characters in zip code
{
	var myRegExp = /[^\d]/;
	// any number 0-9, see pg 301
	return ! (myRegExp.test(text));
}

function checkzip()
// function checks zip code
{
	if (regExpIs_valid(document.propsearchx.zip.value) == true)
	{
		// characters in phone number ok, now check for 5 digits
				if (!(document.propsearchx.zip.value.length == 5))
					{
						alert("Zip code must be 5 digits")
						document.propsearchx.zip.focus();
						document.propsearchx.zip.select();
						return false;
					}
					else
					{
					//everything is ok
					return true;
					}	
	}
	else
	{
	alert("Invalid characters in zip code")
	document.propsearchx.zip.focus();
	document.propsearchx.zip.select();
	return false;
	}
}		

function clearform(url)
// function clears session variables
{
window.location.replace(url);
}

function checkcity()
// function checks number of characters in city search box
{
	
	if (document.propsearchy.city.value == "Any")
	{
		alert("Please enter a city name")
		document.propsearchy.city.focus();
		document.propsearchy.city.select();
		return false;
	}

	if (document.propsearchy.city.value.length < 3)
	{
		alert("City name must have 3 or more characters")
		document.propsearchy.city.focus();
		document.propsearchy.city.select();
		return false;
	}
	if (document.propsearchy.state.value == "AN")
	{
		alert("You must select a state");
		document.propsearchy.state.focus();
		return false;
	}

}

function clearcity()
// this used to reset form variables in city search box
{
	document.propsearchy.city.value = "";
	document.propsearchy.propertytype.value = "RA";
	document.propsearchy.radius.value = 5;
	document.propsearchy.state.value = "AN";
}


function getCookieValue(cookieName)
// function gets cookie to see if user is a return visitor
{
	var cookieValue = document.cookie;
	//alert (document.cookie);
	var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
	if (cookieStartsAt == -1)
		{
			cookieStartsAt = cookieValue.indexOf(cookieName + "=");
		}
	if (cookieStartsAt == -1)
		{
			cookieValue = null;
		}
	else
		{
			cookieStartsAt = cookieValue.indexOf("=" , cookieStartsAt) + 1;
			var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);
				if (cookieEndsAt == -1)
					{
						cookieEndsAt = cookieValue.length;
					}
					cookieValue = unescape(cookieValue.substring(cookieStartsAt, cookieEndsAt));
		}
		return cookieValue;
}


/*
function checkhotlistcookie()
{
// this script checks if cookie has been set for favorities list
var hotlist = getCookieValue("hotlist");
	
	if (hotlist == null)
		{
			// there is no hotlist listings set
			alert("You have no saved listings. Please search properties first, then select listings to save.");
			return false;
		}
	else
		{
			window.location.href = "listings/listings.cfm?srchby=fav";
			return true; 
		}
}
*/


//-->
