function Sbarra1(name,width){
	this.name=name;
	this.height=60;
	this.width=width;
	this.colore="#000000";
	this.delta=20;
	this.sleep=1;
	this.i=0;
	var s1;
	var s2;
	var s3;
	this.print=printSbarra;
	this.chiudi=chiudiSbarra;
	this.chiudi1=chiudiSbarra1;
	//this.apri=apriSbarra;
}
function printSbarra(){
	var result = "";
	result+="<TABLE border=\"0\" cellSpacing=\"0\" cellpadding=\"0\" style=\"width:840px;height:"+this.height+";\" align=\"center\">\n";
	result+="	<tr>\n";
	result+="		<td id=\""+this.name+"1\" bgcolor=\""+this.colore+"\"></td>\n";
	result+="		<td id=\""+this.name+"2\" ></td>\n";
	result+="		<td id=\""+this.name+"3\" bgcolor=\""+this.colore+"\"></td>\n";
	result+="	</tr>\n";
	result+="</table>\n";
	return result;
}
function chiudiSbarra(){
	this.i=0;
	chiudiSbarra1(this.name);
}
function chiudiSbarra1(name){
	var obj=eval(name);
	
	obj.s1 = document.getElementById(name+"1");
	obj.s2 = document.getElementById(name+"2");
	obj.s3 = document.getElementById(name+"3");
	obj.s1.style.width=obj.i+"px";
	if(obj.width-(obj.i+2)<0){
		obj.s2.style.width="0px";		
	}else{
		obj.s2.style.width=obj.width-(obj.i+2)+"px";
	}
	obj.s3.style.width=obj.i+"px";	
	obj.i+=obj.delta;
	if(obj.i<width+10){
		setTimeout("chiudiSbarra1(\""+name+"\");",obj.sleep);
	}else{
		obj.s2.style.backgroundColor=obj.colore;
		try{notificaFine("1");}catch(e){}
	}
}
