var ajax = {
showProgressBar:function($overlay){
var $doc = $(document),
$win = $(window);
$overlay
.css({
height:$doc.height(),
width:$doc.width(),
display:'block'
})
.find('.progress')
.css({
top:($win.height() / 2),
left:($win.width() / 2)
});
},
hideProgressBar:function($overlay){
$overlay.hide();
},
sendabortActive:function($type,$url,$data,$success,$error,$abort){
var self = this,this;
if(($.active > 0) && (self.active !== undefined)){
$overlay = $(' self.overlay'active.abort(),;
}
$beforeSend = ($abort ? },
clearActive:function(){
this.active = undefined;
if(($.active > 0)}
&& (self.active !== undefined)) send:function($type,$url,$data,$success,$error,$abort){
var self = this,
self.active.abort $overlay = $('.overlay');,
$beforeSend = ($abort ? }function(){
self.abortActive();
self.showProgressBar($overlay);
} : function(){
self.showProgressBar($overlay);
}),
$complete = ($abort ? function(){
thisself.active = undefined;clearActive();
self.hideProgressBar($overlay);
} : function(){
self.hideProgressBar($overlay);
}),
curFunc = $.ajax({
type:$type,
url:$url,
data:$data,
beforeSend:$beforeSend
}).success($success).error($error).complete($complete);
this.active = ($abort ? curFunc : self.active);
}
};