
/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}


function getRadioValue(radioObject) {
          var value = null
          for (var i=0; i<radioObject.length; i++) {
               if (radioObject[i].checked) {
                    value = radioObject[i].value;
                    break ;
               }
          }
          return value
     }
function show_loading() {
	document.getElementById('sched_output').innerHTML = "<br><br><br><center>Loading...</center><br><br><br>";
	}
function show_loading_area(area) {
	document.getElementById(area).innerHTML = "<br><br><br><center>Loading...</center><br><br><br>";
	}
function show_stats() {
	t = 1;
	//show_loading();
	team_id=document.f1.team_id.options[document.f1.team_id.selectedIndex].value;
	pos=document.f1.pos.options[document.f1.pos.selectedIndex].value;
	sortby = document.f1.sortby.value;
	query="stats_insert.php?sortby=" + sortby + "&team_id=" + team_id + "&pos=" + pos;
	query = query.replace(' ', '+');
	//alert("Here");
	$('#stats_output').load(query, {t: t}, function() {
	});
}

function show_stats_team() {
	t = 1;
	//show_loading_area('stats_output');
	split=document.fstats.split.options[document.fstats.split.selectedIndex].value;
	pos=document.fstats.pos.options[document.fstats.pos.selectedIndex].value;
	sortby = document.fstats.sortby.value;
	//alert("Here");
	team_id = document.fstats.team_id.value;
	query="stats_insert_team.php?sortby=" + sortby + "&team_id=" + team_id + "&pos=" + pos + "&split=" + split;
	query = query.replace(' ', '+');
	$('#stats_output').load(query, {t: t}, function() {
	});
}

function show_sched() {
	t = 1;
	show_loading();
	team_id=document.f1.team_id.options[document.f1.team_id.selectedIndex].value;
	mth=document.f1.mth.options[document.f1.mth.selectedIndex].value;
	sortby = document.f1.sortby.value;
	query="sched_insert.php?sortby=" + sortby + "&team_id=" + team_id + "&mth=" + mth;
	query = query.replace(' ', '+');
	//alert("Here");
	$('#sched_output').load(query, {t: t}, function() {
	});
}

function show_sched_team() {
	t = 1;
	opp_team_id=document.fsched.opp_team_id.options[document.fsched.opp_team_id.selectedIndex].value;
	mth=document.fsched.mth.options[document.fsched.mth.selectedIndex].value;
	sortby = document.fsched.sortby.value;
	team_id = document.fsched.team_id.value;
	query="team_schedule_insert.php?sortby=" + sortby + "&team_id=" + team_id + "&mth=" + mth + "&opp_team_id=" + opp_team_id;
	query = query.replace(' ', '+');
	//alert("Here");
	$('#sched_output').load(query, {t: t}, function() {
	});
}
function show_agents() {
	t=1;
	officeid=document.f1.officeid.options[document.f1.officeid.selectedIndex].value;
	query="agents_listings.php?officeid=" + officeid;
	$('#hit_tab_front3').load(query, {t: t}, function() {
	});
}

function show_frontPage(t) {
		query="populate_ajax_divs.php?web_area=1";
		$('#hit_tab_front1').load(query, {t: t}, function() {
		});
		query="populate_ajax_divs.php?web_area=2";
		$('#hit_tab_front2').load(query, {t: t}, function() {
		});
		query="populate_ajax_divs.php?web_area=3";
		$('#hit_tab_front3').load(query, {t: t}, function() {
		});
		query="populate_ajax_divs.php?web_area=6";
		$('#hit_tab_front6').load(query, {t: t}, function() {
		});
}

function show_agents_2(t) {
		query="populate_ajax_divs.php?web_area=10";
		$('#hit_tab_front1').load(query, {t: t}, function() {
		});
}

function show_mapFront(t) {
		document.getElementById('mapFront').innerHTML = "<br><br><center>Loading...</center></br>";
		zone2=document.f1.zone2.options[document.f1.zone2.selectedIndex].value;
		subArea=document.f1.subArea.options[document.f1.subArea.selectedIndex].value;
		bedrooms=document.f1.bedrooms.options[document.f1.bedrooms.selectedIndex].value;
		listingDate=document.f1.listingDate.options[document.f1.listingDate.selectedIndex].value;
		agentid=document.f1.agentid.options[document.f1.agentid.selectedIndex].value;
		officeid=document.f1.officeid.options[document.f1.officeid.selectedIndex].value;
		propertyTypeCode=document.f1.propertyTypeCode.options[document.f1.propertyTypeCode.selectedIndex].value;
		city=document.f1.city.options[document.f1.city.selectedIndex].value;
		city = city.replace(" ", "+");
		//postalCode="-99";
		//var mls="-99";
		//var zone="-99";
		//var view_type="-99";
		//var recent_listings="-99";
		//ftype="2";
		min_price=document.f1.min_price.options[document.f1.min_price.selectedIndex].value;
		max_price=document.f1.max_price.options[document.f1.max_price.selectedIndex].value;
		//apartment=document.f1.apartment.options[document.f1.apartment.selectedIndex].value;
		//openhouse=document.f1.openhouse.options[document.f1.openhouse.selectedIndex].value;
		//var keyword=document.f1.keyword.value;
		//keyword = keyword.replace(' ', '+');
		//pagenum=document.f1.pagenum.value;
		//sortby=document.f1.sortby.value;
		//sortby = sortby.replace(" ", "+");
		//query="search_frontpage_map_4.php?recent_listings=" + recent_listings + "&bedrooms=" + bedrooms + "&zone2=" + zone2 + "&zone=" + zone + "&agentid=" + agentid + "&officeid=" + officeid + "&propertyTypeCode=" + propertyTypeCode + "&city=" + city + "&postalCode=" + postalCode + "&view_type=" + view_type + "&pagenum=" + pagenum + "&sortby=" + sortby + "&min_price=" + min_price + "&max_price=" + max_price + "&apartment=" + apartment + "&subArea=" + subArea + "&listingDate=" + listingDate + "&ftype=" + ftype + "&mls=" + mls + "&keyword=" + keyword + "&openhouse=" + openhouse;
		//query="search_frontpage_map_4.php?bedrooms=" + bedrooms + "&zone2=" + zone2 + "&agentid=" + agentid + "&officeid=" + officeid + "&propertyTypeCode=" + propertyTypeCode + "&city=" + city + "&pagenum=" + pagenum + "&sortby=" + sortby + "&min_price=" + min_price + "&max_price=" + max_price + "&apartment=" + apartment + "&subArea=" + subArea + "&listingDate=" + listingDate + "&keyword=" + keyword + "&openhouse=" + openhouse;
		if (t=='1') {
			query="search_frontpage_map_4.php?ftype=2&zone2=" + zone2 + "&subArea=" + subArea + "&bedrooms=" + bedrooms + "&listingDate=" + listingDate + "&agentid=" + agentid + "&officeid=" + officeid + "&propertyTypeCode=" + propertyTypeCode + "&city=" + city + "&min_price=" + min_price + "&max_price=" + max_price;
			}
		else {
			query="search_results_2.php?ftype=2&zone2=" + zone2 + "&subArea=" + subArea + "&bedrooms=" + bedrooms + "&listingDate=" + listingDate + "&agentid=" + agentid + "&officeid=" + officeid + "&propertyTypeCode=" + propertyTypeCode + "&city=" + city + "&min_price=" + min_price + "&max_price=" + max_price;
			}
		query = query.replace(' ', '+');
		$('#mapFront').load(query, {t: t}, function() {
		});
}
function send_email(t) {
		if (t==1) {
			query="email_rlp_01.php?t=" + t + "&firstName=" + document.f10.firstName.value;
			query=query+"&lastName=" + document.f10.lastName.value;
			query=query+"&email=" + document.f10.email.value;
			query=query+"&phone=" + document.f10.phone.value;
			query=query+"&address=" + document.f10.address.value;
			query=query+"&pcode=" + document.f10.pcode.value;
			query=query+"&year=" + document.f10.year.value;
			query=query+"&size=" + document.f10.size.value;
			query=query+"&sizeUnits=" + document.f10.sizeUnits.options[document.f10.sizeUnits.selectedIndex].value;
			query=query+"&apartment=" + document.f10.apartment.options[document.f10.apartment.selectedIndex].value;
			query=query+"&bedrooms=" + document.f10.bedrooms.options[document.f10.bedrooms.selectedIndex].value;
			query=query+"&bathrooms=" + document.f10.bathrooms.options[document.f10.bathrooms.selectedIndex].value;
			query=query+"&garage=" + document.f10.garage.options[document.f10.garage.selectedIndex].value;
			query=query+"&garageType=" + document.f10.garageType.options[document.f10.garageType.selectedIndex].value;
			query=query+"&basementType=" + document.f10.basementType.options[document.f10.basementType.selectedIndex].value;
			query=query+"&development=" + document.f10.development.options[document.f10.development.selectedIndex].value;
			query=query+"&moving=" + document.f10.moving.options[document.f10.moving.selectedIndex].value;
			query=query+"&pdetails=" + document.f10.pdetails.value;
			query=query+"&subscribe=" + document.f10.subscribe.options[document.f10.subscribe.selectedIndex].value;
			}
		else if (t==2) {
			query="email_rlp_02.php?t=" + t + "&name=" + document.f10.name.value;
			query=query+"&email=" + document.f10.email.value;
			query=query+"&to_email=" + document.f10.to_email.value;
			query=query+"&phone=" + document.f10.phone.value;
			query=query+"&mls=" + document.f10.mls.value;
			query=query+"&pdetails=" + document.f10a.pdetails.value;
			}
		query=query.replace(/\s+/g, "+");
		//alert(query);
		$('#email_out').load(query, {t: t}, function() {
		});
}

function show_Agents(t) {
		query="populate_ajax_divs.php?web_area=4";
		$('#hit_tab_front4').load(query, {t: t}, function() {
		});
}

function show_details(lat,id,long,fav) {
	t=1;
	show_loading();
	query="property_details_2.php?t=1&favorite_status=" + fav + "&id=" + id;
		$('#hit_tab_content').load(query, {t: t}, function() {
		});
	//document.writeln(query);
	//query = create_top_menu(1,lat,id,long);
	//document.getElementById('details_menu').innerHTML = query;
	show_favorites();
}

function map_view(lat,id,long,fav) {
	t=2;
	show_loading();
	query="property_details_2.php?t=2&favorite_status=" + fav + "&id=" + id;
		$('#hit_tab_content').load(query, {t: t}, function() {
		});
	//document.writeln(query);
	//query = create_top_menu(1,lat,id,long);
	//document.getElementById('details_menu').innerHTML = query;
}

function birds_eye_view(lat,id,long,fav) {
	t=3;
	show_loading();
	query="property_details_2.php?t=3&favorite_status=" + fav + "&id=" + id;
		$('#hit_tab_content').load(query, {t: t}, function() {
		});
}

function agent_info_view(lat,id,long,fav) {
	//alert("Here");
	t=5;
	show_loading();
	query="property_details_2.php?t=5&favorite_status=" + fav + "&id=" + id;
		$('#hit_tab_content').load(query, {t: t}, function() {
		});
}

function street_view(lat,id,long,fav) {
	t=4;
	show_loading();
	query="property_details_2.php?t=4&favorite_status=" + fav + "&id=" + id;
		$('#hit_tab_content').load(query, {t: t}, function() {
		});
}

function agent_details(lat,id,long) {
	t=4;
	query="agent_details_2.php?t=4&id=" + id;
		$('#hit_tab_content').load(query, {t: t}, function() {
		});
	//document.writeln(query);
	//query = create_top_menu(1,lat,id,long);
	//document.getElementById('details_menu').innerHTML = query;
}

function show_agent_info(lat,id,long) {
	t=4;
	query="agent_details_2.php?t=4&id=" + id;
		$('#hit_tab_content').load(query, {t: t}, function() {
		});
	//document.writeln(query);
	//query = create_top_menu(1,lat,id,long);
	//document.getElementById('details_menu').innerHTML = query;
}

function show_favorites() {
	t=0;
	query="ajax_favorites.php";
	$('#favorites_tab').load(query, {t: t}, function() {
		});
}

function property_details_favorites(id,lat_co,long_co) {
	t=0;
	query="property_details_favorites.php?id=" + id +"&lat_co=" + lat_co + "&long_co=" + long_co;
	//alert(query);
	$('#PropertyDetailsFavBtn').load(query, {t: t}, function() {
		});
}

function show_details_sub(lat,id,long) {
	t=0;
	query="property_details_2.php?id=" + id;
		$('#details_body').load(query, {t: t}, function() {
		});
	query = create_top_menu(1,lat,id,long);
	document.getElementById('details_menu').innerHTML = query;
}

function agent_info_sub2(lat,id,long) {
	t=0;
	query="property_details_2.php?id=" + id;
		$('#details_body').load(query, {t: t}, function() {
		});
	query = create_top_menu(1,lat,id,long);
	document.getElementById('details_menu').innerHTML = query;
}


function show_agent_listings(id) {
	query="agent_properties.php?agentID=" + id;
		$('#hit_tab_front20').load(query, {t: id}, function() {
		});
	//query = create_top_menu(4,lat,id,long);
	//document.getElementById('details_menu').innerHTML = query;
}

function show_agent_info(id) {
	query="show_agent_details.php?agentID=" + id;
		$('#hit_tab_front20').load(query, {t: id}, function() {
		});
	//query = create_top_menu(4,lat,id,long);
	//document.getElementById('details_menu').innerHTML = query;
}

function street_view_2(lat,id,long) {
	t=1;
	query = create_top_menu(3,lat,id,long);
	query="<div id=\"details_menu\" style=\"width:780px;height:20px;\">" + query + "</div><div id=\"details_body\"><iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"street_view_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe>";
	document.getElementById('hit_tab_content').innerHTML = query;
	$('#hit_tab_content').load(query, {t: t}, function() {
	});
	//document.writeln(query);
}

function street_view_3(lat,id,long) {
	t=1;
	query = create_top_menu(3,lat,id,long);
	query="<div id=\"details_menu\" style=\"width:780px;height:20px;\">" + query + "</div><div id=\"details_body\"><iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"street_view_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe>";
	document.getElementById('hit_tab_content').innerHTML = query;
	$('#hit_tab_content').load(query, {t: t}, function() {
	});
	//document.writeln(query);
}

function birds_eye_view_2(lat,id,long) {
	t=1;
	query = create_top_menu(6,lat,id,long);
	query="<div id=\"details_menu\" style=\"width:780px;height:20px;\">" + query + "</div><div id=\"details_body\"><iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"birds_eye_view_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe>";
	document.getElementById('hit_tab_content').innerHTML = query;
	$('#hit_tab_content').load(query, {t: t}, function() {
	});
	//document.writeln(query);
}
function create_top_menu(v,lat,id,long) {
	str="<div id=\"sort_links\">";
	if (v==1) {str=str + "<span id=\"b1\" class=\"sort_buttons\"><span class='selected'>Property Details</span></span>"	}
	else {str=str + "<span id=\"b1\" class=\"sort_buttons\"><a href=\"#\" onclick=\"show_details_sub('" + lat + "','" + id + "','" + long + "'); return false;\" rel=\"nofollow\" title=\"Property Details\">Property Details</a></span>";}
	if (lat!='0') {
		if (v==2) {str=str + "<span id=\"b2\" class=\"sort_buttons\"><span class='selected'>Map View</span></span>"	}
		else {str=str + "<span id=\"b2\" class=\"sort_buttons\"><a href=\"#\" onclick=\"map_view_sub('" + lat + "','" + id + "','" + long + "'); return false;\" rel=\"nofollow\" title=\"Map View\">Map View</a></span>";}
		if (v==3) {str=str + "<span id=\"b3\" class=\"sort_buttons\"><span class='selected'>Street View</span></span>"	}
		else {str=str + "<span id=\"b3\" class=\"sort_buttons\"><a href=\"#\" onclick=\"street_view_sub('" + lat + "','" + id + "','" + long + "'); return false;\" rel=\"nofollow\" title=\"Street View\">Street View</a></span>";}
		if (v==6) {str=str + "<span id=\"b3\" class=\"sort_buttons\"><span class='selected'>Birds Eye View</span></span>"	}
		else {str=str + "<span id=\"b3\" class=\"sort_buttons\"><a href=\"#\" onclick=\"birds_eye_view_sub('" + lat + "','" + id + "','" + long + "'); return false;\" rel=\"nofollow\" title=\"Birds Eye View\">Birds Eye View</a></span>";}
		}
	if (v==4) {str=str + "<span id=\"b4\" class=\"sort_buttons\"><span class='selected'>Agent Info</span></span>"	}
	else {str=str + "<span id=\"b4\" class=\"sort_buttons\"><a href=\"#\" onclick=\"agent_info_sub('" + lat + "','" + id + "','" + long + "'); return false;\" rel=\"nofollow\" title=\"Agent Info\">Agent Info</a></span>";}
	if (v==5) {str=str + "<span id=\"b4\" class=\"sort_buttons\"><span class='selected'>Mortgage Calculator</span></span>"	}
	else {str=str + "<span id=\"b4\" class=\"sort_buttons\"><a href=\"#\" onclick=\"mortgage_calculator_sub('" + lat + "','" + id + "','" + long + "'); return false;\" rel=\"nofollow\" title=\"Mortgage Calculator\">Mortgage Calculator</a></span>";}
	str=str + "</div>";
	str=str + "<span id=\"b6\" class=\"sort_listings\"><a href=\"#\" onclick=\"show_listings('1'); return false;\" rel=\"nofollow\" title=\"Back to Listings\">[Back to Listings]</a></span>";

	return str;
	}

function show_details_menu(v,lat,id,long) {
	query = create_top_menu(1,lat,id,long);
	document.writeln(query);
	}

function map_view_sub(lat,id,long) {
	t=0;
	query = create_top_menu(2,lat,id,long);
	document.getElementById('details_menu').innerHTML = query;
	query="<iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"map_view_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe>";
	document.getElementById('details_body').innerHTML = query;
}

function birds_eye_view_sub(lat,id,long) {
	t=0;
	query = create_top_menu(6,lat,id,long);
	document.getElementById('details_menu').innerHTML = query;
	query="<iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"birds_eye_view_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe>";
	document.getElementById('details_body').innerHTML = query;
}

function street_view_sub(lat,id,long) {
	t=0;
	query = create_top_menu(3,lat,id,long);
	document.getElementById('details_menu').innerHTML = query;
	query="<iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"street_view_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe>";
	document.getElementById('details_body').innerHTML = query;
}

function mortgage_calculator_sub(lat,id,long) {
	t=0;
	query = create_top_menu(5,lat,id,long);
	document.getElementById('details_menu').innerHTML = query;
	query="<iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"mortgage_calculator_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe>";
	document.getElementById('details_body').innerHTML = query;
}

function map_view_old(lat,id,long) {
	t=1;
	query = create_top_menu(2,lat,id,long);
	query="<div id=\"details_menu\" style=\"width:780px;height:20px;\">" + query + "</div><div id=\"details_body\"><iframe allowTransparency=\"true\" marginwidth=0 marginheight=0 vspace=0 hspace=0 scrolling=\"no\" src=\"map_view_2.php?id=" + id + "&lat=" + lat + "&long=" + long + "\" width=775 height=463 frameborder=0></iframe></div>";
	document.getElementById('hit_tab_content').innerHTML = query;
	$('#hit_tab_content').load(query, {t: t}, function() {
	});
	//document.writeln(query);
}
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}


function show_tab(num) {
	if (num==1) {
		//map_canvas.style.display='none';
		//p_details.style.display='block';
		//listing_tab.style.class='tab current';
		//map_tab.style.class='tab';
		document.f1.view_type.value="L";
		//document.getElementById("listing_tab").setAttribute("class", "tab current");
		//document.getElementById("map_tab").setAttribute("class", "tab");
		//document.getElementById("recent_tab").setAttribute("class", "tab");
		document.f1.recent_listings.value="N";
		document.f1.pagenum.value=1;
		show_listings('1');
		}
	else if (num==2) {
		//map_canvas.style.display='block';
		//p_details.style.display='none';
		//listing_tab.style.class='tab';
		//map_tab.style.class='tab current';
		document.f1.view_type.value="M";
		document.getElementById("map_tab").setAttribute("class", "tab current");
		document.getElementById("listing_tab").setAttribute("class", "tab");
		document.getElementById("recent_tab").setAttribute("class", "tab");
		document.f1.recent_listings.value="N";
		document.f1.pagenum.value=1;
		show_listings('2');
		//initialize();
		}
	else if (num==3) {
		document.getElementById("quick_tab").setAttribute("class", "tab current");
		document.getElementById("quick_search").style.display = 'block';
		document.getElementById("advanced_tab").setAttribute("class", "tab");
		document.getElementById("advanced_search").style.display = 'none';
		document.f1.recent_listings.value="N";
		document.f1.ftype.value="1";
		show_listings('3');
		}
	else if (num==4) {
		document.getElementById("advanced_tab").setAttribute("class", "tab current");
		document.getElementById("advanced_search").style.display = 'block';
		document.getElementById("quick_tab").setAttribute("class", "tab");
		document.getElementById("quick_search").style.display = 'none';
		document.f1.recent_listings.value="N";
		document.f1.ftype.value="2";
		show_listings('4');
		}
	else if (num==6) {
		document.f1.view_type.value="L";
		//document.getElementById("listing_tab").setAttribute("class", "tab");
		//document.getElementById("map_tab").setAttribute("class", "tab");
		//document.getElementById("recent_tab").setAttribute("class", "tab current");
		document.f1.recent_listings.value="Y";
		document.f1.pagenum.value=1;
		show_listings('6');
		}
	else if (num==7) {
		keyword=document.f1.keyword.value;
		//if (keyword="undefined") {keyword='';}
		ftype=document.f1.ftype.value;
		bedrooms=document.f1.bedrooms.options[document.f1.bedrooms.selectedIndex].value;
		bathrooms=document.f1.bathrooms.options[document.f1.bathrooms.selectedIndex].value;
		listingDate=document.f1.element_2_3.value + '-' + document.f1.element_2_1.value + '-' + document.f1.element_2_2.value;
		propertyTypeCode=getCheckedValue(document.f1.propertyTypeCode);
		minPrice=document.f1.minPrice.options[document.f1.minPrice.selectedIndex].value;
		maxPrice=document.f1.maxPrice.options[document.f1.maxPrice.selectedIndex].value;
		qrystr = "search_3.php?recent_listings=N&view_type=L&ftype=" + ftype + "&propertyTypeCode=" + propertyTypeCode + "&bedrooms=" + bedrooms + "&bathrooms=" + bathrooms + "&keyword=" + keyword + "&minPrice=" + minPrice + "&maxPrice=" + maxPrice + "&listingDate=" + listingDate;
		qrystr = qrystr.replace(' ', '+');
		location.href=qrystr;
		}
	else if (num==8) {
		document.f1.view_type.value="L";
		document.f1.recent_listings.value="Y";
		document.f1.pagenum.value=1;
		document.f1.ftype.value="1";
		document.f1.propertyTypeCode.value="044";
		location.href="search_3.php?recent_listings=Y&view_type=L&ftype=1&propertyTypeCode=044";
		//document.f1.submit();
		}
	else if (num==10) {
		show_agents();
		}
	}

function goto_page(pg) {
		document.f1.pagenum.value=pg;
		show_listings('1');
		}

function update_count(nm) {
		alert(nm);
		document.getElementById('parent.cnt').innerHTML = nm;
		}

