function otevri_okno_foto()
{
	msg = window.open('','nove_okno_foto', 'toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,resizable=yes,status=no,width=700,height=700');
	msg.focus();
}

function ukazat(id) {
	var test = document.forms["uvod"].m.value;

	if (test==''){
		document.getElementById('uvod_kategorie'+id).className='uvod_kategorie_a';
		document.getElementById('uvod_popis'+id).style.display='block';
	}
	else if (test!=id) {
		document.forms["uvod"].m.value = '';
		document.getElementById('uvod_kategorie'+id).className='uvod_kategorie_a';
		document.getElementById('uvod_popis'+id).style.display='block';
	}
}

function schovat(id) {
	document.getElementById('uvod_kategorie'+id).className='uvod_kategorie_na';
	document.getElementById('uvod_popis'+id).style.display='none';
}

function schovat_x(id,id_pom) {
	document.getElementById('uvod_kategorie'+id).className='uvod_kategorie_na';
	document.getElementById('uvod_popis'+id).style.display='none';
	document.forms["uvod"].m.value = id_pom;
}
function nulovani() {
	document.forms["uvod"].m.value = '';
}




function fade_in(id) {
	var celkova_vyska	= document.body.scrollHeight;
	var od_scroll		= document.body.scrollTop;

	var vyska_okna		= document.body.clientHeight;
	var sirka_okna		= document.body.clientWidth;

	var horni_odsazeni	= (od_scroll + ((vyska_okna/2)-150));
	var leve_odsazeni	= (sirka_okna/2)-150;


	var nazev_divu	= 'dostupnost_formular';
	var url_scriptu	= './dostupnost_formular.php?id='+id;

	var httpRequest;

	if(typeof window.ActiveXObject != 'undefined')
	{
	    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
	    httpRequest = new XMLHttpRequest();
	}
	httpRequest.open("GET", url_scriptu, true);
	httpRequest.onreadystatechange= function () 
	{

	    if (httpRequest.readyState == 4)
	    {
	        if(httpRequest.status == 200)
	        {
				document.getElementById(nazev_divu).innerHTML = httpRequest.responseText;
	        }
	        else
	        {
	            alert("Chyba pri nacitani stanky " + httpRequest.status +" : "+ httpRequest.statusText);
	        }
	    }

	}
	httpRequest.send(null);



	document.getElementById('dostupnost_zasednuti').style.height=celkova_vyska+'px';

	document.getElementById('dostupnost_formular').style.top=horni_odsazeni+'px';
	document.getElementById('dostupnost_formular').style.left=leve_odsazeni+'px';

	document.getElementById('dostupnost_zasednuti').style.display='block';
	document.getElementById('dostupnost_formular').style.display='block';

	var test	= document.getElementById('zoomer');
	if (test != null) {
		document.getElementById('zoomer').style.visibility='hidden';
	}
	var test	= document.getElementById('banner_uvod');
	if (test != null) {
		document.getElementById('banner_uvod').style.visibility='hidden';
	}
}
function fade_out() {
	document.getElementById('dostupnost_zasednuti').style.display='none';
	document.getElementById('dostupnost_formular').style.display='none';
	var test	= document.getElementById('zoomer');
	if (test != null) {
		document.getElementById('zoomer').style.visibility='visible';
	}
	var test	= document.getElementById('banner_uvod');
	if (test != null) {
		document.getElementById('banner_uvod').style.visibility='visible';
	}
}

function dostupnost() {
	var email		= document.forms["formular"].email.value;
	if (email == "") {
		alert("Vyplňte prosím Váš email.");
	}
	else {
		var id			= document.forms["formular"].id.value;
		var nazev_divu	= 'dostupnost_formular_form';

		var url_scriptu	= './dostupnost_odeslat.php?email='+email+'&id='+id;


		var httpRequest;

		if(typeof window.ActiveXObject != 'undefined')
		{
		    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}
		else
		{
		    httpRequest = new XMLHttpRequest();
		}
		httpRequest.open("GET", url_scriptu, true);
		httpRequest.onreadystatechange= function () 
		{

		    if (httpRequest.readyState == 4)
		    {
		        if(httpRequest.status == 200)
		        {
					document.getElementById(nazev_divu).innerHTML = httpRequest.responseText;
		        }
		        else
		        {
		            alert("Chyba pri nacitani stanky " + httpRequest.status +" : "+ httpRequest.statusText);
		        }
		    }

		}
		httpRequest.send(null);
	}

	return false;
}


function video(typ,id_zbo,id_vid) {
	var nazev_divu	= 'detail_video';

	document.getElementById(nazev_divu).style.backgroundImage = 'url(./images/loading.gif)';
	document.getElementById(nazev_divu).style.backgroundRepeat = 'no-repeat';
	document.getElementById(nazev_divu).style.backgroundPosition = '100% 3px';

	if (typ == 'hawaj') {
		var url_scriptu	= './video_hawaj.php?id_zbo='+id_zbo;
	}
	else if (typ == 'youtube') {
		var url_scriptu	= './video_youtube.php?id_zbo='+id_zbo+'&id_vid='+id_vid;
	}

	var httpRequest;

	if(typeof window.ActiveXObject != 'undefined')
	{
	    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
	    httpRequest = new XMLHttpRequest();
	}
	httpRequest.open("GET", url_scriptu, true);
	httpRequest.onreadystatechange= function () 
	{

	    if (httpRequest.readyState == 4)
	    {
	        if(httpRequest.status == 200)
	        {
				document.getElementById(nazev_divu).innerHTML = httpRequest.responseText;
	        }
	        else
	        {
	            alert("Chyba pri nacitani stanky " + httpRequest.status +" : "+ httpRequest.statusText);
	        }
	    }

	}
	httpRequest.send(null);

	setTimeout("loading()", 500);
}
function loading() {
	var nazev_divu	= 'detail_video';
	document.getElementById(nazev_divu).style.backgroundImage = 'none';
}


function foto_zobraz(rowf) {
	document.getElementById('detail_foto').style.backgroundImage = 'url(./images/loading.gif)';
	document.getElementById('detail_foto').style.backgroundRepeat = 'no-repeat';
	document.getElementById('detail_foto').style.backgroundPosition = '100% 3px';

	var nazev_divu	= 'detail_foto_zobraz';
	var url_scriptu	= './detail_foto.php?rowf='+rowf;

	var httpRequest;

	if(typeof window.ActiveXObject != 'undefined')
	{
	    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
	    httpRequest = new XMLHttpRequest();
	}
	httpRequest.open("GET", url_scriptu, true);
	httpRequest.onreadystatechange= function () 
	{

	    if (httpRequest.readyState == 4)
	    {
	        if(httpRequest.status == 200)
	        {
				document.getElementById(nazev_divu).innerHTML = httpRequest.responseText;
	        }
	        else
	        {
	            alert("Chyba pri nacitani stanky " + httpRequest.status +" : "+ httpRequest.statusText);
	        }
	    }

	}
	httpRequest.send(null);
	return false;
}

function foto_zobrazeno() {
	document.getElementById('detail_foto').style.backgroundImage = 'none';
}

