<!-- Original:  Kathi O'Shea (Kathi.O'Shea@internet.com) -->
<!-- Web Site:  http://www.web-savant.com/users/kathi/asp -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function moveOver()
{
var boxLength = document.criteria.choiceBox.length;
var selectedItem = document.criteria.available.selectedIndex;
var selectedText = document.criteria.available.options[selectedItem].text;
var selectedValue = document.criteria.available.options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.criteria.choiceBox.options[i].text;
if (thisitem == selectedText) {
isNew = false;
break;
      }
   }
}
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.criteria.choiceBox.options[boxLength] = newoption;
}
document.criteria.available.selectedIndex=-1;
}


function removeMe() {
var boxLength = document.criteria.choiceBox.length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.criteria.choiceBox.options[i].selected) {
arrSelected[count] = document.criteria.choiceBox.options[i].value;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.criteria.choiceBox.options[i].value == arrSelected[x]) {
document.criteria.choiceBox.options[i] = null;
   }
}
boxLength = document.criteria.choiceBox.length;
   }
}


function saveMe()
{
	var theform;
	theform = document.criteria;
	if (!theform) {
		theform = document.forms[0];
	}

	var fieldnames = new Array("age_restriction_yn","barn_yn","basement_yn",
					"disabled_access_yn","electricity","elevator_yn","extra_photos",
					"fence_yn","fireplace_yn","furnished_yn","garage_yn","gas","hardwood_flooring_yn",
					"irrigated_yn","level_multiple_yn","level_single_yn",
					"livestock_included_yn","newconstruction_yn","parking_rv_yn","petsnegotiable_yn","pool_yn",
					"room_dining_yn","room_exercise_yn","room_family_yn","room_laundry_yn",
					"room_living_yn","room_utility_yn","shop_yn","topography_level_yn",
					"topography_rolling_yn","topography_sloped_yn","view_yn","vtour_yn",
					"waterfront_yn");
	var strValues = "";
	for (i=0; i < fieldnames.length; i++)
	{
		field = theform.elements[fieldnames[i]];
		field.value='';
	}
	var boxLength = document.criteria.choiceBox.length;
	var count = 0;
	if (boxLength != 0)
	{
		for (i = 0; i < boxLength; i++)
		{
			if (count == 0)
			{
				strValues = document.criteria.choiceBox.options[i].value;
			}
			else
			{
				strValues = strValues + "," + document.criteria.choiceBox.options[i].value;
			}
			count++;
   		}
		for (i=0; i<fieldnames.length; i++)
		{
			if (strValues.indexOf(fieldnames[i])!=-1)
			{
				field = theform.elements[fieldnames[i]];
				field.value='1';
			}
		}
	}
}

