     {createButton}        = @subDomainEntryForm.buttons
     domainName            = domainName.getValue()
 
-    # Test given subdomain
+    # Check given subdomain
     unless subDomainPattern.test domainName
       createButton.hideLoader()
       return notifyUser "#{domainName} is an invalid subdomain."

    @newDomainPane = new KDTabPaneView { name : "NewDomain" }
    @newDomainPane.addSubView @newDomainEntryForm = new DomainBuyForm
    @tabs.addPane @newDomainPane
    @newDomainEntryForm.on 'registerDomain', @bound 'registerNewDomain'

    @subDomainPane = new KDTabPaneView { name : "SubDomain" }
    @subDomainPane.addSubView @subDomainEntryForm = new SubDomainCreateForm
    @subDomainEntryForm.on 'registerDomain', @bound 'createSubDomain'
    @tabs.addPane @subDomainPane

  registerNewDomain: ->
    {createButton}        = @newDomainEntryForm.buttons
    {domains, domainName} = @newDomainEntryForm.inputs
    domainName            = "#{domainName.getValue()}.#{domains.getValue()}"

  subDomainPattern = \
    /^([a-z0-9]([_\-](?![_\-])|[a-z0-9]){0,60}[a-z0-9]|[a-z0-9])$/

  domainOptions = [
    { title : "Create A Subdomain",     value : "subdomain" }
    { title : "Register New Domain",    value : "new"}
    { title : "Use An Existing Domain", value : "existing", disabled : yes }
  ]

  constructor:(options = {}, data)->
    options.cssClass = "environments-add-domain-form"
    super options, data

    @addSubView @header = new KDHeaderView
      title             : "Add a domain"

