function gId(id) {
	if(document.getElementById) return document.getElementById(id);
	else return false
}

function confirm_check(otazka){
	  vysledek=confirm (otazka);
	  if (vysledek==0)
	  {
	    pokracuj=false;
	  }
	  else pokracuj=true;
	}
	
/*odpocitani znaku STA-co, D maximum*/
function ZZ(STA,D) {
	IDV='max-'+STA.id;
	R=STA.value;
	if(R.length>=D) {
		NR=R.substring(0,D);
		STA.value=NR;
		//gId(IDV).className="br";
	}
	else {
		NR=R;
		//gId(IDV).className="bz";
	}
	gId(IDV).innerHTML=(D-NR.length);
}
//otevre fotku v new okne
function okno(url, w, h) 
{
	
	//sirka	
	if(screen.width < w)
		{w= screen.height-100;}
	
	//vyska
	if(screen.height < h)
		{h= screen.height-100;}
	
	window.open(url,'_blank', 'scrollbars,menubar=0,width=' + w + ',height=' + h);
}

//otevre fotku v new okne2
function showPic (popis,pic,w,h) {
sw=screen.availWidth-8; sh=screen.availHeight-48;
if (w>sw) { h=Math.round(sw*h/w); w=sw; }
if (h>sh) { w=Math.round(sh*w/h); h=sh; }

l=(sw-w)/2; t=(sh-h)/2; wh=h+16;

url='/php/foto2.php?popis='+popis+'&w='+w+'&h='+h+'&pic='+pic;
prvky='width='+w+',height='+wh+',left='+l+',top='+t+',resizable=no,scrollbars=no,titlebar=no,toolbar=no,fullscreen=no';
pic=pic.substr(pic.lastIndexOf('/')+1,pic.length);
pic=pic.substr(0,pic.indexOf('.'));
v = window.open (url,pic,prvky); v.focus();
}
//--></script>
