 
     # re-populate the ancestor with new children
     # and CSS classes
-    classes = ['first', 'second']
     for div, i in divs
-      div.className = "chattifier " + classes[i % 2]
+      div.className = [
+        Chattifier.cssAttrs.mainClass,
+        Chattifier.cssAttrs.alternatingClasses[i % 2]
+      ].join " "
       @ancestorNode.appendChild div
 
   # creates a new stylesheet for color encoding of the

    style.appendChild document.createTextNode ""
    document.head.appendChild style

    style.sheet.insertRule "div.chattifier { margin: 2px; display: block; }", 0
    colors = ['#FFF', '#F4F4F4']
    classes = ['first', 'second']
    for cl, i in classes
      clStyle = ".chattifier." + cl + " { background-color: " + colors[i] + "; }"
      style.sheet.insertRule clStyle, 0


module.exports = Chattifier


class Chattifier
  @headerStartLevel = 4
  @cssAttrs = {
    mainClass: "chattifier",
    alternatingClasses: ["first", "second"],
    alternatingColors: ['#FFF', '#F4F4F4']
  }

  constructor: ->
    @ancestorNode = null
