//////////////////////////////////////////////////////////////////////////////////////MATERIALS
function columns_menu(){ 
 // this function is used to fill the Capital list on load

addOption(document.drop_list.Capitals, "TU", "Tuscan", "");		
addOption(document.drop_list.Capitals, "GI", "Angular Greek Ionic", "");
addOption(document.drop_list.Capitals, "RD", "Decorative Roman Doric", "");
addOption(document.drop_list.Capitals, "EM", "Empire", "");
addOption(document.drop_list.Capitals, "RC", "Roman Corinthian", "");
addOption(document.drop_list.Capitals, "RI", "Roman Ionic", "");
addOption(document.drop_list.Capitals, "SC", "Scamozzi", "");
addOption(document.drop_list.Capitals, "TW", "Temple of Winds", "");
}


//////////////////////////////////////////////////////////////////////////////////////SHAFTS
function SelectShafts(){
// ON selection of Capitals this function will work

removeAllOptions(document.drop_list.Shafts);
addOption(document.drop_list.Shafts, "$$$$$", "Select a Shaft", "");

if(document.drop_list.Capitals.value == 'GI'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
if(document.drop_list.Capitals.value == 'RD'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
if(document.drop_list.Capitals.value == 'EM'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
if(document.drop_list.Capitals.value == 'RC'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
if(document.drop_list.Capitals.value == 'RI'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
if(document.drop_list.Capitals.value == 'SC'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
if(document.drop_list.Capitals.value == 'TW'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
if(document.drop_list.Capitals.value == 'TU'){
addOption(document.drop_list.Shafts,"NP", "Plain");
addOption(document.drop_list.Shafts,"NF", "Fluted");
}
}


//////////////////////////////////////////////////////////////////////////////////////BASES
function SelectBases(){
// ON selection of Shafts this function will work

removeAllOptions(document.drop_list.Bases);
addOption(document.drop_list.Bases, "$$$$", "Select a Base", "");

if(document.drop_list.Shafts.value == 'NP'){
addOption(document.drop_list.Bases,"AT", "Attic");
addOption(document.drop_list.Bases,"TS", "Tuscan");
}
if(document.drop_list.Shafts.value == 'NF'){
addOption(document.drop_list.Bases,"AT", "Attic");
addOption(document.drop_list.Bases,"TS", "Tuscan");
}
}


//////////////////////////////////////////////////////////////////////////////////////

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

