
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.form1.service, "Automatic Misting System", "Automatic Misting System", "");
addOption(document.form1.service, "Monthly Barrier System", "Monthly Barrier System", "");
addOption(document.form1.service, "Special Event Spraying", "Special Event Spraying", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.form1.budget);

if(document.form1.service.value == 'Automatic Misting System'){
addOption(document.form1.budget,"2,500 to 5,000", "2,500 to 5,000");
addOption(document.form1.budget,"5,000 to 10,000", "5,000 to 10,000");
addOption(document.form1.budget,"10,000 to 25,000", "10,000 to 25,000");
addOption(document.form1.budget,"Over 25,000", "Over 25,000");
}
if(document.form1.service.value == 'Monthly Barrier System'){
addOption(document.form1.budget,"$350 (< .25 acre)", "$350 (< .25 acre)");
addOption(document.form1.budget,"$425 (.25 to .5 acre)", "$425 (.25 to .5 acre)");
addOption(document.form1.budget,"$475 (.5 to .75 acre)", "$475 (.5 to .75 acre)");
addOption(document.form1.budget,"$525 (.75 to 1 acre)", "$525 (.75 to 1 acre)");
addOption(document.form1.budget,"$600 and up (> 1 acre)", "$600 and up (> 1 acre)");
}
if(document.form1.service.value == 'Special Event Spraying'){
addOption(document.form1.budget,"$75 - $150", "$75 - $150");
}

}









////////////////// 

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);
}
