<!--
function popup(url, name, width, height, resizable)
{
	var popwin;
	var opts = "toolbar=no,status=no,location=no,menubar=no,scrollbars=yes";
	opts += ",height=" + height + ",width=" + width + ",resizable=" + resizable;
	popwin = window.open("", name, opts);
	popwin.focus();
	popwin.location = url;
	popwin.opener = self;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function jumpBox(list) {
  location.href = list.options[list.selectedIndex].value
}
function SendRequestQS() {
	if(document.QuickSearch.PropertyType.value == "R") {
		PopulateRentalRates();
	} else {
		PopulateNonRentalRates();
	}
	varUID = GenerateRandomNumber();
	varCriteria = "homesearch_count.asp?UID="  + varUID
	+ "&PropertyType=" + document.QuickSearch.PropertyType.value
	if(document.QuickSearch.PropertyType.value == "R") {
		varCriteria = varCriteria + "&MinPrice=" + document.QuickSearch.MinRate.value
		varCriteria = varCriteria + "&MaxPrice=" + document.QuickSearch.MaxRate.value
	} else {
		varCriteria = varCriteria + "&MinPrice=" + document.QuickSearch.MinPrice.value
		varCriteria = varCriteria + "&MaxPrice=" + document.QuickSearch.MaxPrice.value
	}
	include(varCriteria,"QSCounterSpan") 
}
function SendRequestAS() {
	varUID = GenerateRandomNumber();
	varCriteria = "agents_count.asp?UID="  + varUID
	+ "&Name=" + document.Agents.AgentNameInput.value
	include(varCriteria,"AgentCounterSpan") 
}
function SendRequestPageAS() {
	varUID = GenerateRandomNumber();
	varCriteria = "agents_count.asp?Page=Yes&UID="  + varUID
	+ "&Name=" + document.Agents.AgentNameInput.value
	include(varCriteria,"AgentCounterSpan") 
}
function GenerateRandomNumber() {
	var randomnumber= Math.floor(Math.random()*80000000)+10000000;
	return (randomnumber);
}
function QSGoTo() {
	varLocation = "homesearch_session.asp?UID=" + varUID
	+ "&Redirect=homesearch&PropertyType=" + document.QuickSearch.PropertyType.value
	+ "&MinPrice=" + document.QuickSearch.MinPrice.value
	+ "&MaxPrice=" + document.QuickSearch.MaxPrice.value
	self.location = varLocation;
}
function QSSumbit() {
	varLocation = "homesearch_session.asp?UID=" + varUID
	+ "&PropertyType=" + document.QuickSearch.PropertyType.value
	+ "&MinPrice=" + document.QuickSearch.MinPrice.value
	+ "&MaxPrice=" + document.QuickSearch.MaxPrice.value
	self.location = varLocation;
}
function LoadCounties() {
	varUID = GenerateRandomNumber();
	varCriteria = "homesearch_counties.asp?UID=" + varUID
	include(varCriteria,"County_List") 
}
function LoadYears() {
	varUID = GenerateRandomNumber();
	varCriteria = "homesearch_years.asp?UID=" + varUID
	include(varCriteria,"Year_List")
}
function SendRequestCities() {
	varUID = GenerateRandomNumber();
	document.getElementById("City_List").innerHTML = '<select name="City" disabled="disabled"><option value="">Loading...</option></select>'
	document.getElementById("Community_List").innerHTML = '<select name="Community_Name" disabled="disabled"><option value="">Select City...</option></select>'
	varCriteria = "homesearch_cities.asp?UID=" + varUID
	include(varCriteria,"City_List") 
	SendRequestHS();
}
function SendRequestSubs() {
	varUID = GenerateRandomNumber();
	document.getElementById("Community_List").innerHTML = '<select name="Community_Name" disabled="disabled"><option value="">Loading...</option></select>'
	varCriteria = "homesearch_subs.asp?UID=" + varUID
	+ "&County=" + document.HomeSearchForm.County.value
	+ "&City=" + document.HomeSearchForm.City.value
	include(varCriteria,"Community_List") 
}
function SendRequestHS() {
	if(document.HomeSearchForm.PropertyType.value == "R") {
		PopulateRentalRates();
	} else {
		PopulateNonRentalRates();
	}
	varUID = GenerateRandomNumber();
	document.getElementById('HS_Count_Count').innerHTML = "Calculating...";
	varCriteria = "homesearch_count.asp?HS=Yes&UID="  + varUID
	+ "&PropertyType=" + document.HomeSearchForm.PropertyType.value
	+ "&Bedrooms=" + document.HomeSearchForm.MinBeds.value
	+ "&Bathrooms=" + document.HomeSearchForm.MinBaths.value
	+ "&County=" + document.HomeSearchForm.County.value
	+ "&City=" + document.HomeSearchForm.City.value
	+ "&Community_Name=" + document.HomeSearchForm.Community_Name.value
	+ "&Year_Built=" + document.HomeSearchForm.Year_Built.value
	+ "&Zip_Code=" + document.HomeSearchForm.Zip_Code.value
	if(document.HomeSearchForm.PoolYN[0].checked) {
		varCriteria = varCriteria + "&PoolYN=Yes"
	}
	if(document.HomeSearchForm.PoolYN[1].checked) {
		varCriteria = varCriteria + "&PoolYN=No"
	}
	if(document.HomeSearchForm.PropertyType.value == "R") {
		varCriteria = varCriteria + "&MinPrice=" + document.HomeSearchForm.MinRate.value
		varCriteria = varCriteria + "&MaxPrice=" + document.HomeSearchForm.MaxRate.value
	} else {
		varCriteria = varCriteria + "&MinPrice=" + document.HomeSearchForm.MinPrice.value
		varCriteria = varCriteria + "&MaxPrice=" + document.HomeSearchForm.MaxPrice.value
	}
	include(varCriteria,"HS_Count_Count") 
}
function DoNothing(){
	jQuery(document).trigger('close.facebox')
}
function InitialPullIn(Page) {
	varUID = GenerateRandomNumber();
	varCriteria = "homesearch_results_data.asp?Page=" + Page + "&UID=" + varUID
	includePage(varCriteria,"ResultsPullIn");
}
function PullIn(Page) {
	document.getElementById("DisplayLoadingIndicator").style.visibility = 'visible';
var Compare = "";
	for (x=0; x<=document.HomeSearchResultsForm.PropertyCompare.length-1; x++) {
		if (document.HomeSearchResultsForm.PropertyCompare[x].checked) {
			var CurrentValue = document.HomeSearchResultsForm.PropertyCompare[x].value;
			if (x==0) { Compare += CurrentValue; } else { Compare += "," + CurrentValue; }
		}
	}
	varUID = GenerateRandomNumber();
	varCriteria = "homesearch_results_data.asp?Page=" + Page + "&PrevCompare=" + Compare + "&UID=" + varUID
	includePage(varCriteria,"ResultsPullIn");
}
function picchange(PhotoName){
	if (document.images) {
		document.mainpic.src = PhotoName;
	} else {
		top.location.href= "";
	}
}
function init_dw_Scroll() {
	if (document.getElementById('scrollLinks') != undefined) { 
		var wndo = new dw_scrollObj('wn', 'lyr1', 'tl');
		wndo.setUpScrollControls('scrollLinks');
	}
}
function init_dw_Scroll2() {
	if (document.getElementById('scrollLinks2') != undefined) { 
		var wndo = new dw_scrollObj('wn2', 'lyr12', 'tl2');
		wndo.setUpScrollControls('scrollLinks2');
	}
}
function BuildCompare(Compare)
{
	for (x=0; x<=document.HomeSearchResultsForm.PropertyCompare.length-1; x++) {
		if (document.HomeSearchResultsForm.PropertyCompare[x].checked) {
			var CurrentValue = document.HomeSearchResultsForm.PropertyCompare[x].value;
			if (x==0) { Compare += CurrentValue; } else { Compare += "," + CurrentValue; }
		}
	}
	if (Compare !== "") {
		self.location = "homesearch_session.asp?ActiveCompare=Yes&Compare=" + Compare;
	} else {
		alert("You Must Select Listings to Compare!");
	}
}
function BuildFPCompare(Compare)
{
	for (x=0; x<=document.HomeSearchResultsForm.PropertyCompare.length-1; x++) {
		if (document.HomeSearchResultsForm.PropertyCompare[x].checked) {
			var CurrentValue = document.HomeSearchResultsForm.PropertyCompare[x].value;
			if (x==0) { Compare += CurrentValue; } else { Compare += "," + CurrentValue; }
		}
	}
	if (Compare !== "") {
		self.location = "homesearch_session.asp?ActiveCompare=Yes&Return=featured_properties&Compare=" + Compare;
	} else {
		alert("You Must Select Listings to Compare!");
	}
}
function BuildCompareAgent(AgentID)
{
var Compare = "";
	for (x=0; x<=document.HomeSearchResultsForm.PropertyCompare.length-1; x++) {
		if (document.HomeSearchResultsForm.PropertyCompare[x].checked) {
			var CurrentValue = document.HomeSearchResultsForm.PropertyCompare[x].value;
			if (x==0) { Compare += CurrentValue; } else { Compare += "," + CurrentValue; }
		}
	}
	if (Compare !== "") {
		self.location = "homesearch_session.asp?ActiveCompare=Yes&Return=agents_details&ReturnID=" + AgentID + "&Compare=" + Compare;
	} else {
		alert("You Must Select Listings to Compare!");
	}
}
function ActivateFaceBox() {
	jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox() })
}
function include(xUrl,xId) {
	var xmlhttp = false;
  /*@cc_on @*/
  /*@if (@_jscript_version >= 5)
  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } }
  /*@end @*/
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); }
	xmlhttp.open("GET", xUrl,true);
  xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.getElementById(xId).innerHTML = xmlhttp.responseText; } }
  xmlhttp.send(null)
}
function includeThumbs(xUrl,xId) {
	var xmlhttp = false;
  /*@cc_on @*/
  /*@if (@_jscript_version >= 5)
  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } }
  /*@end @*/
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); }
  xmlhttp.open("GET",xUrl,true);
  xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) {
	document.getElementById(xId).innerHTML = xmlhttp.responseText;
	init_dw_Scroll2();
	} }
  xmlhttp.send(null)
}
function includePage(xUrl,xId) {
	var xmlhttp = false;
  /*@cc_on @*/
  /*@if (@_jscript_version >= 5)
  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } }
  /*@end @*/
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); }
  xmlhttp.open("GET",xUrl,true);
  xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) {
	document.getElementById(xId).innerHTML = xmlhttp.responseText;
	ActivateFaceBox();
	} }
  xmlhttp.send(null)
}
function RemoveCompare() {
var NumberChecked = 0;
var Compare = "";
var TotalCount = 1;
	if (document.HomeSearchCompareForm.PropertyCompare.checked) {
		//Do Nothing
		NumberChecked++;
	} else {
		var CurrentValue = document.HomeSearchCompareForm.PropertyCompare.value;
		if (Compare == "") { Compare += CurrentValue; } else { Compare += "," + CurrentValue; }
	}
	if (NumberChecked !== 0) {
		self.location = "homesearch_session.asp?ActiveCompare=Yes&Reset=Yes&Compare=" + Compare;
	} else {
		alert("You Must Select Listings to Remove!");
	}
}
function RemoveCompareMulti() {
var NumberChecked = 0;
var Compare = "";
var TotalCount = document.HomeSearchCompareForm.PropertyCompare.length;
	for (x=0; x<=TotalCount-1; x++) {
	if (document.HomeSearchCompareForm.PropertyCompare[x].checked) {
		//Do Nothing
		NumberChecked++;
	} else {
		var CurrentValue = document.HomeSearchCompareForm.PropertyCompare[x].value;
		if (Compare == "") { Compare += CurrentValue; } else { Compare += "," + CurrentValue; }
	}
	}
	if (NumberChecked !== 0) {
		self.location = "homesearch_session.asp?ActiveCompare=Yes&Reset=Yes&Compare=" + Compare;
	} else {
		alert("You Must Select Listings to Remove!");
	}
}
function PopulateRentalRates() {
	document.getElementById("HiddenRental").style.display = "Block";
	document.getElementById("HiddenNonRental").style.display = "None";
}
function PopulateNonRentalRates() {
	document.getElementById("HiddenRental").style.display = "None";
	document.getElementById("HiddenNonRental").style.display = "Block";
}
//-->