(function($){
	var container = false;
	$.extend({
        message: function(msg, type){
			if( typeof type == "undefined" ) type = 'msg';
			if( !container ) {
				var html = "<div id='message' />";
				container = $(html).hide();
				container.click( function(){
					$.message.hide();
				} ).css("cursor", "pointer");
				$("body").append(container);
			}
			switch( type ) {
				case "err": 
					container.attr("class", "message-err ui-corner-all");
					break;
				default: //type = msg
					container.attr("class", "message-msg ui-corner-all");
					break;
					
					
			}
			container.html(msg);
			container.fadeIn();
			setTimeout( "$.message.hide()", 2000 );
			
			$.message.hide = function() {
				container.fadeOut("normal");
			}
			
		}
    });
})(jQuery);
