options += '<option value="' + key + '" '+((val == selected)?'selected=selected':'')+'>' + val + '</option>';