max && select['x-selected']) { selected = select['x-selected']; for (var i = 0; i < select.options.length; i++) { select.options[i].selected = false; for (var j = 0; j < selected.length; j++) { if (select.options[i].value == selected[j]) { select.options[i].selected = true; break; } } } } } select['x-selected'] = selected; var varAttr = select.getAttribute("x-var"); if (varAttr) { if (opensocial.data) { opensocial.data.getDataContext().putDataSet(varAttr, selected); } } var onSelect = select.getAttribute("x-onselect"); if (onSelect) { if (window[onSelect] && typeof(window[onSelect]) == 'function') { window[onSelect](selected); } else { if (!select['x-onselect-fn']) { select['x-onselect-fn'] = new Function(onSelect); } select['x-onselect-fn'].apply(select); } } } ]]>