// ===================== MENU ========================
var timer, visibleId = 0;
var dom = document.getElementById ? true : false;
var ie4 = ((document.all) && (!dom)) ? true : false;
var ns4 = document.layers ? true : false;
var opera = navigator.userAgent.indexOf('Opera') != -1 ? true : false;
var dhtml = dom ? true : ie4 ? true : ns4 ? true : false;
	

function regReplace (cim, kde) {
	var regular = new RegExp('open|closed','g');
	return kde.replace(regular, cim);
}

function Hide(element)
{ 
	if (document.getElementById(element)) {
		code = "document.getElementById('" + element + "').style.visibility = 'hidden'; if (document.getElementById('"+element+"a')) {el = document.getElementById('"+element+"a'); el.className = regReplace('closed', el.className);}";
		timer = setTimeout(code,300);
		
	}
}
	
function Show(element)
{
	if (visibleId != 0) {
		document.getElementById(visibleId).style.visibility = 'hidden';
		if (document.getElementById(visibleId+'a')) {
			el = document.getElementById(visibleId+'a');
			el.className = regReplace('closed', el.className);
			//alert('Trida: '+el.className);
		}
	};
	if (document.getElementById(element)) {
		document.getElementById(element).style.visibility = 'visible';
		if (document.getElementById(element+'a')) {
			el = document.getElementById(element+'a');
			el.className = regReplace('open', el.className);
			
			//alert('Trida: '+el.className);
		}
		visibleId = element;
		clearTimeout(timer);
	}
	
}

function stopTimer()
{
	clearTimeout(timer);
}

function openImage(file,gid) {
	window.open('image.php?file='+file+'&gid='+gid,'detail',' width=200, height=200, toolbar=no, location=no, directories=no, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no');
}


function startScrolling()
{
	if ((document.body.clientWidth + document.body.scrollLeft)<document.body.scrollWidth) {
		window.scrollBy(5, 0)
		timer = setTimeout ('startScrolling()', 10);
		scrolling = 1;
	} else {
		scrolling = 0;
	}
}

function stopScrolling() {
	if (scrolling) {
		clearTimeout(timer);
	}
}

/* ====================== PRELOAD ========================= */


function EvalSound(soundobj) {
  var thissound= eval("document."+soundobj);
  thissound.Play();
}

function nota_hraje() 

{
document.write("<div style=\"position:absolute; top:280px; left: 900px; float: left; \">"+
  "<embed src=\"img/music.mp3\" autostart=false width=0 height=0 name=\"sound1\" enablejavascript=\"true\">"+
  "<a href=\"#\" onMouseOver=\"EvalSound('sound1')\">"+
  "<img border=0 SRC=\"img/tecka-trans.gif\" width=\"70\" height=\"70\"></a></div>");

}

function horni_fles()
{
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"301\" height=\"155\" id=\"vnitr_str_v4\" align=\"middle\">"+
"<param name=\"allowScriptAccess\" value=\"sameDomain\" />"+
"<param name=\"movie\" value=\"img/ohen_v5.swf\" /><param name=\"quality\" value=\"high\" /><param loop=\"true\" name=\"bgcolor\" value=\"black\" /><embed src=\"img/ohen_v5.swf\" loop=\"true\" quality=\"high\" bgcolor=\"black\" width=\"301\" height=\"155\" name=\"vnitr_str_v4\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");

}

function horni_fles2()
{
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"159\" height=\"157\" id=\"vnitr_str_v4\" align=\"middle\">"+
"<param name=\"allowScriptAccess\" value=\"sameDomain\" />"+
"<param name=\"movie\" loop=\"true\" value=\"img/regulace_v3.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"img/regulace_v3.swf\" loop=\"true\" quality=\"high\" bgcolor=\"#ffffff\" width=\"159\" height=\"157\" name=\"vnitr_str_v4\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");

}

function horni_fles3()
{
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"301\" height=\"60\" id=\"vnitr_str_v4\" align=\"middle\">"+
"<param name=\"allowScriptAccess\" value=\"sameDomain\" />"+
"<param name=\"movie\" loop=\"true\" value=\"img/cinnost_v4.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#A9A8A8\" /><embed src=\"img/cinnost_v4.swf\" loop=\"true\" quality=\"high\" bgcolor=\"#A9A8A8\" width=\"301\" height=\"60\" name=\"vnitr_str_v4\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");

}

