Object.extend(sjcl.widget,{ProgressBar:function(width,height){if(typeof width=="number")width+="px";if(typeof height=="number")height+="px";if(width)this.width=width;if(height)this.height=height;this.cssClass="ProgressBar";this.value=0;}});sjcl.widget.ProgressBar.extend({build:function(container){var tbl=document.createElement("TABLE");var bdy=tbl.appendChild(document.createElement("TBODY"));var tr=bdy.appendChild(document.createElement("TR"));var td,div;td=tr.appendChild(document.createElement("TD"));td.className="LeftEdge";td=tr.appendChild(document.createElement("TD"));td.className="Outer";div=td.appendChild(document.createElement("DIV"));div.className="Inner";td=tr.appendChild(document.createElement("TD"));td.className="RightEdge";tbl.className=this.cssClass;tbl.cellPadding="0px";tbl.cellSpacing="0px";if(this.width)tbl.style.width=this.width;if(this.height)tbl.style.height=this.height;container.appendChild(tbl);this._inner=div;this.frame=tbl;this.setValue(this.value);},setValue:function(value){this.value=Math.max(0,Math.min(value,100));if(this.frame){var outer=this._inner.parentNode;var width=Math.floor(outer.offsetWidth*this.value/100);width=width||1;this._inner.style.width=width+"px";}}});