
function fillCategory(){ 
addOption(document.Search.listing_type, "Sale", "Sales", "");
addOption(document.Search.listing_type, "Rental", "Rentals", "");
}

function SelectSubCat(){
removeAllOptions(document.Search.pricemin);
removeAllOptions(document.Search.pricemax);
addOption(document.Search.pricemin, "%", "pricemin", "");
addOption(document.Search.pricemax, "%", "pricemax", "");

if(document.Search.listing_type.value == 'Sale'){       //display, value//
//addOption(document.Search.pricemin,"%", "ALL");
addOption(document.Search.pricemin,"200000", "200k");
addOption(document.Search.pricemin,"300000","300k");
addOption(document.Search.pricemin,"400000","400k");
addOption(document.Search.pricemin,"500000","500k");
addOption(document.Search.pricemin,"600000","600k");
addOption(document.Search.pricemin,"700000","700k");
addOption(document.Search.pricemin,"800000","800k");
addOption(document.Search.pricemin,"900000","900k");
addOption(document.Search.pricemin,"1000000","1M");
addOption(document.Search.pricemin,"1250000","1.25M");
addOption(document.Search.pricemin,"1500000","1.5M");
addOption(document.Search.pricemin,"1750000","1.75M");
addOption(document.Search.pricemin,"2000000","2M");
addOption(document.Search.pricemin,"2250000","2.25M");
addOption(document.Search.pricemin,"2500000","2.5M");
addOption(document.Search.pricemin,"2750000","2.75M");
addOption(document.Search.pricemin,"3000000","3M");
addOption(document.Search.pricemin,"3250000","3.25M");
addOption(document.Search.pricemin,"3500000","3.5M");
addOption(document.Search.pricemin,"3750000","3.75M");
addOption(document.Search.pricemin,"4000000","4M");
addOption(document.Search.pricemin,"4250000","4.25M");
addOption(document.Search.pricemin,"4500000","4.5M");
addOption(document.Search.pricemin,"4750000","4.75M");
addOption(document.Search.pricemin,"5000000","5M");
addOption(document.Search.pricemin,"5500000","5.5M");
addOption(document.Search.pricemin,"6000000","6M");
addOption(document.Search.pricemin,"5500000","5.5M");
addOption(document.Search.pricemin,"7000000","7M");
addOption(document.Search.pricemin,"7500000","7.5M");
addOption(document.Search.pricemin,"8000000","8M");
addOption(document.Search.pricemin,"8500000","8.5M");
addOption(document.Search.pricemin,"9000000","9M");
addOption(document.Search.pricemin,"10000000","10M");
addOption(document.Search.pricemin,"15000000","15M");
addOption(document.Search.pricemin,"20000000","20M");
//addOption(document.Search.pricemax,"%", "ALL");
addOption(document.Search.pricemax,"300000","300k");
addOption(document.Search.pricemax,"400000","400k");
addOption(document.Search.pricemax,"500000","500k");
addOption(document.Search.pricemax,"600000","600k");
addOption(document.Search.pricemax,"700000","700k");
addOption(document.Search.pricemax,"800000","800k");
addOption(document.Search.pricemax,"900000","900k");
addOption(document.Search.pricemax,"1000000","1M");
addOption(document.Search.pricemax,"1250000","1.25M");
addOption(document.Search.pricemax,"1500000","1.5M");
addOption(document.Search.pricemax,"1750000","1.75M");
addOption(document.Search.pricemax,"2000000","2M");
addOption(document.Search.pricemax,"2250000","2.25M");
addOption(document.Search.pricemax,"2500000","2.5M");
addOption(document.Search.pricemax,"2750000","2.75M");
addOption(document.Search.pricemax,"3000000","3M");
addOption(document.Search.pricemax,"3250000","3.25M");
addOption(document.Search.pricemax,"3500000","3.5M");
addOption(document.Search.pricemax,"3750000","3.75M");
addOption(document.Search.pricemax,"4000000","4M");
addOption(document.Search.pricemax,"4250000","4.25M");
addOption(document.Search.pricemax,"4500000","4.5M");
addOption(document.Search.pricemax,"4750000","4.75M");
addOption(document.Search.pricemax,"5000000","5M");
addOption(document.Search.pricemax,"5500000","5.5M");
addOption(document.Search.pricemax,"6000000","6M");
addOption(document.Search.pricemax,"5500000","5.5M");
addOption(document.Search.pricemax,"7000000","7M");
addOption(document.Search.pricemax,"7500000","7.5M");
addOption(document.Search.pricemax,"8000000","8M");
addOption(document.Search.pricemax,"8500000","8.5M");
addOption(document.Search.pricemax,"9000000","9M");
addOption(document.Search.pricemax,"10000000","10M");
addOption(document.Search.pricemax,"15000000","15M");
addOption(document.Search.pricemax,"20000000","20M");
addOption(document.Search.pricemax,"200000000","20M+");
}
if(document.Search.listing_type.value == 'Rental'){
//addOption(document.Search.pricemin,"%", "ALL");
addOption(document.Search.pricemin,"1000", "1k");
addOption(document.Search.pricemin,"2000", "2k");
addOption(document.Search.pricemin,"3000", "3k");
addOption(document.Search.pricemin,"4000", "4k");
addOption(document.Search.pricemin,"5000", "5k");
addOption(document.Search.pricemin,"6000", "6k");
addOption(document.Search.pricemin,"7000", "7k");
addOption(document.Search.pricemin,"8000", "8k");
addOption(document.Search.pricemin,"9000", "9k");
addOption(document.Search.pricemin,"10000", "10k");
addOption(document.Search.pricemin,"12500", "12.5k");
addOption(document.Search.pricemin,"15000", "15k");
addOption(document.Search.pricemin,"17500", "17.5k");
addOption(document.Search.pricemin,"20000", "20k");
addOption(document.Search.pricemin,"25000", "25k");
//addOption(document.Search.pricemax,"%", "ALL");
addOption(document.Search.pricemax,"2000", "2k");
addOption(document.Search.pricemax,"3000", "3k");
addOption(document.Search.pricemax,"4000", "4k");
addOption(document.Search.pricemax,"5000", "5k");
addOption(document.Search.pricemax,"6000", "6k");
addOption(document.Search.pricemax,"7000", "7k");
addOption(document.Search.pricemax,"8000", "8k");
addOption(document.Search.pricemax,"9000", "9k");
addOption(document.Search.pricemax,"10000", "10k");
addOption(document.Search.pricemax,"12500", "12.5k");
addOption(document.Search.pricemax,"15000", "15k");
addOption(document.Search.pricemax,"17500", "17.5k");
addOption(document.Search.pricemax,"20000", "20k");
addOption(document.Search.pricemax,"25000", "25k");
addOption(document.Search.pricemax,"100000", "25k+");
}
}
function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		selectbox.remove(i);
	}
}
function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}
function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;	
	optn.value = value;
	selectbox.options.add(optn);
}


