var levels = new Array(); levels.push(new Array($A(["mous", "opti", "pico", "funb", "topa", "dart", "class", "f317j", "f317s", "pav"]), 'Débutant', 'beginner')); levels.push(new Array($A(["opti", "pico", "funb", "topa", "dart", "pav"]), 'Initiation', 'intermediate')); levels.push(new Array($A(["opti", "pico", "funb", "topa", "dart", "pav"]), 'Perfectionnement', 'perf')); levels.push(new Array($A(["catp"]), 'Après perfectionnement', 'after_perf')); levels.push(new Array($A(["class", "f317j", "f317s"]), 'Confirmé', 'pro')); function activitySelected() { activity_value = $('search_activity').getValue(); options = $('search_level').options; options.length = 1; levels.each(function(level) { if (level[0].indexOf(activity_value) != -1) { options[options.length] = new Option(level[1], level[2]); } }); } document.observe('dom:loaded', function() { $('search_activity').observe('change', activitySelected); });