def class_for_element( tag_type, attributes )
case tag_type
when :a then Link
when :form then Form
when :img then Image
when :textarea then Text
when :select then
if attributes[:multiple] or attributes.key?(:size) then
Browser
else
Popup
end
when :input then
unless attributes[:type] then
return TextField
end
case attributes[:type].downcase
when 'text' then TextField
when 'password' then TextField
when 'hidden' then TextField
when 'checkbox' then Checkbox
when 'radio' then Radio
when 'submit' then Submit
when 'reset' then Reset
when 'file' then Upload
else
TextField
end
end
end