
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.festivalStrandId, "1", "Outdoor Stages");
addOption(document.drop_list.festivalStrandId, "2", "Fringe Venues");
addOption(document.drop_list.festivalStrandId, "3", "Band Together");
}

function SelectDay(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.festivalDay);
addOption(document.drop_list.festivalDay, "Select a day", "Select a day");

if(document.drop_list.festivalStrandId.value == '1'){
addOption(document.drop_list.festivalDay,"2011-8-28", "Sunday 28th");
addOption(document.drop_list.festivalDay,"2011-8-29", "Monday 29th");
}
if(document.drop_list.festivalStrandId.value == '2'){
addOption(document.drop_list.festivalDay,"2011-8-26", "Friday 26th");
addOption(document.drop_list.festivalDay,"2011-8-27", "Saturday 27th");
addOption(document.drop_list.festivalDay,"2011-8-28", "Sunday 28th");
addOption(document.drop_list.festivalDay,"2011-8-29", "Monday 29th");
}
if(document.drop_list.festivalStrandId.value == '3'){
addOption(document.drop_list.festivalDay,"2011-8-28", "Sunday 28th");
addOption(document.drop_list.festivalDay,"2011-8-29", "Monday 29th");
}
}
////////////////// 

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);
}

