                                                  var reklama, reklamaSpan;

function rotujiciReklamaInit()
{
	reklama = document.getElementById('reklama');
	reklamaSpan = reklama.firstChild;
	reklamaSpan.style.left = reklama.offsetWidth + 'px';
	
	rotujiciReklama();
}
function rotujiciReklama()
{
	reklamaSpan.style.left = (parseInt(reklamaSpan.style.left) - 2) + 'px';
	if (reklamaSpan.offsetLeft + reklama.offsetWidth < 0)
	{
		reklamaSpan.style.left = reklama.offsetWidth + 'px';		
	}
	window.setTimeout('rotujiciReklama()',50);
}

var el1 = null, el2 = null;
var time1 = null, time2 = null;
var uls = new Array();

function Menu(src,index)
{

	if (time1!=null || time2!=null) return false;
	
	ul = src.parentNode.getElementsByTagName('ul');
	ul = ul[0];

	if (ul.style.display =='none')
	{
		//zabalovat
		for (i = 0;i<uls[index].length;i++)
			if (uls[index][i].style.display != 'none')
			{
				el2 = uls[index][i];
				time2 = setInterval('Scroll(-15)',50);
			}
		//rozbalovat
		el1 = ul;
		if (time2 == null)
		{
			el1.style.display = 'block';
			time1 = setInterval('Scroll(15)',50);
		}
	}
	else
	{
		//zabalovat
		el1 = null;
		el2 = ul;
		time2 = setInterval('Scroll(-15)',50);
	}
	
	return false;
}

function Scroll(step)
{
	if (step > 0)
	{
		if (el1.offsetHeight + step > el1.scrollHeight)
		{
			//rozbaleno
			el1.style.height = (el1.scrollHeight) + 'px';
			clearInterval(time1);
			time1 = null;
		}
		else
		{
			el1.style.height = (el1.offsetHeight + step) + 'px';
		}
	}
	else
	{
		if (el2.offsetHeight + step <= 0)
		{
			//zabaleno
			el2.style.height = '1px';
			el2.style.display = 'none';
			clearInterval(time2);
			time2 = null;
			el2 = null;
			if (el1!=null)
			{
				el1.style.display = 'block';
				time1 = setInterval('Scroll(15)',50);
			}
		}
		else
		{
			el2.style.height = (el2.offsetHeight + step) + 'px';
		}	
	}
}

