	var bStop = 0;
	var oldWidth = 0;
	var oldHeight = 0;
	var okol=10;
function SrollImage(intDirection){
	var i = document.getElementById("ImageBody").scrollLeft;
	var ii;
	var k = document.getElementById("ImageBody").scrollTop;
	var kk;
	if(intDirection == 1){
		document.getElementById("ImageBody").scrollLeft = -okol + i;
		ii = document.getElementById("ImageBody").scrollLeft;
		if(i > ii && bStop == 0){setTimeout("SrollImage(1)",50)}
		}
	if(intDirection == 2){
		document.getElementById("ImageBody").scrollLeft = okol + i;
		ii = document.getElementById("ImageBody").scrollLeft;
		if(i < ii && bStop == 0){setTimeout("SrollImage(2)",50)}
		}
	if(intDirection == 3){
		document.getElementById("ImageBody").scrollTop = -okol + k;
		kk = document.getElementById("ImageBody").scrollTop;
		if(k > kk && bStop == 0){setTimeout("SrollImage(3)",50)}
		}
	if(intDirection == 4){
		document.getElementById("ImageBody").scrollTop = okol + k;
		kk = document.getElementById("ImageBody").scrollTop;
		if(k < kk && bStop == 0){setTimeout("SrollImage(4)",50)}
	}
}
function noveokno(soubor, nazevokna, velx, vely)
{
	Nahled = window.open('', nazevokna, 'resizable=0, status=0, menubar=0, location=0, directories=0, scrollbars=0, width='+velx+', height='+vely);
	Nahled.document.write('<html><head><title>ECP - obrázek ('+soubor+')</title></head><body bgcolor="#ffffff" text="#000000" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bottommargin="0">');
	Nahled.document.write('<a href="javascript:;" onclick="window.close()"><img src="'+soubor+'" border=0 alt="Zavřít okno"></a>');
	Nahled.document.write('</body></html>');
}
function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function houpejText()
{
	if (document.all.RotText)
	{
		if (!document.houpejKrok) document.houpejKrok = new Number(-3);
		if (!document.houpejObratky) document.houpejObratky = new Number(3);
		var rt = document.all.RotText;
		var rtw = rt.offsetWidth;
		var rtx = rt.style.pixelWidth;
		if (rtx == 0 || rtx > rtw) rtx = rtw;
		if (rt.style.posLeft < -(rtx - 30) || rt.style.posLeft > 0)
		{
			document.houpejKrok = -document.houpejKrok;
			document.houpejObratky--;
		}
		if (document.houpejObratky >= 0) {
			rt.style.posLeft = rt.style.posLeft + document.houpejKrok;
			setTimeout('houpejText()',60);
		}
	}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function ZobrazMapu(picture, w, h, title){
	scw = window.screen.availWidth-30;
	sch = window.screen.availHeight-30;
	foto = new Image();
	foto.src = picture;
	if (!w) winwidth=foto.width; else winwidth=w; 
	if (!h) winheigh=foto.height; else winheigh=h;
	if (winwidth>scw)	{
		winheigh=(scw/winwidth)*winheigh;
		winwidth=scw;	}
	if (winheigh>sch)	{
		winwidth=(sch/winheigh)*winwidth;
		winheigh=sch;	}
	wtop=(sch/2)-(winheigh/2)+40; if (wtop<0) wtop=0;
	wleft=(scw/2)-(winwidth/2); if (wleft<0) wleft=0;
	ZobrazitMapu = window.open('', 'Mapa', 'resizable=0, status=0, menubar=0, scrollbars=0, location=0, directories=0, width='+winwidth+', height='+winheigh+', top='+wtop+', left='+wleft);
	ZobrazitMapu.document.write('<html><head><title>'+title+'</title></head>');
	ZobrazitMapu.document.write('<script language="JavaScript">function UkazText(){ document.getElementById("loa").style.display = \'none\'; }</script>');
	ZobrazitMapu.document.write('<body onLoad="window.focus(); UkazText();" bgcolor="#ffffff" text="#000000" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bottommargin="0">');
	ZobrazitMapu.document.write('<div id="loa" align="center" style="position:absolute;width:100%;font-size:100%;font-family:arial;"><div style="height:'+String(winheigh/2.5)+'px;"></div><b>Načítání mapy ...</b></div>');
	ZobrazitMapu.document.write('<a href="javascript:window.close();">');
	ZobrazitMapu.document.write('<img src="' + picture + '" border="0" id="foto" alt="Zavřít okno" width="'+winwidth+'" height="'+winheigh+'" hspace="0" vspace="0">');
	ZobrazitMapu.document.write('</a></body></html>');
	ZobrazitMapu.document.close();
	return false;
}
function setblock() {
	
	var step = 10; 
	if (document.all.footer.style.posTop == 0) document.all.footer.style.posTop = document.body.scrollTop + document.body.offsetHeight;

	endtop = document.body.scrollTop + document.body.offsetHeight - 33; 
	aktualtop = document.all.footer.style.posTop; 
	koef = (endtop - aktualtop) / step; 
	if (koef > 0) newtop = Math.ceil(koef) + aktualtop; 
	else newtop = Math.floor(koef) + aktualtop;
	document.all.footer.style.posTop = newtop;
	setTimeout('setblock()',20);
}
function isblank(s) 
	{ 
	for (var i=0;i<s.length;i++){ 
		var c=s.charAt(i); 
		if ((c!=' ')&&(c!='\n')&&(c!='\t')) return false; 
	} 
	return true; 
	} 
function ZkontrolujSearch(hledej)
	{
	if ((isblank(objGet('what').value)) || (objGet('what').value==hledej)) { 
		alert("Zadejte prosím hledaný text.");
		return false;
	}else {
		var obraz=document.getElementsByTagName('form');
		for (var i=0;i<obraz.length;i++){ 
		if (obraz[i].name=='srch') obraz[i].submit();
		}
	}
    	}
function ControlSearch(){
if ((event.keyCode >90 && event.keyCode <97) || (event.keyCode >122 && event.keyCode <127) || (event.keyCode >32 && event.keyCode <48) || (event.keyCode >57 && event.keyCode <65)) event.returnValue = false;
}
function objGet(x) {
	if (Boolean(document.getElementById)) return document.getElementById(x);
	else if (Boolean(document.all)) return eval('document.all.'+x);
	else if (Boolean(document.ids)) return eval('document.ids.'+x);
	else return null;
}
function PrehodKontakty(akt, neakt){
		objGet(akt).style.display='';
		objGet(neakt).style.display='none';
}
function FormOnload(focpole) {
	var foc = objGet(focpole);
	foc.focus();
	foc.select();
}
function winH() {
if (window.innerHeight) return window.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight;
else if (document.body && document.body.clientHeight) return document.body.clientHeight;
else return null;
}
function winW() {
if (window.innerWidth) return window.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth;
else if (document.body && document.body.clientWidth) return document.body.clientWidth;
else return null;
}
function ZmenOdsazeni(obj, dh, dw){
var ho = winH();
var ch = Math.floor((ho - dh)/11);
ch = Math.floor(ch / 2)*11;
ch = ch - testop;
if (ch < 0) ch=0;
objGet(obj).style.margin = ch + 'px 0px 0px 0px';
}
function ZmenOdsazeniStranky(){
window.onresize = ZmenOdsazeniStranky;
var ho  = winH();
var ch  = Math.floor((ho - dh)/11);
ch = Math.floor(ch / 2)*11;
ch = ch - testop;
if (ch < 0) ch=0;
objGet('odsazdiv').style.margin = ch + 'px 0px 0px 0px';
}
function nic() {
//return;
}
function ZmenPopisObr(newsrc){
objGet('popispic').src='vyrobrazky/' + newsrc;
}
function VlozitFlash(flashfile){
var hrv = DetectFlashVer(6, 0, 0);
if (hrv) { flashtst=1 ;
}else{ flashtst=0; };
if (flashtst==1){
var objfl=objGet('flashobj');
var vlfl = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" WIDTH=764 HEIGHT=234>';
vlfl += '<PARAM NAME=movie VALUE="' + flashfile + '"><PARAM NAME=quality VALUE=high>';
vlfl += '<EMBED src="' + flashfile + '" quality=high bgcolor="#FFFFFF" WIDTH=764 HEIGHT=234 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
//alert(objfl.innerHTML + ' - ' + flashtst + ' - ' + vlfl);
objfl.innerHTML = vlfl;
}
}
function UvodniFlash(flashfile){
var hrv = DetectFlashVer(6, 0, 0);
if (hrv) { flashtst=1 ;
}else{ flashtst=0; };
if (flashtst==1){
var objfl=objGet('uvodflash');
var vlfl = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" WIDTH=654 HEIGHT=305>';
vlfl += '<PARAM NAME=movie VALUE="' + flashfile + '"><PARAM NAME=quality VALUE=high>';
vlfl += '<EMBED src="' + flashfile + '" quality=high bgcolor="#FFFFFF" WIDTH=654 HEIGHT=305 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
//alert(objfl.innerHTML + ' - ' + flashtst + ' - ' + vlfl);
objfl.innerHTML = vlfl;
}
}

function NastavPos(npos) {
pospos = npos;
for (var j = 1; j <= pocp; j++){
if (j==npos) {
objGet('pospic' + j).src          = 'img/posuvjez.gif';
objGet('pospic' + j).style.cursor = 'default';
objGet('pospic' + j).style.width  = velkav + 'px';
}else{
objGet('pospic' + j).src          = 'img/bl.gif';
objGet('pospic' + j).style.cursor = 'pointer';
objGet('pospic' + j).style.width  = malav + 'px';
}}
var prvni  = pospos;
var posled = pospos + zobrv - 1;
for (var k = 1; k <= pocv; k++){
if (k >= prvni && k <= posled) {
objGet('pic' + k).style.display   = '';
}else{
objGet('pic' + k).style.display   = 'none';
}}
}

function PosunObrVl() {
if (pospos == 1)         npos = pocp;
else if (pospos > 1)     npos = pospos - 1;
else                     return;
NastavPos(npos);
}

function PosunObrVp() {
if (pospos == pocp)      npos = 1;
else if (pospos < pocp)  npos = pospos + 1;
else                     return;
NastavPos(npos);
}
function ZobrazDetail(title){
var crossobj=document.getElementById? document.getElementById("content") : document.all.content
contentheight=crossobj.offsetHeight;
contentwidth=crossobj.offsetWidth;

scw = window.screen.availWidth;
sch = window.screen.availHeight;
winwidth=contentwidth;
winheigh=contentheight;
//alert(winwidth + ' - ' + winheigh + ' --- ' + sch + ' - ' + scw);

if (winwidth>scw)	{
	winheigh=(scw/winwidth)*winheigh;
	winwidth=scw;	}
if (winheigh>sch)	{
	winwidth=(sch/winheigh)*winwidth;
	winheigh=sch;	}
//wtop=(sch/2)-(winheigh/2); if (wtop<0) wtop=0;
//wleft=(scw/2)-(winwidth/2); if (wleft<0) wleft=0;

wtop2=(sch/2)-228; if (wtop2<0) wtop2=0;
wleft2=(scw/2)-441; if (wleft2<0) wleft2=0;

wtop = wtop2 + 110;
wleft = wleft2 + 555;
//alert(wtop2 + ' - ' + wleft2 + ' : ' + wtop + ' - ' + wleft);
if ((wtop + winheigh) > sch) wtop = sch - winheigh; if (wtop<0) wtop=0;
if ((wleft + winwidth) > scw) wleft= scw - winwidth;  if (wleft<0) wleft=0;

//xx=window.open('', 'Detaily', 'resizable=0, status=0, menubar=0, scrollbars=0, location=0, directories=0, width='+contentwidth+', height='+(contentheight+5)+', top='+wtop+', left='+wleft);
//xx.close();
ZobrazitDetail = window.open('', 'Detaily', 'resizable=0, status=0, menubar=0, scrollbars=0, location=0, directories=0, width='+contentwidth+', height='+(contentheight+5)+', top='+wtop+', left='+wleft);
ZobrazitDetail.document.write('<html><head><title>' + title + '</title><link rel="stylesheet" href="style.css" type="text/css"></head>');
ZobrazitDetail.document.write('<body onblur="window.close();" onclick="window.close();" onLoad="window.focus(); " bgcolor="#ffffff" text="#000000" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bottommargin="0">');
// window.moveTo(' + wleft + ', ' + wtop + '); window.resizeTo(' + (contentwidth+15) + ', ' + (contentheight+15) + ');
ZobrazitDetail.document.write(crossobj.innerHTML);
ZobrazitDetail.document.write('</body></html>');
ZobrazitDetail.document.close();
}

function Tabulka(){
var crossobj=document.getElementById? document.getElementById("content") : document.all.content
contentheight=crossobj.offsetHeight;
contentwidth=crossobj.offsetWidth;

var contobj=document.getElementById? document.getElementById("content") : document.all.content
alert(contentwidth + ' x ' + contentheight);
}
