 
 class CC
   constructor: ->
+    @firefoxVersion = -1 != navigator.userAgent.indexOf "Firefox"
+    @ieVersion =
+      if navigator.appName == 'Microsoft Internet Explorer'
+        re  = /MSIE ([0-9]{1,}[\.0-9]{0,})/
+        if re.exec navigator.userAgent
+          parseFloat RegExp.$1
+        else 0
+      else 0
+    # alert "firefox: #{@firefoxVersion}, ie: #{@ieVersion}"
     @libpath = 'lib'
     @modules = {}
     @global = window

    lastComp = components[components.length - 1]
    obj[lastComp] = val

  # loads a script into the head of the browser and call success/error callbacks
  loadScript: (path, onload, onerror) ->
    script = document.createElement 'script'

    script.type = 'text/javascript'

    if ('file:' == document.location?.protocol and
        -1 != navigator.userAgent.indexOf("Firefox"))
      # firefox can't catch onerror for files so set a timer
      loaded = false
      script.onload = ->
        loaded = true
        do onload if onload

      setTimeout(
        -> do onerror unless loaded
        2000)

      false
    else
      script.onload = onload if onload
      script.onerror = onerror if onerror
      # in firefox onerror doesn't fire when loading files so schedule a
      # timer to check the file has loaded
      # load via ajax and set text

    script.src = path
    @head.appendChild script

      null
      # ->
      #   # success handler
      #   alert "loaded #{mod.name}"
      ->
        mod.status = 'failed'
        if callback
