document.observe("dom:loaded", function () { var selectIds = ["ring_size", "bracelet_size", "chain_size"]; selectIds.forEach(function (multiSelectId) { var multiSelect = $$("#"+multiSelectId).first(); if (typeof (multiSelect) != 'undefined') { selectAllOptions(multiSelect); } }); }); function selectAllOptions(obj) { for (var i=0; i