	//This function is called onClick or onChange to run the selectlist.cfc?method=getCount method which returns a property count
	function submit_form(form){ 
		http( "POST" , "selectlist.cfc?method=getCount" , dsp_count , form ); //here we are posting the entire form.
	}

	//This function is called onClick or onChange to run the selectlist.cfc?method=getCount method which returns a property count
	function submit_form_prox(form){ 
		http( "POST" , "selectlist.cfc?method=getCountProximity" , dsp_count , form ); //here we are posting the entire form.
	}

	//This function is called onClick or onChange to run the selectlist.cfc?method=getCount method which returns a property count
	function submit_form_prox_Office(form){ 
		http( "POST" , "selectlist.cfc?method=getCountProximityOffice" , dsp_count_office , form ); //here we are posting the entire form.
	}

	function dsp_count(obj){
		//populate the DIV that shows the property count
		var Tot = parseInt(obj.tot);
		document.getElementById("displayTot").innerHTML = '<h1>'+obj.showtot+'</h1>';
		document.getElementById("displayRange").innerHTML = 'found in this price range:<br><br>$'+obj.minlp+' to $'+obj.maxlp;
		//document.getElementById("displayMaxLP").innerHTML = obj.maxlp;
		//document.getElementById("showListings").innerHTML = Tot;
		if (Tot > 0 && Tot < 150 ){
			document.getElementById("showListings").innerHTML = '<br><br><a class="Sorter" href="showgallery.cfm?'+obj.urlparms+'">Show Listings</a>';
		}
		else if (Tot <= 0 || Tot > 150) {
			document.getElementById("showListings").innerHTML = '<br><br>Show Listings';
		}
	}

	//This function is called onClick or onChange to run the selectagent.cfc?method=getCount method which returns an agent count
	function submit_form_agent(form){ 
		http( "POST" , "selectagent.cfc?method=getCount" , dsp_count_agent , form ); //here we are posting the entire form.
	}

	function dsp_count_agent(obj){
		//populate the DIV that shows the property count
		var Tot = parseInt(obj.tot);
		document.getElementById("displayTot").innerHTML = '<h1>'+obj.showtot+'</h1>';
		//document.getElementById("displayRange").innerHTML = 'found in this price range:<br><br>$'+obj.minlp+' to $'+obj.maxlp;
		//document.getElementById("displayMaxLP").innerHTML = obj.maxlp;
		//document.getElementById("showListings").innerHTML = Tot;
		if (Tot > 0 && Tot < 200 ){
			document.getElementById("showAgents").innerHTML = '<br><br><a class="Sorter" href="getAgents.cfm?'+obj.urlparms+'">Show Agents</a>';
		}
		else if (Tot <= 0 || Tot > 200) {
			document.getElementById("showAgents").innerHTML = "";
		}
	}

	function dsp_count_office(obj){
		//populate the DIV that shows the property count
		var Tot = parseInt(obj.tot);
		document.getElementById("displayTot").innerHTML = '<h1>'+obj.showtot+'</h1>';
		document.getElementById("showOffices").innerHTML = '<a class="Sorter" href="getOffices.cfm?'+obj.urlparms+'">Show Offices</a>';
	}
	
	//The next three functions use the JSMX engine.js to build the related select lists
	function recursiveSelect_request(fld,subFld,mthd){ 
		var params = "Cat="+fld.options[fld.selectedIndex].value; 
		var callback = function(obj){ 
			clearSelect(subFld); 
			addOptions(subFld,obj); 
		 } 
		http( 'post' , '../shared/selectlist.cfc?method='+mthd ,callback ,params ); 
	} 

	function clearSelect(elm){ 
		for(var x=elm.options.length;x>0;x--){ 
			elm.options[x]=null; 
			} 
		elm.options[0].selected=true; 
	} 

	function addOptions(elm,obj){ 
		for(var x=0; x < obj.length; x++){ 
			opt = new Option(obj[x][1],obj[x][0]); 
			elm.options[elm.options.length] = opt; 
		 } 
	} 