function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "ACT", "ACT", "");
addOption(document.drop_list.Category, "NSW", "NSW", "");
addOption(document.drop_list.Category, "NT", "NT", "");
addOption(document.drop_list.Category, "QLD", "QLD", "");
addOption(document.drop_list.Category, "SA", "SA", "");
addOption(document.drop_list.Category, "TAS", "TAS", "");
addOption(document.drop_list.Category, "VIC", "VIC", "");
addOption(document.drop_list.Category, "WA", "WA", "");
}

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

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Select Location", "");

if(document.drop_list.Category.value == 'ACT'){
addOption(document.drop_list.SubCat,"Canberra & Surrounds", "Canberra & Surrounds");
}

if(document.drop_list.Category.value == 'NSW'){
addOption(document.drop_list.SubCat,"North Coast", "North Coast");
addOption(document.drop_list.SubCat,"Hunter", "Hunter");
addOption(document.drop_list.SubCat,"Sydney", "Sydney");
addOption(document.drop_list.SubCat,"South Coast", "South Coast");
addOption(document.drop_list.SubCat,"Inland", "Inland");
}

if(document.drop_list.Category.value == 'NT'){
addOption(document.drop_list.SubCat,"Red Centre", "Red Centre");
addOption(document.drop_list.SubCat,"Darwin", "Darwin");
}

if(document.drop_list.Category.value == 'QLD'){
addOption(document.drop_list.SubCat,"North Queensland", "North Queensland");
addOption(document.drop_list.SubCat,"Sunshine Coast", "Sunshine Coast");
addOption(document.drop_list.SubCat,"Brisbane", "Brisbane");
addOption(document.drop_list.SubCat,"South Coast", "South Coast");
addOption(document.drop_list.SubCat,"Gold Coast", "Gold Coast");
}

if(document.drop_list.Category.value == 'SA'){
addOption(document.drop_list.SubCat,"Adelaide", "Adelaide");
addOption(document.drop_list.SubCat,"Wine Areas", "Wine Areas");
addOption(document.drop_list.SubCat,"Islands", "Islands");
}

if(document.drop_list.Category.value == 'TAS'){
addOption(document.drop_list.SubCat,"Hobart & Surrounds", "Hobart & Surrounds");
addOption(document.drop_list.SubCat,"East Coast", "East Coast");
addOption(document.drop_list.SubCat,"West Coast", "West Coast");
}

if(document.drop_list.Category.value == 'VIC'){
addOption(document.drop_list.SubCat,"Melbourne", "Melbourne");
addOption(document.drop_list.SubCat,"Murray River", "Murray River");
addOption(document.drop_list.SubCat,"Inland Victoria", "Inland Victoria");
addOption(document.drop_list.SubCat,"Scenic South Coast", "Scenic South Coast");
}

if(document.drop_list.Category.value == 'WA'){
addOption(document.drop_list.SubCat,"Perth", "Perth");
addOption(document.drop_list.SubCat,"Margaret River", "Margaret River");
addOption(document.drop_list.SubCat,"South West Beaches", "South West Beaches");
addOption(document.drop_list.SubCat,"True North", "True North");
}
}
////////////////// 

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);
}
