function ListingType(){ 
 // this function is used to fill the ListingType list on load
addOption(document.drop_list.ListingType, "5", "Condominium", "");
addOption(document.drop_list.ListingType, "9", "Single Family and Condos", "");
addOption(document.drop_list.ListingType, "10", "All Rentals", "");
addOption(document.drop_list.ListingType, "7", "Rentals-Detached", "");
addOption(document.drop_list.ListingType, "8", "Rentals-Attached", "");
addOption(document.drop_list.ListingType, "2", "Vacant Land", "");
addOption(document.drop_list.ListingType, "6", "Mobile Home", "");
addOption(document.drop_list.ListingType, "3", "Multi Unit", "");
SelectPrice();
}
function SelectPrice(){
// ON selection of ListingType this function will work
removeAllOptions(document.drop_list.MinPrice);
removeAllOptions(document.drop_list.MaxPrice);
addOption(document.drop_list.MinPrice, "any", "Any");
addOption(document.drop_list.MaxPrice, "any", "Any");
if(document.drop_list.ListingType.value == '1' || document.drop_list.ListingType.value == '9' || document.drop_list.ListingType.value == '3' || document.drop_list.ListingType.value == '2' || document.drop_list.ListingType.value == '6' || document.drop_list.ListingType.value == '5'){
addOption(document.drop_list.MinPrice,"100000", "$100,000");
addOption(document.drop_list.MinPrice,"125000", "$125,000");
addOption(document.drop_list.MinPrice,"150000", "$150,000");
addOption(document.drop_list.MinPrice,"175000", "$175,000");
addOption(document.drop_list.MinPrice,"200000", "$200,000");
addOption(document.drop_list.MinPrice,"225000", "$225,000");
addOption(document.drop_list.MinPrice,"250000", "$250,000");
addOption(document.drop_list.MinPrice,"275000", "$275,000");
addOption(document.drop_list.MinPrice,"300000", "$300,000");
addOption(document.drop_list.MinPrice,"325000", "$325,000");
addOption(document.drop_list.MinPrice,"350000", "$350,000");
addOption(document.drop_list.MinPrice,"375000", "$375,000");
addOption(document.drop_list.MinPrice,"400000", "$400,000");
addOption(document.drop_list.MinPrice,"425000", "$425,000");
addOption(document.drop_list.MinPrice,"450000", "$450,000");
addOption(document.drop_list.MinPrice,"475000", "$475,000");
addOption(document.drop_list.MinPrice,"500000", "$500,000");
addOption(document.drop_list.MinPrice,"550000", "$550,000");
addOption(document.drop_list.MinPrice,"600000", "$600,000");
addOption(document.drop_list.MinPrice,"650000", "$650,000");
addOption(document.drop_list.MinPrice,"700000", "$700,000");
addOption(document.drop_list.MinPrice,"750000", "$750,000");
addOption(document.drop_list.MinPrice,"800000", "$800,000");
addOption(document.drop_list.MinPrice,"850000", "$850,000");
addOption(document.drop_list.MinPrice,"900000", "$900,000");
addOption(document.drop_list.MinPrice,"950000", "$950,000");
addOption(document.drop_list.MinPrice,"1000000", "$1,000,000");
addOption(document.drop_list.MinPrice,"1100000", "$1,100,000");
addOption(document.drop_list.MinPrice,"1200000", "$1,200,000");
addOption(document.drop_list.MinPrice,"1300000", "$1,300,000");
addOption(document.drop_list.MinPrice,"1400000", "$1,400,000");
addOption(document.drop_list.MinPrice,"1500000", "$1,500,000");
addOption(document.drop_list.MinPrice,"1600000", "$1,600,000");
addOption(document.drop_list.MinPrice,"1700000", "$1,700,000");
addOption(document.drop_list.MinPrice,"1800000", "$1,800,000");
addOption(document.drop_list.MinPrice,"1900000", "$1,900,000");
addOption(document.drop_list.MinPrice,"2000000", "$2,000,000");
addOption(document.drop_list.MinPrice,"2250000", "$2,250,000");
addOption(document.drop_list.MinPrice,"2500000", "$2,500,000");
addOption(document.drop_list.MinPrice,"2750000", "$2,750,000");
addOption(document.drop_list.MinPrice,"3000000", "$3,000,000");
addOption(document.drop_list.MinPrice,"3500000", "$3,500,000");
addOption(document.drop_list.MinPrice,"4000000", "$4,000,000");
addOption(document.drop_list.MinPrice,"4500000", "$4,500,000");
addOption(document.drop_list.MinPrice,"5000000", "$5,000,000");
addOption(document.drop_list.MinPrice,"6000000", "$6,000,000");
addOption(document.drop_list.MinPrice,"7000000", "$7,000,000");
addOption(document.drop_list.MinPrice,"8000000", "$8,000,000");
addOption(document.drop_list.MaxPrice,"125000", "$125,000");
addOption(document.drop_list.MaxPrice,"150000", "$150,000");
addOption(document.drop_list.MaxPrice,"175000", "$175,000");
addOption(document.drop_list.MaxPrice,"200000", "$200,000");
addOption(document.drop_list.MaxPrice,"225000", "$225,000");
addOption(document.drop_list.MaxPrice,"250000", "$250,000");
addOption(document.drop_list.MaxPrice,"275000", "$275,000");
addOption(document.drop_list.MaxPrice,"300000", "$300,000");
addOption(document.drop_list.MaxPrice,"325000", "$325,000");
addOption(document.drop_list.MaxPrice,"350000", "$350,000");
addOption(document.drop_list.MaxPrice,"375000", "$375,000");
addOption(document.drop_list.MaxPrice,"400000", "$400,000");
addOption(document.drop_list.MaxPrice,"425000", "$425,000");
addOption(document.drop_list.MaxPrice,"450000", "$450,000");
addOption(document.drop_list.MaxPrice,"475000", "$475,000");
addOption(document.drop_list.MaxPrice,"500000", "$500,000");
addOption(document.drop_list.MaxPrice,"550000", "$550,000");
addOption(document.drop_list.MaxPrice,"600000", "$600,000");
addOption(document.drop_list.MaxPrice,"650000", "$650,000");
addOption(document.drop_list.MaxPrice,"700000", "$700,000");
addOption(document.drop_list.MaxPrice,"750000", "$750,000");
addOption(document.drop_list.MaxPrice,"800000", "$800,000");
addOption(document.drop_list.MaxPrice,"850000", "$850,000");
addOption(document.drop_list.MaxPrice,"900000", "$900,000");
addOption(document.drop_list.MaxPrice,"950000", "$950,000");
addOption(document.drop_list.MaxPrice,"1000000", "$1,000,000");
addOption(document.drop_list.MaxPrice,"1100000", "$1,100,000");
addOption(document.drop_list.MaxPrice,"1200000", "$1,200,000");
addOption(document.drop_list.MaxPrice,"1300000", "$1,300,000");
addOption(document.drop_list.MaxPrice,"1400000", "$1,400,000");
addOption(document.drop_list.MaxPrice,"1500000", "$1,500,000");
addOption(document.drop_list.MaxPrice,"1600000", "$1,600,000");
addOption(document.drop_list.MaxPrice,"1700000", "$1,700,000");
addOption(document.drop_list.MaxPrice,"1800000", "$1,800,000");
addOption(document.drop_list.MaxPrice,"1900000", "$1,900,000");
addOption(document.drop_list.MaxPrice,"2000000", "$2,000,000");
addOption(document.drop_list.MaxPrice,"2250000", "$2,250,000");
addOption(document.drop_list.MaxPrice,"2500000", "$2,500,000");
addOption(document.drop_list.MaxPrice,"2750000", "$2,750,000");
addOption(document.drop_list.MaxPrice,"3000000", "$3,000,000");
addOption(document.drop_list.MaxPrice,"3500000", "$3,500,000");
addOption(document.drop_list.MaxPrice,"4000000", "$4,000,000");
addOption(document.drop_list.MaxPrice,"4500000", "$4,500,000");
addOption(document.drop_list.MaxPrice,"5000000", "$5,000,000");
addOption(document.drop_list.MaxPrice,"6000000", "$6,000,000");
addOption(document.drop_list.MaxPrice,"7000000", "$7,000,000");
addOption(document.drop_list.MaxPrice,"8000000", "$8,000,000");
addOption(document.drop_list.MaxPrice,"", "$8,000,000 +");
}
if(document.drop_list.ListingType.value == '10' || document.drop_list.ListingType.value == '8' || document.drop_list.ListingType.value == '7'){
addOption(document.drop_list.MinPrice,"500", "$500");
addOption(document.drop_list.MinPrice,"750", "$750");
addOption(document.drop_list.MinPrice,"1000", "$1,000");
addOption(document.drop_list.MinPrice,"1100", "$1,100");
addOption(document.drop_list.MinPrice,"1200", "$1,200");
addOption(document.drop_list.MinPrice,"1300", "$1,300");
addOption(document.drop_list.MinPrice,"1400", "$1,400");
addOption(document.drop_list.MinPrice,"1500", "$1,500");
addOption(document.drop_list.MinPrice,"1600", "$1,600");
addOption(document.drop_list.MinPrice,"1700", "$1,700");
addOption(document.drop_list.MinPrice,"1800", "$1,800");
addOption(document.drop_list.MinPrice,"1900", "$1,900");
addOption(document.drop_list.MinPrice,"2000", "$2,000");
addOption(document.drop_list.MinPrice,"2100", "$2,100");
addOption(document.drop_list.MinPrice,"2200", "$2,200");
addOption(document.drop_list.MinPrice,"2300", "$2,300");
addOption(document.drop_list.MinPrice,"2400", "$2,400");
addOption(document.drop_list.MinPrice,"2500", "$2,500");
addOption(document.drop_list.MinPrice,"2600", "$2,600");
addOption(document.drop_list.MinPrice,"2700", "$2,700");
addOption(document.drop_list.MinPrice,"2800", "$2,800");
addOption(document.drop_list.MinPrice,"2900", "$2,900");
addOption(document.drop_list.MinPrice,"3000", "$3,000");
addOption(document.drop_list.MinPrice,"3500", "$3,500");
addOption(document.drop_list.MinPrice,"4000", "$4,000");
addOption(document.drop_list.MinPrice,"4500", "$4,500");
addOption(document.drop_list.MinPrice,"5000", "$5,000");
addOption(document.drop_list.MinPrice,"6000", "$6,000");
addOption(document.drop_list.MinPrice,"7000", "$7,000");
addOption(document.drop_list.MinPrice,"8000", "$8,000");
addOption(document.drop_list.MinPrice,"9000", "$8,000");
addOption(document.drop_list.MinPrice,"10000", "$10,000");
addOption(document.drop_list.MinPrice,"15000", "$15,000");
addOption(document.drop_list.MinPrice,"20000", "$20,000");
addOption(document.drop_list.MinPrice,"30000", "$30,000");
addOption(document.drop_list.MaxPrice,"500", "$500");
addOption(document.drop_list.MaxPrice,"750", "$750");
addOption(document.drop_list.MaxPrice,"1000", "$1,000");
addOption(document.drop_list.MaxPrice,"1100", "$1,100");
addOption(document.drop_list.MaxPrice,"1200", "$1,200");
addOption(document.drop_list.MaxPrice,"1300", "$1,300");
addOption(document.drop_list.MaxPrice,"1400", "$1,400");
addOption(document.drop_list.MaxPrice,"1500", "$1,500");
addOption(document.drop_list.MaxPrice,"1600", "$1,600");
addOption(document.drop_list.MaxPrice,"1700", "$1,700");
addOption(document.drop_list.MaxPrice,"1800", "$1,800");
addOption(document.drop_list.MaxPrice,"1900", "$1,900");
addOption(document.drop_list.MaxPrice,"2000", "$2,000");
addOption(document.drop_list.MaxPrice,"2100", "$2,100");
addOption(document.drop_list.MaxPrice,"2200", "$2,200");
addOption(document.drop_list.MaxPrice,"2300", "$2,300");
addOption(document.drop_list.MaxPrice,"2400", "$2,400");
addOption(document.drop_list.MaxPrice,"2500", "$2,500");
addOption(document.drop_list.MaxPrice,"2600", "$2,600");
addOption(document.drop_list.MaxPrice,"2700", "$2,700");
addOption(document.drop_list.MaxPrice,"2800", "$2,800");
addOption(document.drop_list.MaxPrice,"2900", "$2,900");
addOption(document.drop_list.MaxPrice,"3000", "$3,000");
addOption(document.drop_list.MaxPrice,"3500", "$3,500");
addOption(document.drop_list.MaxPrice,"4000", "$4,000");
addOption(document.drop_list.MaxPrice,"4500", "$4,500");
addOption(document.drop_list.MaxPrice,"5000", "$5,000");
addOption(document.drop_list.MaxPrice,"6000", "$6,000");
addOption(document.drop_list.MaxPrice,"7000", "$7,000");
addOption(document.drop_list.MaxPrice,"8000", "$8,000");
addOption(document.drop_list.MaxPrice,"9000", "$8,000");
addOption(document.drop_list.MaxPrice,"10000", "$10,000");
addOption(document.drop_list.MaxPrice,"15000", "$15,000");
addOption(document.drop_list.MaxPrice,"20000", "$20,000");
addOption(document.drop_list.MaxPrice,"30000", "$30,000");
}
}
////////////////// 
function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}

function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}
