/********* notice stuff ********/
$('#growl')
  .find('.close')
  .live('click', function() {
      removeNotice($(this).closest('.notice'));
  });

function addNotice(notice, timeout) {
  var foo = $('<div class="notice"></div>')
    .append('<div class="skin"></div>')
    .append('<a href="#" class="close">close</a>')
    .append($('<div class="content"></div>').html($(notice)))
    .hide()
    .appendTo('#growl')
    .fadeIn(1000);

    if (timeout != null) {
        setTimeout(function() {
            removeNotice(foo);
        }, timeout);
    }
  return foo;
}

function removeNotice(notice) {
    notice.animate({border: 'none',
                    height: 0,
                    marginBottom: 0,
                    marginTop: '-6px',
                    opacity: 0,
                    paddingBottom: 0,
                    paddingTop: 0,
                    queue: false
                   }, 1000, function() {
                                notice.remove();
                            }
                   );
}


