

function init_nav_choice(selected_value) {
	var names_array = new Array();
	var ids_array = new Array();
	
	var index = 0;
	objChoice = document.getElementById("navChoice");
	
	for(var i = 0; i < objChoice.options.length; i++){
		optionSelected = false;
		if(objChoice[i].value == selected_value ){
			optionSelected = true;
		}
		objChoice[i].selected = optionSelected;
	}
}

function init_nav_content(selected_value) {
	var names_array = new Array();
	var ids_array = new Array();
	
	objChoice = document.getElementById("navChoice");
	objContent = document.getElementById("navContent");
	objContent.length = 0;
	
	select_value = objChoice.value;
	var nb_filters = 0;
		
	if(select_value == 1){
		names_array = cat_display;
		ids_array = cat_ids;
		objContent.options[nb_filters] = new Option("Toutes", 0);
		nb_filters++;
	}
	if(select_value == 2){
		names_array = editor_display;
		ids_array = editor_ids;
		objContent.options[nb_filters] = new Option("Tous", 0);
		nb_filters++;
	}
	
	for(var i in ids_array){
		optionName = names_array[i];
		optionValue = ids_array[i];
		optionSelected = false;
		
		if (optionValue == selected_value) {
			optionSelected = true;
		}
		
		objContent.options[nb_filters] = new Option(optionName, optionValue);
		objContent.options[nb_filters].selected = optionSelected;
		
		nb_filters++;
	}
	objContent.length = nb_filters;
}

function navHandle(){
	var urlParam = document.getElementById("catNavigationUrlParam");
	var objForm = document.getElementById("catNavigationCombosForm");
	var objContent = document.getElementById("navContent");
	var objChoice = document.getElementById("navChoice");
	
	var choiceSelIndex = objChoice.selectedIndex ;
	var contentSelIndex = objContent.selectedIndex ;
	if(objChoice.options[choiceSelIndex].value == 1)
		urlParam.name = "ic";
	if(objChoice.options[choiceSelIndex].value == 2)
		urlParam.name = "ia";	
	urlParam.value = objContent.options[contentSelIndex].value;
	
	objForm.submit();
}