function doLoad(task_id) {
	this.task_id = task_id;
	this.storage = document.getElementById('upload_host').value;
	this.finished = 0;
	this.zombie = 0;
	this.deleted = 0;
	this.total_upload_size = 1;
	this.timeout;
	var test;
	var req = new Subsys_JsHttpRequest_Js(); 
	
		req.onreadystatechange = function()
		{
			if(req.readyState == 4)
			{	
				if(req.responseJS)
				{			
					var completed = req.responseJS.progress;
					var total = req.responseJS.total;
					var pdate = req.responseJS.pdate;
					
					var seeking_selected = req.responseJS.seeking_selected;
					var seeking_fields = req.responseJS.seeking_fields;
					var total_fields = req.responseJS.total_fields;
					var total_found = req.responseJS.total_found;
					var list_found = req.responseJS.list_found;
					var not_found_yet = req.responseJS.not_found_yet;
					
					var remaining = '';
					
					if(total)
					{
						remaining = total - completed;
					}
					
					
					
					if(completed< 0) //may be finished or error
					{
						finished = 1;
						return 0;
					}
					
					finished = req.responseJS.finished;
					zombie = req.responseJS.zombie;
					deleted = req.responseJS.deleted;
					var progressPercent = Math.ceil((completed/total)*100);
					
					document.getElementById('date_'+task_id).innerHTML = pdate;
					if(progressPercent)
					{
						document.getElementById('progressMeterText_'+task_id).innerHTML = 'Обработано страниц: ' + progressPercent + '%';
					}
					document.getElementById('progressMeterBarDone_'+task_id).style.width = parseInt(progressPercent*2.5) + 'px';
					document.getElementById('progressMeterBar_'+task_id).style.width = parseInt(progressPercent*2.5) + 'px';
					
					document.getElementById('dones_'+task_id).innerHTML = completed;

					document.getElementById('lefts_'+task_id).innerHTML = remaining;

					document.getElementById('totals_'+task_id).innerHTML = total;
					
					if (seeking_selected == 1)
					{
							document.getElementById('seeking_selected_'+task_id).style.display ='';
							document.getElementById('total_found_'+task_id).innerHTML = total_found;
							document.getElementById('lefts_fields_'+task_id).innerHTML = total_fields - total_found;
							document.getElementById('total_fields_'+task_id).innerHTML = total_fields;
							document.getElementById('seeking_fields_'+task_id).innerHTML = seeking_fields;
							//document.getElementById('list_found_'+task_id).innerHTML = list_found;
							if (finished == 1)
							{
								document.getElementById('not_found_yet_'+task_id).innerHTML = '<font color=red>'+not_found_yet+'</font>';
							}
							else
							{
								document.getElementById('not_found_yet_'+task_id).innerHTML = not_found_yet;
							}
					}
					if (zombie == 1)
					{
						document.getElementById('process_status_'+task_id).innerHTML = '<font color=red>Процесс завис</font>';
						return 0;
					}
					if (deleted == 1)
					{
						document.getElementById('process_status_'+task_id).innerHTML = 'Процесс удален';
						return 0;
					}
					
					if (finished == 1)
					{
						document.getElementById('process_status_'+task_id).innerHTML = 'Процесс завершен';
						document.getElementById('finished_'+task_id).value = finished;
						return 0;
					}
			
				}
				else
				{
					alert('Error: got a not-OK status code...');
				}
			}//status == 4
		}//end function
		req.caching = false;
		req.open('POST', 'http://'+this.storage+'/progress/', true);
		var tt = Math.floor(Math.random()*(1001));		
		req.send({ task: this.task_id, t: tt },this.task_id);
		
	
		if (document.getElementById('finished_'+this.task_id).value != 1)
		{
			setTimeout("doLoad('"+this.task_id+"')",50000);
		}
}
function set_network_name()
{	
	var choice = document.getElementById('net');
	var url = choice.options[choice.selectedIndex].text;
	document.getElementById('network_name').value = url;
}



