ModalWindow = iClass.create({
  initialize: function() {
    this.opacityDiv = new OpacityDiv();
  }, // initialize
  
  markup: function() {
    this.opacityDiv.show();
  
    var containerDiv = cr( 'DIV' );
    var winDiv       = cr( 'DIV' );
    var headDiv      = cr( 'DIV' );
    var closeBtnDiv  = cr( 'DIV' );
    var contentDiv   = cr( 'DIV' );
    
    containerDiv.appendChild( winDiv );
    winDiv.appendChild( headDiv );
    headDiv.appendChild( closeBtnDiv );
    winDiv.appendChild( contentDiv );
    
    winDiv.className      = 'modalWindow';
    headDiv.className     = 'modalWindowHead';
    closeBtnDiv.className = 'closeBtn';
    contentDiv.className  = 'modalWindowContent';
    
    this.container  = containerDiv;
    this.winElement = winDiv;
    this.content    = contentDiv;
    
    this.hide();
    
    var self = this;
    closeBtnDiv.onclick = function() {
      self.close();
      
      if( isChangePassword ){
        window.location.href = 'http://zvi.cv.ua/online_reception/';
        isChangePassword = false;
      }
    } // onclick
    
    Body.append( containerDiv );
  }, // markup
  
  show: function() {
    toScreenCenter( this.winElement );
    this.container.className = '';
  }, // show
  
  hide: function() {
    this.container.className = 'hidden';
  }, // hide
  
  close: function() {
    if ( this.container ) {
      rmObj( this.container );
      this.opacityDiv.hide();
    } // if
  } // close
}); //ModalWindow

$modalWin = new ModalWindow();