jQuery(function(b){var c={mode:"auto",placeholder:"<img src='"+foswiki.getPreference("PUBURLPATH")+"/System/JQueryPlugin/images/spinner.gif' width='16' height='16' />",url:undefined,section:undefined,effect:"fade",effectspeed:500,effectopts:{},delay:0,onload:function(){},finished:function(){},beforeload:function(){if(typeof(this.container)!=="undefined"){this.container.css({opacity:0.5})}}};function a(f,e){var d=this;d.element=f;d.options=b.extend({},c,e);d.init();if(d.options.mode==="auto"){if(d.options.delay){window.setTimeout(function(){d.load()},d.options.delay)}else{d.load()}}}a.prototype.init=function(){var e=this,d=b(e.element);d.hide();if(typeof(e.options.section)!=="undefined"){e.options.url=foswiki.getPreference("SCRIPTURL")+"/view/"+foswiki.getPreference("WEB")+"/"+foswiki.getPreference("TOPIC")+"?skin=text;section="+e.options.section}d.bind("refresh.jqloader",function(g,f){b.extend(e.options,f);e.load()});if(typeof(e.options.onload)==="function"){d.bind("onload.jqloader",function(){e.options.onload.call(e)})}if(typeof(e.options.beforeload)==="function"){d.bind("beforeload.jqloader",function(){e.options.beforeload.call(e)})}if(typeof(e.options.finished)==="function"){d.bind("finished.jqloader",function(){e.options.finished.call(e)})}e.prepareContainer()};a.prototype.prepareContainer=function(){var e=this,d=b(e.element),f;if(typeof(e.options.placeholder)!=="undefined"){f=b(e.options.placeholder);f.insertBefore(d);d.bind("onload.jqloader",function(){f.remove()});if(e.options.mode!=="auto"){f.click(function(){d.trigger("refresh.jqloader",e)})}}};a.prototype.load=function(){var e=this,f=foswiki.getPreference("PUBURLPATH"),d=b(e.element);d.trigger("beforeload.jqloader",e);if(e.options.url){b.get(e.options.url,function(g){if(typeof(e.container)!=="undefined"){e.container.remove()}e.container=b("<div />").append(g).insertAfter(d);d.trigger("onload.jqloader",e);if(typeof(e.options.effect)!=="undefined"&&e.options.effect!=="show"){e.container.hide();if(e.options.effect==="fade"){e.container.fadeIn(e.options.effectspeed,function(){d.trigger("finished.jqloader",e)})}else{e.container.show(e.options.effect,e.options.effectopts,e.options.effectspeed,function(){d.trigger("finished.jqloader",e)})}}else{d.trigger("finished.jqloader",e)}},"html")}else{d.html("error: no url")}};b.fn.jqLoader=function(d){return this.each(function(){if(!b.data(this,"plugin_jqLoader")){b.data(this,"plugin_jqLoader",new a(this,d))}})};b(".jqLoader:not(.jqLoaderInited)").livequery(function(){var e=b(this),d=b.extend({},e.metadata());e.addClass("jqLoaderInited").jqLoader(d)})});