
function doCall(){
	$('docall').disabled='disabled';

}

function doMonitor(id){
	var monitor = new Ajax.PeriodicalUpdater('state', 'state.php', {method: 'get', frequency:1, parameters:"id=" + id, onSuccess:doUpdateState});
}

function doUpdateState(originalRequest){

	var dane = originalRequest.responseText;
	$('state_calling_f').style.display = 'none';
	$('state_calling_k').style.display = 'none';
	$('state_busy_f').style.display = 'none';
	$('state_busy_k').style.display = 'none';
	$('state_connection').style.display = 'none';
	$('state_end').style.display = 'none';
	$('state_error').style.display = 'none';
	$('state_init').style.display = 'none';

	$('state_' + dane).style.display = 'block';

	if(dane == 'end' || dane == 'error'){
		window.setTimeout('doEnd()', 5000);
	}
}

function doEnd(){
	window.close();
}

