
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.searchForm.dbt, "1", "buy", "");
addOption(document.searchForm.dbt, "2", "let", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.searchForm.lop);
removeAllOptions(document.searchForm.hip);

if(document.searchForm.dbt.value == '1'){
addOption(document.searchForm.lop,"50000", "£50,000");
addOption(document.searchForm.lop,"100000", "£100,000");
addOption(document.searchForm.lop,"150000", "£150,000");
addOption(document.searchForm.lop,"200000", "£200,000");
addOption(document.searchForm.lop,"250000", "£250,000");
addOption(document.searchForm.lop,"300000", "£300,000");
addOption(document.searchForm.lop,"350000", "£350,000");
addOption(document.searchForm.lop,"400000", "£400,000");
addOption(document.searchForm.lop,"450000", "£450,000");
addOption(document.searchForm.lop,"500000", "£500,000");
addOption(document.searchForm.lop,"600000", "£600,000");
addOption(document.searchForm.lop,"700000", "£700,000");
addOption(document.searchForm.lop,"800000", "£800,000");
addOption(document.searchForm.lop,"900000", "£900,000");
addOption(document.searchForm.lop,"1000000", "£1,000,000");
addOption(document.searchForm.hip,"100000", "£100,000");
addOption(document.searchForm.hip,"150000", "£150,000");
addOption(document.searchForm.hip,"200000", "£200,000");
addOption(document.searchForm.hip,"250000", "£250,000");
addOption(document.searchForm.hip,"300000", "£300,000");
addOption(document.searchForm.hip,"350000", "£350,000");
addOption(document.searchForm.hip,"400000", "£400,000");
addOption(document.searchForm.hip,"450000", "£450,000");
addOption(document.searchForm.hip,"500000", "£500,000");
addOption(document.searchForm.hip,"600000", "£600,000");
addOption(document.searchForm.hip,"700000", "£700,000");
addOption(document.searchForm.hip,"800000", "£800,000");
addOption(document.searchForm.hip,"900000", "£900,000");
addOption(document.searchForm.hip,"1000000", "£1,000,000");
addOption(document.searchForm.hip,"9999999", "£1,000,000+");
}
if(document.searchForm.dbt.value == '2'){
addOption(document.searchForm.lop,"0", "£0 p.w.");
addOption(document.searchForm.lop,"50", "£50 p.w.");
addOption(document.searchForm.lop,"100", "£100 p.w.");
addOption(document.searchForm.lop,"150", "£150 p.w.");
addOption(document.searchForm.lop,"200", "£200 p.w.");
addOption(document.searchForm.lop,"250", "£250 p.w.");
addOption(document.searchForm.lop,"300", "£300 p.w.");
addOption(document.searchForm.lop,"350", "£350 p.w.");
addOption(document.searchForm.lop,"400", "£400 p.w.");
addOption(document.searchForm.lop,"450", "£450 p.w.");
addOption(document.searchForm.lop,"500", "£500 p.w.");
addOption(document.searchForm.lop,"700", "£700 p.w.");
addOption(document.searchForm.lop,"900", "£900 p.w.");
addOption(document.searchForm.lop,"1000", "£1,000 p.w.");
addOption(document.searchForm.lop,"2000", "£2,000 p.w.");
addOption(document.searchForm.lop,"9999", "£2,500+ p.w.");
addOption(document.searchForm.hip,"0", "£0 p.w.");
addOption(document.searchForm.hip,"50", "£50 p.w.");
addOption(document.searchForm.hip,"100", "£100 p.w.");
addOption(document.searchForm.hip,"150", "£150 p.w.");
addOption(document.searchForm.hip,"200", "£200 p.w.");
addOption(document.searchForm.hip,"250", "£250 p.w.");
addOption(document.searchForm.hip,"300", "£300 p.w.");
addOption(document.searchForm.hip,"350", "£350 p.w.");
addOption(document.searchForm.hip,"400", "£400 p.w.");
addOption(document.searchForm.hip,"450", "£450 p.w.");
addOption(document.searchForm.hip,"500", "£500 p.w.");
addOption(document.searchForm.hip,"700", "£700 p.w.");
addOption(document.searchForm.hip,"900", "£900 p.w.");
addOption(document.searchForm.hip,"1000", "£1,000 p.w.");
addOption(document.searchForm.hip,"2000", "£2,000 p.w.");
addOption(document.searchForm.hip,"9999", "£2,500+ p.w.");
}

}
////////////////// 

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);
}

