if (top.length != self.length) top.location.href = self.location.href;
if (!document.getElementById && document.all) document.getElementById = document.all;


function show(z,y)
{
var z;
var y;

for (i=z; i <= (y+z-1); i++) 
{

document.getElementById(i).style.display = (document.getElementById(i).style.display=='none'?'':'none');
}
}

var jeVidet = false;
var jeVidet2 = false;

// IE je prase!!
function prm(d,e)
{
document.getElementById(d).style.display = 'block';
document.getElementById(e).style.display = 'none';	
}


function prn(d)
{
document.getElementById(d).style.display = (jeVidet ? 'none' : 'block');
  jeVidet = (jeVidet ? false : true);
}

function prn2(d)
{
document.getElementById(d).style.display = (jeVidet2 ? 'none' : 'block');
  jeVidet2 = (jeVidet2 ? false : true);
}


function open_new(w,h) 
{
Okno=window.open("","JSL",'toolbar=0,location=0,scrollbars=1,width='+w+',height='+h+',resizable=1,top=50,left=50');
Okno.focus();
}

function open_new2(url) 
{
Okno=window.open(url,"new",'toolbar=1,location=0,scrollbars=1,resizable=1');
Okno.focus();
}


function checkoff2()
{
	document.getElementById('vsichni').checked = false;
}

function checkoff(p)
{
for(i = 1; i <= p; i++)	
	{
		document.getElementById('n'+i).checked = false;	
	}

}
/* 
counter functions by Michal Soukup
Modified by Robert Hlobilek 2006
*/
var str;
var maxChars = 1000;

function counted(str) {
  var orginal = str.length;
  return  maxChars - orginal;
}

function progresbar (str) {
  var len = str.length;
  var maxWidths = document.getElementById('progres_main').style.width;
  maxWidth =  maxWidths.substr(0,maxWidths.length -2)-2;
  var pBar = document.getElementById('progres_bar');
  
  var newWidth = maxWidth/maxChars*len;
  var procento = Math.round((len/maxChars*100)-0.4)+'%';
  pBar.style.width = newWidth+'px';
  document.getElementById('progres_val').innerHTML=procento;
}

function countChars(){

   var theForm = document.getElementById('np');
   theForm.counter.value = counted(theForm.text.value);
   progresbar (theForm.text.value);
   
   if ( theForm.counter.value < 1) {
     alert('NELZE VLOŽIT VÍCE NEŽ '+ maxChars +' ZNAKŮ');
     theForm.text.value=theForm.text.value.substr(0,maxChars);
   } else if (theForm.counter.value > 750) {
      theForm.counter.style.color = 'black';
   } else if (theForm.counter.value > 400) {
      theForm.counter.style.color = 'ThreedDarkShadow';
   } else if (theForm.counter.value > 200) {
      theForm.counter.style.color = 'gray';
   } else if (theForm.counter.value > 100) {
      theForm.counter.style.color = '#FF8000';
   } else if (theForm.counter.value > 50) {
      theForm.counter.style.color = 'red';
   } else {
      theForm.counter.style.color = 'red';
   }
}

function CheckIt(i)
{
	if(document.getElementById(i).checked == false)
	{
document.getElementById(i).checked = true;
	}
	if(document.getElementById(i).checked == true)
	{
document.getElementById(i).checked = false;
	}
}

