function UpdateBars(id){
	$.ajax({type: "POST", url: "/progress", dataType: 'json', data: "id="+id, success: function(msg)
		{
			if(msg.error == "none")
			{
				if(msg.step == 4)
				{
						window.clearInterval($.CliprEngineInterval);
						window.setTimeout(function(){ document.location.href = "/"+id; },3500);
				}
				
				for(var c=1;c < msg.step;c++){
					$("#bar"+c).animate({width: "100%"}, 1500, function(){ $(this).css("background-image","url(/img/loadingbar.png)"); });
				}
				
				$("#bar"+msg.step).animate({width: msg.progress+"%"}, 1900);
				
				for(var c=msg.step+1;c<4;c++){
					$("#bar"+c).css("width","0%");
				}
				
			}else{
				window.clearInterval($.CliprEngineInterval);
				window.setTimeout(function(){ document.location.href = "/error/"+msg.error; },500);
			}
		}
	});
}
