<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.5.2.js'></script>
<script type='text/javascript'>
$(window).load(function(){
$(".success, .info, .warning, .error").each(function(){
$(this).append('<div class="hide">hide</div>');
$(this).delay(4000).fadeOut();
});
$(".hide").live("click", function(){
$(this).parent().stop().fadeOut();
});
});
</script>
</head>
<body>
<div class="success">text</div>
</body>
</html>