(function($){var t;var $bar
$.bar=function(options){var $body=$('body');var opts=$.extend({'time':5000,'message':'You successfully created a message!','class':'BannerWorking','beforeShow':function(){return true;},'afterShow':function(){},'beforeClose':function(){return true;},'afterClose':function(){}},options,{});$bar=$body.data('bar');if($bar){$bar.trigger('close');}
if(opts.beforeShow()&&!$bar)
{$bar=$('<span></span>',{'class':'Banner '+opts['class'],'html':opts.message,}).click(function(){$bar.trigger('close');}).css('display','none');$bar.bind('close',function(event,after){if(opts.beforeClose())
{clearTimeout(t);$bar=false;$('body').data('bar',$bar);$(this).fadeOut('fast',function(){$(this).remove();opts.afterClose();if($.isFunction(after))
{after();}});}});$('body').append($bar).data('bar',$bar);if(opts.beforeShow()){$bar.fadeIn('fast',function(){opts.afterShow();});}}
if(opts.time>0){t=setTimeout(function(){$bar.trigger('close');},opts.time)}}})(jQuery);
(function($){$.request=function(options){var opts=$.extend({'success':function(message,data){$.bar({'message':message,'class':'BannerSuccess'});},'error':function(message,data){$.bar({'message':message,'class':'BannerFailure'});},'failure':function(){$.bar({'message':'Sorry, there appears to be a network error. Please try again.','class':'BannerFailure',});},'method':'POST','url':'','data':[]},options);$.ajax({'url':opts.url,'data':opts.data,'type':opts.method,'success':function(data)
{try{data=eval('('+data+')');}catch(exception){opts.error('Could not understand the response from server. Please make sure you are still logged in.',data);return;}
if(data['Result']==1){opts.success(data.Message,data.data);}else{opts.error(data.Message,data.data);}},'error':function()
{opts.failure();}});}})(jQuery);
