
  

	/**
	* Finds the house name they want and submits the form
	*/
	function findHouse(){
		
		var ok = true;
		
		var nameObj = document.getElementById("nameSelect");
		var codeObj = document.getElementById("code");

		if((nameObj.options[nameObj.selectedIndex].value == null || nameObj.options[nameObj.selectedIndex].value.length == 0) && codeObj.selectedIndex == 0){
			
			if(!($defined(suggester)) || (suggester.optionsArrayReduced == null || suggester.optionsArrayReduced.length == 0)){
				ok = false;
				alert("Please select either a name or a code.");
			}
		}//end if
	
		if(ok){

			var houseName = nameObj.value;
			if(houseName == null || houseName.length == 0){
				houseName = codeObj.value;
			}//end if

			if(nameObj.selectedIndex > 0 || codeObj.selectedIndex > 0){
				$('mainForm').action = "/villa/" + houseName + ".jsp?singleProperty=true";
			}else{
				$('mainForm').action = "/ts/search/FromQuickFind.jsp" + suggester.getActionParamsFromOptionsArray();				
			}
			$('mainForm').submit();
			return false;
		}//end if
		return ok;
	}//end findHouse()

	/**
	* Reduces a Select object to the default size of 1
	*/
	function resize(selectToResizeId){
		var selectObj = document.getElementById(selectToResizeId);
		selectObj.size = 1;
	}

	function closeOtherSelect(otherObjectId){
		$(otherObjectId).selectedIndex = 0;
	}
	
	/**
	* Checks to see if the name select needs refilling. This happens when the name
	* select has only a few names in it, but the byNameText field is empty, so we need
	* to refill the name select: usually when a user has pressed the history back button.
	*/
	
	function checkNameSelect(textboxId, selectId){
	/*
		var byNameTextObj = document.getElementById(textboxId);
		if(byNameTextObj.value == ''){
			//this is a call to methods in suggest.js
			if(origOptions != null && origOptions.length > 0){
				var nameObj = document.getElementById(selectId);
				restoreOriginalOptions();
				//nameObj.size = 1;
				nameObj.selectedIndex = 0;
			}//end if
		}//end if
	*/
	}
	
	
	/**
	* Changes the button src file so that it looks raised - called
	* by setTimeout
	*/
	function raiseButton(){
		var theButtonObj = document.getElementById(savedButtonId);
		theButtonObj.src = "/ts/images/inputs/" + savedRaisedButtonName;
	}
	


