function select_item(list1,list2) {

	var flag_tous_liste2 = 0;

	for (var i = 0; i < list2.options.length; i++) {

		if (list2.options[i].value == 0) {
			flag_tous_liste2 = 1;
			break;
		}
	}

	if (flag_tous_liste2 == 0) {

		var flagSelect = new Array();
		var sortie = 0;

		for (var i = 1; i < list1.options.length; i++) {

			if (list1.options[i].selected) {
				flagSelect[flagSelect.length] = list1.options[i];
			}
		}

		if (list1.options[0].selected && flagSelect.length > 0) {
			sortie = 1;
		} else if (list1.options[0].selected) {
			list2.options.length = 0;	
			flagSelect[flagSelect.length] = list1.options[0];
		}

		if (sortie == 0) {

			for (var i = 0; i < flagSelect.length; i++) {

				var dejaListe = 0;	
				for (var j = 0; j < list2.length; j++ ) {

					if (list2.options[j].value == flagSelect[i].value) {
						dejaListe = 1;
						break;
					}
				}			

				if (!dejaListe)	{		
					monoption = new Option(flagSelect[i].text, flagSelect[i].value);
					list2.options[list2.length] = monoption;                 
					list2.selectedIndex = 0;
				}
			}
		}
	}
}

function remove_item(list1, list2) {
	var tabElement = new Array();
	for (var i = 0; i < list2.options.length; i++) {
		if (!list2.options[i].selected) {
			tabElement[tabElement.length] = list2.options[i];
		}	
	}
	list2.options.length = 0;
	for (var i = 0; i < tabElement.length; i++) {
		monoption = new Option(tabElement[i].text, tabElement[i].value);
		list2.options[list2.length] = monoption;                 
	}
	list2.selectedIndex = 0;
}

function select_item_from0(list1,list2) {

	var flagSelect = new Array();
    var sortie = 0;

    for (var i = 0; i < list1.options.length; i++) {

        if (list1.options[i].selected) {
            flagSelect[flagSelect.length] = list1.options[i];
        }
    }

    for (var i = 0; i < flagSelect.length; i++) {

        var dejaListe = 0;

        for (var j = 0; j < list2.length; j++ ) {

            if (list2.options[j].value == flagSelect[i].value) {
                dejaListe = 1;
                break;
            }
        }

        if (!dejaListe)	{
            monoption = new Option(flagSelect[i].text, flagSelect[i].value);
            list2.options[list2.length] = monoption;
            list2.selectedIndex = 0;
        }
    }
}