/*
 * This file is part of the myCorePlugin package.
 * (c) 2009 - 2010 Mishal.cz <mishal@mishal.cz>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Flash messages, requires jquery and framework core
 *
 * @version SVN:$Id$
 * @author Mishal <mishal at mishal dot cz>
 *
 */
Application.behaviors.flash = function() {

  /**
   * Hides flash messages on click
   */
  $('div.flash-notice p,div.flash-success p,div.flash-error p,div.request-error div').each(function()
  {
    var that = $(this);
    that.css({'cursor':'pointer'})

    that.click(function()
    {
      that.fadeOut('slow', function()
      {
        that.remove();
      });
    });

    setTimeout(function()
    {
      that.trigger('click');
    }, 10000);
    
  });

};

