var Option = {
getValue: function(self) {
if (self) return (self.attributes.value || {}).specified ? self.value : self.text;
}
};
var Select = {
getValue: function(self) {
if (self) {
if (self.type == 'select-one') return Option.getValue(self.options[self.selectedIndex]);
for (var result = [], optionValue = Option.getValue, options = self.options, i = 0, length = options.length; i < length; i++) {
if (options[i].selected) result[result.length] = optionValue(options[i]);
}
return result;
}
}
};