!function(e){function r(s,n,u){if(++n>s.number_requests-1)return s.onFinished(),!0;var t=e.extend({current_index:n},s.data);e.ajax({url:s.url,type:s.type,async:!0,cache:s.cache,dataType:s.dataType,data:t,success:function(e){var t;u.progressbar("value",Number((n+1)/s.number_requests*100)),s.onRequestSuccess(e,n)&&r(s,n,u)},error:function(e,t,a){var o;u.progressbar("value",Number((n+1)/s.number_requests*100)),s.onRequestError(e,t,a,n)&&r(s,n,u)}})}e.fn.synchronous_request=function(s){var n=e.extend({url:"",number_requests:0,offset:0,data:{},progress_bar:".progress-bar",type:"post",cache:!1,dataType:"json",onRequestSuccess:function(e){},onRequestError:function(e,r,s){},onFinished:function(){}},s);progressbar=e(this).progressbar({value:0}),r(n,-1+n.offset,progressbar)}}(jQuery);