var pochta_qip_notify = new function(){
  this.fn_close = function(){
    $('popup_content1').show();
    $('popup_content2').hide();
    $('facebox').hide();
    $('facebox_overlay').hide();
  }
  this.fn_open = function(){
    $('popup_content2').show();
    $('popup_content1').hide();
    $('facebox').show();
    $('facebox_overlay').show();
    $('info_message').value='';
  }
  this.fn_send = function(){
    if( ! $F('info_message') )
      return;
    $('popup_content1').show();
    $('popup_content2').hide();
    new Ajax.Request('/mailbox/act/sendinfo', {
      method: 'get',
      parameters: { text: $F('info_message'), to: 'gornal@pochta.ru' }
    });
    setTimeout( function(me){ if( me ) me.fn_close(); else this.fn_close(); }, 2000, this );
  }
  this.init = function()
  {
   Event.observe( $('bcancel'), 'click', this.fn_close.bind(this) );
   Event.observe( $('facebox_overlay'), 'click', this.fn_close.bind(this) );
   Event.observe( $('bsend'), 'click', this.fn_send.bind(this) );
  }
};

//pochta_qip_notify.init();