
function fillCategory()
{ 
 // this function is used to fill the category list on load
addOption(document.drop_list.type, "Normal Free Standing", "Normal Free Standing", "");
addOption(document.drop_list.type, "Stackable", "Stackable", "");
addOption(document.drop_list.type, "Pedestal Type", "Pedestal Type", "");

removeAllOptions(document.drop_list.exdir);
removeAllOptions(document.drop_list.framing);
//addOption(document.drop_list.exdir, "", "", "");
//addOption(document.drop_list.framing, "", "", "");
}

function SelectExDir()
{
// ON selection of category this function will work

removeAllOptions(document.drop_list.exdir);
addOption(document.drop_list.exdir, "", "Exhaust Direction", "");

if(document.drop_list.type.value == 'Normal Free Standing')
{
addOption(document.drop_list.exdir,"Upward", "Upward");
addOption(document.drop_list.exdir,"Downward", "Downward");
addOption(document.drop_list.exdir,"Side or Rear", "Side or Rear");
}
if(document.drop_list.type.value == 'Stackable')
{
addOption(document.drop_list.exdir,"Upward", "Upward");
addOption(document.drop_list.exdir,"Downward", "Downward");
addOption(document.drop_list.exdir,"Side or Rear", "Side or Rear");
}
if(document.drop_list.type.value == 'Pedestal Type')
{
addOption(document.drop_list.exdir,"Upward", "Upward");
addOption(document.drop_list.exdir,"Downward", "Downward");
addOption(document.drop_list.exdir,"Side or Rear", "Side or Rear");
}

}
////////////////// 

function SelectFraming()
{
// ON selection of category this function will work

removeAllOptions(document.drop_list.framing);
addOption(document.drop_list.framing, "", "Framing Depth", "");

if ((document.drop_list.type.value == 'Normal Free Standing') && (document.drop_list.exdir.value == 'Downward'))
	{
	addOption(document.drop_list.framing,"2x4", "2x4");
	addOption(document.drop_list.framing,"2x6", "2x6");
	addOption(document.drop_list.framing,"2x4 with firring strip", "2x4 with firring strip");	
	}
	else	
	{
	addOption(document.drop_list.framing,"2x4", "2x4");
	addOption(document.drop_list.framing,"2x6", "2x6");
	addOption(document.drop_list.framing,"2x4 with firring strip", "2x4 with firring strip");
	addOption(document.drop_list.framing,"Drywalled existing construction", "Drywalled existing construction");
	}
}

////////////////// 


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);
}
