var barvy=new Array();
barvy[1]=1;
barvy[2]=0.75;
barvy[3]=0.5;
barvy[4]=0.25;
barvy[5]=0;
var barvyie=new Array();
barvyie[1]=100;
barvyie[2]=75;
barvyie[3]=50;
barvyie[4]=25;
barvyie[5]=0;

var time=70;
var time2=3000;
var barva=1;
var nov=1;
//var pocetnovinek=3;
var smer='plus';

function stop(){
	if (timerID1){
		clearTimeout(timerID1);
		timerID1=0;
	}
}

function stop2(){
	if (timerID2){
		clearTimeout(timerID2);
		timerID2=0;
	}
}

function Ycx_news(){
		pocetnovinek = document.getElementById('news').getElementsByTagName('li').length;
		timerID2=setTimeout("Ycx_news_showhide()",time2);
}

function Ycx_news_showhide(){
	if (barva<6){
		if (barva>0){
			novinka=document.getElementById('news'+nov);
			novinka.style.MozOpacity=barvy[barva];
			novinka.style.filter='alpha(opacity='+barvyie[barva]+')';
			if (smer=='plus'){
				barva++;
			} else {
				barva--;
			}
			timerID1=setTimeout("Ycx_news_showhide()",time);
		} else {
			stop();
			barva=1;
			smer='plus';
			Ycx_news();
		}
	} else {
		stop();
		barva=5;
		smer='minus';
		novinka=document.getElementById('news'+nov);
		novinka.style.display='none';
		if (pocetnovinek==nov){
			nov=1;
		} else {
			nov++;
		}
		novinka=document.getElementById('news'+nov);
		novinka.style.display='';
		Ycx_news_showhide();
	}
}


	function myloadhtml(url,cil)
	{
		start = new Date();
		xmlfilename=url; //'data.xml?x='+start.getTime();
		if (document.implementation && document.implementation.createDocument)
		{
			xmlDoc = document.implementation.createDocument("", "", null);
			xmlDoc.onload = function(){ myloadhtml_xml(cil); };
		}
			else if (window.ActiveXObject)
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.onreadystatechange = function () {if (xmlDoc.readyState == 4)
			myloadhtml_xml(cil)};
		}
			else
		{
			//alert('Your browser can\'t handle this script');
			return;
		}
		xmlDoc.load(xmlfilename);
	}

	function myloadhtml_xml(cil)
	{
	  var xnazev = xmlDoc.getElementsByTagName('nazev');
	  var xsn = xmlDoc.getElementsByTagName('sn');
	  var xidfy = xmlDoc.getElementsByTagName('idfy');
	  var xidpma = xmlDoc.getElementsByTagName('idpma');
	  if (xnazev[0].firstChild){
		document.getElementById('sn').value=xsn[0].firstChild.nodeValue;
		document.getElementById('nazev').value=xnazev[0].firstChild.nodeValue;
		document.getElementById('idfy').value=xidfy[0].firstChild.nodeValue;
		document.getElementById('idpma').value=xidpma[0].firstChild.nodeValue;
	  } else {
		document.getElementById('sn').value='';
		document.getElementById('nazev').value='';
		document.getElementById('idfy').value='';
		document.getElementById('idpma').value='';
	  }
	}
