jQuery.notify = function(settings){
	(function(jQuery) {
		
		jQuery.notify.defaults = {
			background_color 	: '#FFFFFF',
			color 				: '#000',
			position		 	: 'top',
			removebutton     	: true,
			time			 	: 5000	
		};
		
		var o = jQuery.extend({}, jQuery.notify.defaults, settings);
		
		if(!jQuery('.jbar').length){
			jQuery.notify.timeout = setTimeout('jQuery.notify.removeBar()',o.time);
			var _message_span = jQuery(document.createElement('span')).addClass('jbar-content').html(o.message);
			_message_span.css({"color" : o.color});
			
			var _wrap_bar;
			(o.position == 'bottom') ? 
			_wrap_bar	  = jQuery(document.createElement('div')).addClass('jbar jbar-bottom'):
			_wrap_bar	  = jQuery(document.createElement('div')).addClass('jbar jbar-top') ;
			
			_wrap_bar.css({"background-color" 	: o.background_color});
			if(o.removebutton){
				var _remove_cross = jQuery(document.createElement('a')).addClass('jbar-cross');
				_remove_cross.click(function(e){jQuery.notify.removeBar();})
			}
			else{
				_wrap_bar.css({"cursor"	: "pointer"});
				_wrap_bar.click(function(e){jQuery.notify.removeBar();})
			}
			jQuery('body').prepend(_wrap_bar.append(_message_span).append(_remove_cross).hide().fadeTo('slow',0.8));
		}
		
		jQuery.notify.removeBar = function(){
			if(jQuery('.jbar').length){
				clearTimeout(jQuery.notify.timeout);
				jQuery('.jbar').fadeOut('fast',function(){
					jQuery(this).remove();
				});
			}	
		};
	})(jQuery);
};
