var frm = document.myform;
var ie = document.all?1:0

function CCA(CB){
	if (CB.checked)
		hL(CB);
	else
		dL(CB);
}

function hL(E){
	if (ie)
	{
		while (E.tagName!="TR") {E=E.parentElement;}
	}else{
		while (E.tagName!="TR") {E=E.parentNode;}
	}
	E.className = "H";
}

function dL(E){
	if (ie)
	{
		while (E.tagName!="TR") {E=E.parentElement;}
	}else{
		while (E.tagName!="TR") {E=E.parentNode;}
	}
	E.className = "";
}

var bolChecked=false;

function CheckUncheckAll()
{
	for (var i=0; i<document.myform.length;i++)
	{
		if (document.myform.elements[i].type=="checkbox")
		{
			if (!bolChecked) 
			{
				document.myform.elements[i].checked=true;
				CCA (document.myform.elements[i]);
			}else{
				document.myform.elements[i].checked=false;
				CCA (document.myform.elements[i]);
			};
		};
	};
	bolChecked=!bolChecked;
};

function Popisky(objValue)
{
if (objValue)
	{
	    document.styleSheets[0].addRule(".popisek", "display:block");
	}else{
	    document.styleSheets[0].addRule(".popisek", "display:none");		
	};
return true;
};


//implements the switch (checkbox) that is used on the screen to switch ON/OFF popisek
function Switch4Popisek()
{
	if (ie) 
	{
   		var gt;
	   gt = unescape(new String("%3E"));
   		document.write("<BR" + gt +"<input type=checkbox value=\"YES\" onclick=\"Popisky(this.checked)\"" + gt);
	    document.write("<small" + gt + "Zobrazit popisky<\/small" + gt);
	};
};

function PopisekONOFF(intPopisekID)
{
	if (eval('document.all.popisek'+intPopisekID+'.style.display == "block"'))
	{
		eval('document.all.popisek'+intPopisekID+'.style.display = "none"');
	}else{
		eval('document.all.popisek'+intPopisekID+'.style.display = "block"');
	};
};
