(function($){  
	$.rsm = function(message,options) {
		$('body').rsm(message,options);
	};

	$.fn.rsm = function(message,options) {  
		   
		if ( $.isFunction(this.each) ) {
			var args = arguments;

			return this.each(function() {
				var msg_html = '';
				msg_html += '<div class="success message"><div> ' + message + '</div></div>';
				$(this).append(msg_html);
				var msg = $(this).find('.message');
				var msg_height = msg.outerHeight();
				msg.css('top', '-' + msg_height + 'px'); /* set top offset (hide) */
				msg.animate({ top: '+=' + msg_height }, 400, 'easeInOutQuint', 
					function() {
						// Animation complete.
					}
				);

				var interval = setInterval(
					function(interval){
						var msg_height = msg.outerHeight();
						msg.animate({ top: '-=' + msg_height }, 400, 'easeInOutQuint', 
							function() {
								clearInterval(interval);
							}
						);	
					}, 4000
				);					

			});
		};
		
	};
			 
	$.extend( $.fn.rsm.prototype , {

		/** Default JGrowl Settings **/
		defaults: {
			
		}
	
	});
 
})(jQuery);  		
