# File app/helpers/smerf_forms_helper.rb, line 134
  def smerf_group_question(question, level = 1)
    contents = ""
    # Format question header 
    contents += content_tag(:div, content_tag(:p, question.header), 
      :class => "smerfQuestionHeader") if (question.header and !question.header.blank?) 
    # Format question  
    contents += content_tag(:div, content_tag(:p, question.question), 
      :class => (level <= 1) ? "smerfQuestion" : "smerfSubquestion") if (question.question and !question.question.blank?) 
    # Format error
    contents += content_tag(:div, 
      content_tag(:p, "#{image_tag("smerf_error.gif", :alt => "Error")} #{@errors["#{question.object_ident}"]["msg"]}"), 
      :class => "smerfQuestionError") if (@errors and @errors.has_key?("#{question.object_ident}"))    
    # Format help   
    contents += content_tag(:div, 
      content_tag(:p, "#{image_tag("smerf_help.gif", :alt => "Help")} #{question.help}"), 
      :class => "smerfInstruction") if (!question.help.blank?)    
   
    # Check the type and format appropriatly
    case question.type
    when 'multiplechoice'
      contents += get_multiplechoice(question, level)
    when 'textbox'
      contents += get_textbox(question)
    when 'textfield'
      contents += get_textfield(question)
    when 'singlechoice'
      contents += get_singlechoice(question, level)
    when 'selectionbox'
      contents += get_selectionbox(question, level)
    else  
      raise("Unknown question type for question: #{question.question}")
    end
    # Draw a line to indicate the end of the question if level 1, 
    # i.e. not an answer sub question
    contents += content_tag(:div, "", :class => "questionbox") if (!contents.blank? and level <= 1)
    return contents   
  end