<!--

function checked()
{
var formctl = document.forms[0];
	for (i=0; i<formctl.length; i++)
		{
	  if (formctl.elements[i].type=='checkbox' && !(formctl.elements[i].name == 'example1' || formctl.elements[i].name == 'example2'))
		   {
		   if (formctl.elements[i].checked) return true;
		   }
	  }
	return false;
}

function SearchAgain(lcaction, lid)
{
// Changing Search
if (lcaction == 'NEWSEARCH' || lcaction == 'MODIFYSEARCH')
 {
 document.form.action = 'FeatureHomeAction3.html';
 document.form.haction.value = lcaction;
 document.form.target = '_self';
 document.form.submit();
 return;
 }
// Changing Tabs
if (lcaction == 'MYLISTINGS' || lcaction == 'RECENTSOLDS' || lcaction == 'OFFICELISTINGS')
 {
 document.form.action = 'FeatureHomeAction3.html';
 document.form.haction.value = lcaction;
 document.form.clicktab.value = lcaction;
	document.form.list_id.value = '0';
 document.form.target = '_self';
 document.form.submit();
 return;
 }
// Changing Sort Order
if (lcaction == 'SORT1')
 {
	strTab = document.form.curtab.value;
 document.form.action = 'FeatureHomeAction3.html';
 document.form.haction.value = ((strTab=='RECENTSOLDS') ? "RECENTSOLDS" : "SEARCHHOMES");
 document.form.orderby.value = document.form.orderby1.options[document.form.orderby1.selectedIndex].value;
 document.form.sequence.value = document.form.seq1.options[document.form.seq1.selectedIndex].value;
	document.form.list_id.value = '0';
 document.form.target = '_self';
 document.form.submit();
 return;
 }
	
if (lcaction == 'SORT2')
 {
	strTab = document.form.curtab.value;
 document.form.action = 'FeatureHomeAction3.html';
 document.form.haction.value = ((strTab=='RECENTSOLDS') ? "RECENTSOLDS" : "SEARCHHOMES");
 document.form.orderby.value = document.form.orderby2.options[document.form.orderby2.selectedIndex].value;
 document.form.sequence.value = document.form.seq2.options[document.form.seq2.selectedIndex].value;
	document.form.list_id.value = '0';
 document.form.target = '_self';
 document.form.submit();
 return;
 }

if (lcaction == 'GETNEXT')
 {
	strTab = document.form.curtab.value;
	if(lid) document.form.list_id.value = lid;

	//document.form.action = 'FeatureHomeAction3.html';
	//document.form.haction.value = ((strTab=='RECENTSOLDS') ? "RECENTSOLDS" : "SEARCHHOMES");

	//document.form.target = '_self';
	//document.form.submit();

	var sUrl = 'FeatureHomeAction3.html?qaction=GETNEXT';
	sUrl += '&cur_tab=' + ((strTab=='RECENTSOLDS') ? "RECENTSOLDS" : "SEARCHHOMES");
	sUrl += '&a_id=' + document.form.agents_id.value;
	sUrl += '&list_id=' + lid;
	sUrl += '&orderby=' + document.form.orderby.value;
	sUrl += '&sequence=' + document.form.sequence.value;

	document.location = sUrl;
	return;
}
	
// push to realbot
if (lcaction == 'REALBOT')
 {
 document.form.action = 'FeatureHomeAction3.html';
 document.form.haction.value = 'REALBOT';
 document.form.target = '_self';
 document.form.submit();
 return;
 }

if (!checked())
 {
 alert('Please Check at least one Property before Saving!');
 return;
 } 
else
 {
 document.form.action = 'FeatureHomeAction3.html';
 document.form.haction.value = 'SAVEHOMES';
 document.form.target = '_self';
 document.form.submit();
 return;
 }
}

function getDetails(homeid, strAnchor)
{
document.form.detlist_id.value = homeid;
var url = "/ViewDetails.html" + ((strAnchor) ? strAnchor : '');
var win1 = null;
var heightvar;
if (window.screen.height < 700) 
  heightvar = 500;
else
  heightvar = 700;
win1 = window.open("","windetails","width=600,height="+heightvar+",top=0,left=0,scrollbars=yes,resizable=yes,location=no");
document.form.target = "windetails";
document.form.action = url;
document.form.submit();
win1.focus();
}

function tm(str) { var s=str; var t=''+(new Date()).getTime();  s += t.substring(t.length-6,t.length);  return s; }

function open_calc(P){
price=P;
var win1 = null;
var url = '/html/common/mortgage.html';
var ac = document.form.agent_country.value;
if(ac && ac=="Canada") url = '/html/common/mortgageca.html';
win1 = window.open(url,"win",'scrollbars=no,width=410,height=465');
win1.focus();
}

-->