/* jQuery Notice Plugin
 * 
 * This plug-in allows you to show a little notice box.
 * 
 * @author: Vincent Composieux
 * @homepage: http://vincent.composieux.fr
 * @date 20/06/2010
 */

(function($) {
	$.jQnotice = {
		show: function(message) {
			/** Configuration */
			var top = 40;
			var left = 10;
			var fadeoutDuration = 7000;
			
			/** Launch the notification */
			$('html, body').animate({scrollTop:0});
			$('<div></div>').attr('id', 'jQnotice').css('left', (50-left)+'%').css('top', (0+top)+'px').appendTo('body').text(message);
			
			/** Switch off the notification */
			setTimeout(function() {$('#jQnotice').animate({ opacity: 0, top: '-20px' }, fadeoutDuration);}, 2000);
			setTimeout(function() {$('#jQnotice').remove();}, 100000);
		}
	}
	
	jQnotice = function(message) { $.jQnotice.show(message); };
})(jQuery);

