
function fillCategory(){ 
 // this function is used to fill the rent_buy list on load
addOption(document.drop_list.rent_buy, "Renting", "Rent", "");
addOption(document.drop_list.rent_buy, "Buying", "Buy", "");
}

function fillCategory1(){ 
 
addOption(document.drop_list1.rent_buy, "Renting", "Rent", "");
addOption(document.drop_list1.rent_buy, "Buying", "Buy", "");
}

function SelectSubCat(){
// ON selection of rent_buy this function will work

removeAllOptions(document.drop_list.price_from);

if(document.drop_list.rent_buy.value == 'Renting'){
addOption(document.drop_list.price_from, "", "Price Per Week", "");
addOption(document.drop_list.price_from,"100 - 124", "100 - 124");
addOption(document.drop_list.price_from,"125 - 149", "125 - 149");
addOption(document.drop_list.price_from,"150 - 174", "150 - 174");
addOption(document.drop_list.price_from,"175 - 199", "175 - 199");
addOption(document.drop_list.price_from,"200 - 224", "200 - 224");
addOption(document.drop_list.price_from,"225 - 249", "225 - 249");
addOption(document.drop_list.price_from,"250 - 274", "250 - 274");
addOption(document.drop_list.price_from,"275 - 299", "275 - 299");
addOption(document.drop_list.price_from,"300 - 349", "300 - 349");
addOption(document.drop_list.price_from,"350 - 399", "350 - 399");
addOption(document.drop_list.price_from,"400 - 449", "400 - 449");
addOption(document.drop_list.price_from,"450 - 499", "450 - 499");
addOption(document.drop_list.price_from,"500 - 1500", "500+");


}
if(document.drop_list.rent_buy.value == 'Buying'){
addOption(document.drop_list.price_from, "", "Price", "");
addOption(document.drop_list.price_from,"0 - 100,000", "0 - 100,000");
addOption(document.drop_list.price_from,"100,001 - 150,000", "100,001 - 150,000");
addOption(document.drop_list.price_from,"151,000 - 200,000", "151,000 - 200,000");
addOption(document.drop_list.price_from,"201,000 - 300,000", "201,000 - 300,000");
addOption(document.drop_list.price_from,"301,000 - 400,000", "301,000 - 400,000");
addOption(document.drop_list.price_from,"401,000 - 500,000", "401,000 - 500,000");
}
}

function SelectSubCat1(){
// ON selection of rent_buy this function will work

removeAllOptions(document.drop_list1.price_from);


if(document.drop_list1.rent_buy.value == 'Renting'){
addOption(document.drop_list1.price_from, "", "Price Per Week", "");
addOption(document.drop_list1.price_from,"100 - 124", "100 - 124");
addOption(document.drop_list1.price_from,"125 - 149", "125 - 149");
addOption(document.drop_list1.price_from,"150 - 174", "150 - 174");
addOption(document.drop_list1.price_from,"175 - 199", "175 - 199");
addOption(document.drop_list1.price_from,"200 - 224", "200 - 224");
addOption(document.drop_list1.price_from,"225 - 249", "225 - 249");
addOption(document.drop_list1.price_from,"250 - 274", "250 - 274");
addOption(document.drop_list1.price_from,"275 - 299", "275 - 299");
addOption(document.drop_list1.price_from,"300 - 349", "300 - 349");
addOption(document.drop_list1.price_from,"350 - 399", "350 - 399");
addOption(document.drop_list1.price_from,"400 - 449", "400 - 449");
addOption(document.drop_list1.price_from,"450 - 499", "450 - 499");
addOption(document.drop_list1.price_from,"500 - 1500", "500+");


}
if(document.drop_list1.rent_buy.value == 'Buying'){
addOption(document.drop_list1.price_from, "", "Price", "");
addOption(document.drop_list1.price_from,"0 - 100,000", "0 - 100,000");
addOption(document.drop_list1.price_from,"100,001 - 150,000", "100,001 - 150,000");
addOption(document.drop_list1.price_from,"151,000 - 200,000", "151,000 - 200,000");
addOption(document.drop_list1.price_from,"201,000 - 300,000", "201,000 - 300,000");
addOption(document.drop_list1.price_from,"301,000 - 400,000", "301,000 - 400,000");
addOption(document.drop_list1.price_from,"401,000 - 500,000", "401,000 - 500,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);
}
