(function($){
$.extend({progressBar:new function(){
this.defaults={increment:2,speed:15,showText:true,width:120,boxImage:"/soc/content/images/progressbar.gif",barImage:"/soc/content/images/progressbg_green.gif",height:12};
this.construct=function(_1,_2){
var _3=null;
var _4=null;
if(_1!=null){
if(!isNaN(_1)){
_3=_1;
if(_2!=null){
_4=_2;
}
}else{
_4=_1;
}
}
return this.each(function(_5){
var pb=this;
if(_3!=null&&this.bar!=null&&this.config!=null){
this.config.tpercentage=_3;
if(_4!=null){
pb.config=$.extend(this.config,_4);
}
}else{
var _6=$(this);
var _7=$.extend({},$.progressBar.defaults,_4);
var _8=_3;
if(_3==null){
var _8=_6.html().replace("%","");
}
_6.html("");
var _9=document.createElement("img");
var _a=document.createElement("span");
_9.id=this.id+"_percentImage";
_a.id=this.id+"_percentText";
_9.src=_7.boxImage;
_9.width=_7.width;
var _b=$(_9);
var _c=$(_a);
this.bar=_b;
this.ntext=_c;
this.config=_7;
this.config.cpercentage=0;
this.config.tpercentage=_8;
_b.css("width",_7.width+"px");
_b.css("height",_7.height+"px");
_b.css("background-image","url("+_7.barImage+")");
_b.css("padding","0");
_b.css("margin","0");
_6.append(_b);
_6.append(_c);
_9.alt=this.tpercentage;
_9.title=this.tpercentage;
}
var t=setInterval(function(){
var _d=pb.config;
var _e=parseInt(_d.cpercentage);
var _f=parseInt(_d.tpercentage);
var _10=parseInt(_d.increment);
var bar=pb.bar;
var _11=pb.ntext;
var _12=_d.width/100;
bar.css("background-position",(((_d.width*-1))+(_e*_12))+"px 50%");
if(_d.showText){
_11.html(" "+Math.round(_e)+"%");
}
if(_e>_f){
if(_e-_10<_f){
pb.config.cpercentage=0+_f;
}else{
pb.config.cpercentage-=_10;
}
}else{
if(pb.config.cpercentage<pb.config.tpercentage){
if(_e+_10>_f){
pb.config.cpercentage=_f;
}else{
pb.config.cpercentage+=_10;
}
}else{
clearInterval(t);
}
}
},pb.config.speed);
});
};
}});
$.fn.extend({progressBar:$.progressBar.construct});
})(jQuery);

