
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "US", "an American citizen", "");
addOption(document.drop_list.Category, "FR", "a French citizen", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "I want to...", "");

if(document.drop_list.Category.value == 'US'){
addOption(document.drop_list.SubCat,"http://www.franceintheus.org/spip.php?article1669&xtor=AL-15", "invest in France");
addOption(document.drop_list.SubCat,"http://www.franceintheus.org/spip.php?rubrique103&xtor=AL-15", "work in France");
addOption(document.drop_list.SubCat,"http://www.franceintheus.org/spip.php?rubrique104&xtor=AL-15", "study or teach in France");
addOption(document.drop_list.SubCat,"http://www.franceintheus.org/spip.php?article373&xtor=AL-15", "learn French");
addOption(document.drop_list.SubCat,"http://www.franceintheus.org/spip.php?article1670&xtor=AL-15", "intern at the Embassy");
addOption(document.drop_list.SubCat,"http://www.franceintheus.org/spip.php?article422&xtor=AL-15", "learn about French taxes");
}
if(document.drop_list.Category.value == 'FR'){
addOption(document.drop_list.SubCat,"http://fr.ambafrance-us.org/spip.php?article2477&xtor=AL-3", "visit the White House");
addOption(document.drop_list.SubCat,"http://www.consulfrance-washington.org/spip.php?rubrique156", "renew or report the lost of my passport");
addOption(document.drop_list.SubCat,"http://www.consulfrance-newyork.org/Elections-2012-C-est-decide-je-m", "Vote in 2012");
addOption(document.drop_list.SubCat,"http://www.consulfrance-washington.org/spip.php?article257", "register at the Consulate");
}

}
////////////////// 

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);
}

