//funkce pro header menu
var predClass;
var reload;
function clearHlaska(){
	var inputmail = document.getElementById('newsletteremail');
	if(
	inputmail.value == "Zadejte Váš email." ||
	inputmail.value == "Email byl zaregistrován." ||
	inputmail.value ==  "Váš email je již registrován." ||
	inputmail.value == "Chybný formát emailové adresy."){
		inputmail.value = '';
	}
}
var id_set_headline = 0;
	function setHeadline(id){
		if(id == id_set_headline){return};

		var pred = "headline_";

		$('#'+pred+id_set_headline).animate({ opacity: 0.0 }, 600, function(){$(this).addClass("none");});
		$('#'+pred+id).removeClass('none');
		$('#'+pred+id).css("opacity",0.0);
		$('#'+pred+id).animate({ opacity: 1.0 },{duration: 600,step: function(){$(this).removeClass("none");}});

		$('#linehead').removeClass("active_"+id_set_headline);
		$('#linehead').addClass("active_"+id);
		id_set_headline = id;
	}
/*
function setHeadline(id){
	var pred = "headline_";
	for(var a = 0;a < 3;a++){
		var obj = document.getElementById(pred+a);
		if(obj != null){obj.className = 'none';}
	}
	var obj = document.getElementById(pred+id);
	if(obj != null){
		obj.className = '';
		document.getElementById('linehead').className = "active_"+id;
	}
}
*/
function show_unshow_div(id){
	var div = document.getElementById(id);
	if(div.style.display == 'none'){
		div.style.display = '';
	}else{
		div.style.display = 'none'
	}
}
function show_iframe_foto(values,file){
	scrollset();
	if(file == null){var file = "iframe-foto.php";}else{file += '.php';}
	var iframe = document.getElementById('frame_bg');
	var iframeReal = document.getElementById('frame_foto');
	iframe.style.display = 'block';
	//if(navigator.appName == "Opera"){document.getElementById('body').onScroll = 'window.scroll(0, 0)';}
	iframeReal.style.display = 'block';
	var realframe = document.getElementById('foto_iframe_data');
	html='<iframe id="iframe_foto_real" frameborder="0" src="'+file+'?'+values+'"></iframe>';
	realframe.innerHTML = html;
	document.getElementById('body').style.overflow = 'hidden';
	window.onscroll= function(){window.scroll(0, 0);}
	document.getElementById('id_html').style.overflow = 'hidden';
	window.scroll(0, 0) ;
}
function unshow_iframe_foto(){
	var iframe = document.getElementById('frame_bg');
	var realframe = document.getElementById('foto_iframe_data');
	var iframeReal = document.getElementById('frame_foto');
	//if(navigator.appName == "Opera"){document.getElementById('body').onScroll = '';}
	iframe.style.display = 'none';
	iframeReal.style.display = 'none';
	realframe.innerHTML = "";
	document.getElementById('body').style.overflow = 'auto';
	document.getElementById('id_html').style.overflow = 'auto';
	window.onscroll= null;
	window.scroll(0, theTop) ;
	if(reload == true){
		location.href = location.href;
	}
}

function scrollset(){
		if (document.documentElement && document.documentElement.scrollTop){
			theTop = document.documentElement.scrollTop;
		}else if(document.body){
			theTop = document.body.scrollTop;
		}

}

function kontrolaFormSeminar(){
	var jmeno = document.getElementById('jmeno').value;
	var email = document.getElementById('email').value;
	if(jmeno == '' || prijmeni == '' || (email == '' /*&& telefon ==''*/)){
		alert("Musíte vyplnit: jméno, přijmení, e-mail nebo telefon.");
		return false;
	}
	return true;
}
var idUvod = 0;
  $(document).ready(function(){
  	shamDeathBox();
  	var rychlost = 200;
  	$(".aktuvodimg").css("opacity",0.7);
  	$(".aktuvodimg").mouseenter(function(){
  		$(".aktuvodinner").addClass('none');
  		$(".aktuvodimg").animate({opacity : 0.7}, rychlost);

  		id = $(this).attr("id");idUvod = id =  id.replace("aktimg_","");

  		$("#akttext_"+id).removeClass('none');

  		$(this).animate({opacity: 1},rychlost);
  	}).mouseleave(function(){
  		//$(this).animate({opacity: 0.7},rychlost,function(){$("#akttext_"+idUvod).addClass('none');});
  	});


  	$(".aktuvodheadlineimages").mouseenter(function(){

  		$("#dataaktuvod").css("line-height","normal");
  		$("#dataaktuvod").animate({height: '150px'},rychlost);
  		$(".headline_uvod").children("div").children(".unshowclass").css("visibility","hidden");

  	}).mouseleave(function(){
  		$("#dataaktuvod").animate({height: 0},rychlost,function(){$("#dataaktuvod").css("line-height","0");});
  		$(".headline_uvod").children("div").children(".unshowclass").css("visibility","visible");
  		$(".aktuvodimg").animate({opacity : 0.7}, rychlost);
  		$(".aktuvodinner").addClass('none');
  	});


  });
