function ProgressBar()
{
	this.height=10;
	this.width=200;
	this.border="1px solid #000";
	this.bgcolor="#fff";
	this.fgcolor="#ffcc00";
	this.val=0;
	this.maxi=100;
	this.html='';
	//methodes
	this.init=ProgressBar_init;
	this.set_percent=ProgressBar_set_percent;
	this.majGraph=ProgressBar_majGraph;
}

function ProgressBar_init(m)
{
		this.maxi=m;
		document.write('<span id="progressBar"></span>');
		this.majGraph();
}
function ProgressBar_majGraph()
{
        this.html = '<div style="margin:1px 0px 0px '+Math.round(this.width/2-11)+'px;position:absolute;">'+this.val+'%</div><div style="width:'+this.width+'px;';
        this.html+= 'background-color:'+this.bgcolor+';border:'+this.border+';">';
        this.html+= '<div id="progressBarPt" style="';
		this.html+= 'text-align:center;width:'+Math.round(this.val*this.width/100)+'px;background-color:'+this.fgcolor;
		this.html+= '">&nbsp;</div>';
        this.html+= '</div>';
        document.getElementById("progressBar").innerHTML=this.html;
}
function ProgressBar_set_percent(v)
{
        this.val=(parseInt(v)*100)/parseInt(this.maxi);
		this.val=Math.round(this.val);
		this.majGraph();
}