
var progress = new Array('/', '-', '\\', '|');

var val_cy = null;
var val_pr = null;
var stop_cy = 0;
var stop_pr = 0;


function find_in_array(gde, chto)
{
	for(var i = 0; i < gde.length; i++)
		if (gde[i] == chto)
			return i;
	
	return -1;
}


function get_xml_http_request()
{
	var xmlHttp = false;
	
	try
	{
		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e2)
		{
			xmlHttp = false;
		}
	}

	if (!xmlHttp && window.XMLHttpRequest)
	{
		xmlHttp = new XMLHttpRequest();
		if (xmlHttp.overrideMimeType)
		{
			xmlHttp.overrideMimeType('text/xml');
        }
	}
	
	return xmlHttp;
}


function timer_func()
{
	if (val_cy == null)
		val_cy = document.getElementById('cy');
	if (val_pr == null)
		val_pr = document.getElementById('pr');
	
	var pos = find_in_array(progress, val_cy.innerHTML);
	if (pos != -1)
	{
		pos++;
		if (pos >= progress.length)
			pos = 0;
		
		val_cy.innerHTML = progress[pos];
	}
	else
		stop_cy = 1;
	
	var pos = find_in_array(progress, val_pr.innerHTML);
	if (pos != -1)
	{
		pos++;
		if (pos >= progress.length)
			pos = 0;
		
		val_pr.innerHTML = progress[pos];
	}
	else
		stop_pr = 1;
	
	if (stop_cy && stop_cy)
		return;
	
	setTimeout(timer_func, 200);
}

