(function(b){b.fn.messagebox=function(){var d=Array.prototype.slice.call(arguments),c=d.shift();if(typeof c=="string"){command=c.toLowerCase();var f=b(this).data("messagebox");if(f==null){return}if(command=="clear"){f.clear.apply(this,d)}else{if(command=="show"){f.show.apply(this,d)}}}else{if(typeof c=="undefined"){c={}}var e=b.extend({},b.fn.messagebox.defaults,c);return b(this).each(function(){var g=new a(b(this),e);b(this).data("messagebox",g)})}};b.fn.messagebox.defaults={successClass:"successbox",errorClass:"errorbox",fade:false,fadeTime:5000,faseSpeed:"slow"};function a(d,e){var c=this;c.element=d;c.settings=e;b.extend(c,{show:function(h,f){var g=f?c.settings.successClass:c.settings.errorClass,i=f?c.settings.errorClass:c.settings.successClass;c.element.html(h).addClass(g).removeClass(i).show();if(e.fade){window.setTimeout(function(){c.element.fadeOut(c.settings.fadeSpeed)},c.settings.fadeTime)}},clear:function(){c.element.html("").hide()}});c.clear()}})(jQuery);