if(!tc){ var tc = {}; }
  
  tc.contact = function(app,options){
    var _me = this;
    
    this.initialize = function(){
      tc.util.log('contact.initialize');
      
      _me.glossary_contact_visible = false;
      _me.general_contact_visible = false;
      
      app.Y.on('mail-sent',function(){
        if(_me.glossary_contact_visible){
          _me.glossary_overlay.set('bodyContent','<p>Thank you for your inquiry!</p>');
          setTimeout('app.Y.fire("hide-contact-form");',1000);
        }
        if(_me.general_contact_visible){
          _me.contact_overlay.set('bodyContent','<p>Thank you for your inquiry!</p>');
          setTimeout('app.Y.fire("hide-contact-form");',1000);
        }
      });
      
      app.Y.on('hide-contact-form',function(){
        if(_me.glossary_contact_visible){
          _me.glossary_overlay.hide();
          _me.glossary_contact_visible = false;
        }
        if(_me.general_contact_visible){
          _me.contact_overlay.hide();
          _me.general_contact_visible = false;
        }
      });
      
      _me.glossary_overlay = new Y.Overlay({
        srcNode:'#glossary_contact_overlay',
        zIndex:99,
        visible: false,
        plugins: [ 
          Y.Plugin.OverlayModal,
          Y.Plugin.OverlayKeepaligned,
          { fn: Y.Plugin.OverlayAutohide,
            cfg: {focusedOutside : false}
          }
        ]
      });
      _me.glossary_overlay.render();
      app.Y.one('#glossary_contact_overlay').show().on('click',function(e){e.stopPropagation()});
      _me.glossary_overlay.on('click',function(e){_me.glossary_overlay.hide();});
      
      _me.contact_overlay = new Y.Overlay({
        srcNode:'#general_contact_overlay',
        zIndex:99,
        visible: false,
        plugins: [ 
          Y.Plugin.OverlayModal,
          Y.Plugin.OverlayKeepaligned,
          { fn: Y.Plugin.OverlayAutohide,
            cfg: {focusedOutside : false}
          }
        ]
      });
      _me.contact_overlay.render();
      app.Y.one('#general_contact_overlay').show().on('click',function(e){e.stopPropagation()});
      _me.contact_overlay.on('click',function(e){_me.contact_overlay.hide();});
      
      Y.all('a.glossary_contact').on('click', function(e){
        if(e.preventDefault) e.preventDefault();
        e.returnValue = false;
        _me.glossary_contact_visible = true;
        _me.glossary_overlay.show();
      });
      
      Y.all('a.general_contact').on('click', function(e){
        if(e.preventDefault) e.preventDefault();
        e.returnValue = false;
        _me.general_contact_visible = true;
        _me.contact_overlay.show();
      });
      
      return _me;
    }
    
    return this.initialize();
  }
