/*
 * Copyright (C) by Netcetera AG.
 * All rights reserved.
 *
 * The copyright to the computer program(s) herein is the property of
 * Netcetera AG, Switzerland.  The program(s) may be used and/or copied
 * only with the written permission of Netcetera AG or in accordance
 * with the terms and conditions stipulated in the agreement/contract
 * under which the program(s) have been supplied.
 *
 */

/*
 * Manages the error message
 */

ErrorMessage = {
    
  _shown: false,

  init: function() {
    this._shown = false;
    
    $('#error').css('visibility', 'hidden');
  },
    
  show: function(message) {
    $("#error p").text(message);
    
    if (this._shown == false) {
      $("#error")
        .css('visibility', 'visible')
        .animate({bottom: $('#footer').height()}, 500);
    }
    this._shown = true;
  },

  hide: function() {
    if (this._shown == true) {
      $("#error")
        .css('visibility', 'hidden')
        .animate({bottom: 0}, 500);
    }
    this._shown = false;
  },
  
  adjust: function() {
    if (this._shown) {
      $('#error')
        .css('bottom', $('#footer').height());
    }
  }
}