function winH(){
	/* NN4 a kompatibiln�prohl�� */
	if (window.innerHeight)
		return window.innerHeight;
	/* MSIE6 v std. reimu - Opera a Mozilla ji usp�y s window.innerHeight */
	else if (document.documentElement && document.documentElement.clientHeight)
		return document.documentElement.clientHeight;
	/* star�MSIE + MSIE6 v quirk reimu */
	else if (document.body && document.body.clientHeight)
		return document.body.clientHeight;
	else
		return null;
}

function winW(){
	/* NN4 a kompatibiln�prohl�� */
	if (window.innerWidth)
		return window.innerWidth;
	/* MSIE6 v std. reimu - Opera a Mozilla ji usp�y s window.innerHeight */
	else if (document.documentElement && document.documentElement.clientWidth)
		return document.documentElement.clientWidth;
	/* star�MSIE + MSIE6 v quirk reimu */
	else if (document.body && document.body.clientWidth)
		return document.body.clientWidth;
	else
		return null;
}

function Okno(width,height,scrollbars,url){
	posX = (winW()/2)-(width/2);
	posY = (winH()/2)-(height/2);
	add=window.open("popup.php?filename="+url,"add","left="+posX+",top="+posY+",width="+width+",height="+height+",menubar=no,directories=no,toolbar=no,location=no,status=no,scrollbars="+scrollbars+",resizable=yes");
	add.focus();
}

function NewWin(url,name,width,height,scrollbars) {
	posX = (winW()/2)-(width/2);
	posY = (winH()/2)-(height/2);
	add=window.open(url,name,"left="+posX+",top="+posY+",width="+width+",height="+height+",menubar=no,directories=no,toolbar=no,location=no,status=no,scrollbars="+scrollbars+",resizable=yes");
	add.focus();
}

function ReloadPage(url,sid){
	//location.href='zpracuj_sirku.php?sirka='+winW()+'&adresa='+location.href+'';
	//aa='zpracuj_sirku.php?sirka='+winW()+'&adresa='+url;
	if(sid!='')
		location.href='zpracuj_sirku.php?sirka='+winW()+'&adresa='+url+'&'+sid;
	else
		location.href='zpracuj_sirku.php?sirka='+winW()+'&adresa='+url;
}

function Show(id){
	if(document.getElementById)
		document.getElementById(id).style.display='block'
	else if(document.layers)
		document.layers[id].display='block'
	else if(document.all)
		document.all(id).style.display='block'
}

function Hide(maxId,element){
	for(i=1; i<=maxId; i++){
		var x;

		x = element+i;
		if(document.getElementById)
			document.getElementById(x).style.display='none'
		else if(document.layers)
			document.layers[x].display='none'
		else if(document.all)
			document.all(x).style.display='none'
	}
}

function waitHide(max,elem){
	setTimeout("Hide("+max+","+elem+")",100);
}

function DefStat(name){
	defaultStatus=name;
}

function DisableElement(id) {
	document.getElementById(id).setAttribute('disabled','disabled');
}

function EnableElement(id) {
	document.getElementById(id).removeAttribute('disabled');
}

function cookieState()
{
 if (!window.navigator.cookieEnabled)
 	location.href='error.php?cookie=no';
 else
 	return true;
}

function HideInfo(id) 
{
	document.getElementById(id).style.display='none';
}
