// Twitter-like notification
var notification = {
	timer : null,
	show : function(msg)
	{
		var nparent = jQuery('<div id="notification" class="hidden">');

		var ncontainer = jQuery('<div id="notification-container">').appendTo(nparent);

		jQuery('body').prepend(nparent);

		jQuery("#notification #notification-container").text(msg);

		jQuery("#notification").slideDown('fast');

		jQuery(function()
		{
			self.timer = setTimeout(function()
			{
				jQuery("#notification").slideUp('normal', function()
				{
					jQuery("#notification").remove();
				});

			}, 2000);
		});

		jQuery("#notification").click(function ()
		{
			jQuery("#notification").slideUp();

			jQuery("#notification").remove();

			clearTimeout(self.timer);
		});
	},
	hide: function()
	{
		jQuery("#notification").slideUp();

		jQuery("#notification").remove();
	}
};

