	var click_dis = false;

	function roll(item) {
		var pom;
		if (item.classNameRoll) {
			pom = item.classNameRoll;
			item.classNameRoll = item.className;
			item.className = pom;
		} else {
			item.classNameRoll = item.className;
			item.className = 'activ';
		}
	}

	function clickme(item) {
		var pom;
		if (click_dis)
		{
			click_dis = false;
			return;
		}
		if (item.className == item.classNameRoll) {
			item.classNameRoll = item.classNameClick;
			item.className = 'activ';
		} else {
			item.classNameClick = item.classNameRoll
			item.className = 'click';
			item.classNameRoll = 'click';
		}
	}

	function openPage(url, target, width, height) {
		lefti = (window.screen.width / 2) - (width / 2);
		topi = (window.screen.height / 2) - (height / 2);

		options = 'margin=5,scrollbars=yes,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');
		win = window.open(url, target, options);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

		return (typeof(win) != 'object');
	}

	function openImage2()
	{
		var img = this;
		var width  = img.width  + 10;
		var height = img.height + 10;
		
		var lefti = (window.screen.width / 2) - (width / 2);
		var topi = (window.screen.height / 2) - (height / 2);
		

		options = 'margin=0,scrollbars=auto,toolbar=0,resizable=yes,menubar=0'+(width>0&&height>0?',top=' + topi + ',left=' + lefti + ',width=' + width + ',height=' + height:'');
		
		html = '<html><body style="margin:0;padding:0;"><a href="javascript:window.close();"><img src="' + img.src + '" width="'+width+'" height="'+height+'" border="0"></a></body></html>';
		
		win = window.open('', '', options);
		win.document.write(html);
		win.focus();

		//zastaveni pripadneho probublavani
		click_dis = true;

	}
	
	function openImage(imgSrc) {
	    var img = new Image();
		img.onload = openImage2;
	    img.src = imgSrc;
		
		return false;
	}
	
	
	function rezervace(time,item) {
		document.getElementById('rezervace_time').value = time;
		document.getElementById('rezervace_item').value = item; //prostredek
		return true;
	}

	function changediv(div,checkbox)
	{
		document.getElementById(div).style.display = checkbox.checked?(document.all?'block':'table-row'):'none';
	}

	
	function validate(prvek,validate)
	{
		var errorName = 'error-form';
		var className = prvek.className;
		className = className.replace(/error-form/,'');
		//alert(className);

		value = prvek.value;
		if (validate == 'not-empty')
		{
			if (value=='')
				className += ' ' + errorName;
		}

		if (validate == 'email')
		{
			var regular = new RegExp("^[a-zA-Z][a-zA-Z0-9\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$");
			if (!regular.test(value)) className += ' ' + errorName;

		}

		if (validate.substring(0,4)=='reg:')
		{
			if (value.ereg(validate.substring(4,value.length-4))) className += ' ' + errorName;
		}

		prvek.className = className;
	} 
	
	var vsechnyDivy = new Array();
	
	function rozbalovaciNadpisyInit()
	{
		var divs = document.getElementsByTagName('div');

		for (var i=0;i<divs.length;i++)
		{
			if (divs[i].className == 'rozbalovaci_nadpis')
			{
				divs[i].onclick = rozbalovaciNadpisy;
				vsechnyDivy[vsechnyDivy.length] = divs[i];
			}
			if (divs[i].className == 'rozbalovany_text')
			{
				divs[i].style.display = 'none';
				vsechnyDivy[vsechnyDivy.length] = divs[i];
			}
		}
	}

	function rozbalovaciNadpisy(e)
	{
		var th = document.all?window.event.srcElement:e.target;
		//alert(e.target);
		var akt = false;
		for (var i=0;i<vsechnyDivy.length;i++)
		{
			if (vsechnyDivy[i].className == 'rozbalovaci_nadpis')
				akt = (vsechnyDivy[i] ==th);
				
			if (vsechnyDivy[i].className == 'rozbalovany_text')
			{
				vsechnyDivy[i].style.display = akt && vsechnyDivy[i].style.display=='none'?'inline':'none';
			}
		}
	}
	
	window.onload = rozbalovaciNadpisyInit;
	