var position = new Array(0,0,0,0,0,0);
var width = new Array(353,353,353,786,1124,898);
var move = new Array(false, false, false, false, false, false);

function scrollFrise(id)
{
	if (!move[id])
	{
		move[id] = true;
		scrollFriseFunc(id);
	}
}

function stopFrise(id)
{
	move[id] = false;
}

function scrollFriseFunc(id)
{
	if (move[id])
	{
		position[id] -= 1;
	
		if (position[id] < -width[id]) position[id] = 0;
		
		document.getElementById('m' + id + '_1').style.marginLeft = position[id] + 'px';
		document.getElementById('m' + id + '_2').style.marginLeft = (position[id] + width[id]) + 'px';
	
		setTimeout('scrollFriseFunc(' + id + ')', 30);
	}
}

////////////////////////////////////////////////////////////////////////////////////////////

var currentDescription;

function showDescription(id)
{
	if (id == currentDescription) return;
	
	// Hide previous description
	document.getElementById('n_' + currentDescription).style.textDecoration = 'none';
	document.getElementById('d_' + currentDescription).style.display = 'none';
	
	// Show new current description
	currentDescription = id;
	document.getElementById('n_' + currentDescription).style.textDecoration = 'underline';
	document.getElementById('d_' + currentDescription).style.display = 'block';
}

function confirmLocation(location, message)
{
	if (confirm(message))
		document.location = location;
}

////////////////////////////////////////////////////////////////////////////////////////////

var opacity = 1.0;

function dissolve(dir)
{
	var img1 = document.getElementById('transitionImg');

	if (dir == 1)
	{
		if (opacity == 1.0)
			setTimeout("dissolve(-1)", 4000);
		else
		{
			opacity = opacity + 0.02;
			if (opacity >= 1.0) opacity = 1.0;
			img1.style.opacity = opacity;
			img1.style.filter = 'alpha(opacity=' + (opacity*100.0) + ')';
			setTimeout("dissolve(1)", 30);
		}
	}
	else // dir == -1
	{
		if (opacity == 0.0)
			setTimeout("dissolve(1)", 4000);
		else
		{
			opacity = opacity - 0.02;
			if (opacity <= 0.0) opacity = 0.0;
			img1.style.opacity = opacity;
			img1.style.filter = 'alpha(opacity=' + (opacity*100.0) + ')';
			setTimeout("dissolve(-1)", 30);
		}
	}
}

////////////////////////////////////////////////////////////////////////////////////////////

function recoverPsw()
{
	document.getElementById('loginDiv').style.display = 'none';
	document.getElementById('recoverPswDiv').style.display = 'block';
}
