function JSGetSwfVer(i){
	var flashVer = "";
	return flashVer;
} 

function zalozky_menu(pocet,id){
	var activevalue = "";var id_sel = "";var disp = "";
	for(i = 1;i <= pocet;i++){
		if(i == id){activevalue = "active";var disp = "block";}else{activevalue = "";var disp = "none";}
		id_sel = "zal"+i;id_sel2 = "obsah"+i;
		document.getElementById(id_sel).className = activevalue;
		document.getElementById(id_sel2).style.display = disp;
	}
}

function winOpen(url){
	window.open(url, "window", "toolbar=no,menubar=no,directories=no,scrollbars=yes,status=no,fullscreen,resizable=yes")
}
//funkce pro header menu
var predClass;
function actmenu(id){
	predClass = document.getElementById(id).className;
	document.getElementById(id).className = 'hover'; 
}
function deactmenu(id){
	document.getElementById(id).className = predClass; 
}

//konec header menu

//nastaveni iframe 
var posibleIframeWidth = '70em';
var posibleIframeHeight = '';
var iframeUpWidth = '';
var iframeUpHeight = '';
function onloadpage(){
	var em = 10;//kolik px je font-size v css
	var width = document.getElementById('body').clientWidth;
	var height = winH();
	var change_width = Math.floor(width / 100 * 80);
	var change_height = Math.floor(height / 100 * 80);
	var margin_top = Math.floor(((height - change_height) / 2)/em)-1;//odecet je v em
	
	if(change_width < 750){change_width = 750;}
	if(change_height < 300){change_height = 300;}
	if(margin_top < 0){margin_top = 0;}
	var iframe_up_var = document.getElementById('obsah_iframe_up');
	
	//posibleIframeWidth = (change_width/em)+"em";
	posibleIframeHeight = (change_height/em)+"em";
	iframe_up_var.style.margin = margin_top+"em auto";

}
function winH() {
   if (window.innerHeight)/* NN4 a kompatibilní prohlížeče */
      return window.innerHeight;
   else if
   (document.documentElement &&  document.documentElement.clientHeight) /* MSIE*/
      return document.documentElement.clientHeight;
   else if
   (document.body && document.body.clientHeight)/* starší MSIE + MSIE6 v quirk režimu */
      return document.body.clientHeight;
   else
      return null;
}
var reload = false;
var theTop = '0';
function show_iframe_width_height(values,file,width,height){
	iframeUpWidth = width;
	iframeUpHeight = height;
	show_iframe(values,file);
	iframeUpWidth = '';	iframeUpHeight = '';
}
function show_iframe(values,file){
	scrollset();
	var iframe_up_var = document.getElementById('obsah_iframe_up');	
	if(iframeUpWidth == '' && iframeUpHeight == ''){
		iframe_up_var.style.width = posibleIframeWidth;
		iframe_up_var.style.height = posibleIframeHeight;
	}else{
		iframe_up_var.style.width = iframeUpWidth;
		iframe_up_var.style.height = iframeUpHeight;
	}
	var iframe = document.getElementById('frame_bcas');
	var iframeReal = document.getElementById('frame_bcas_real');
	iframe.style.display = 'block';	
	if(navigator.appName == "Opera"){	iframe.style.background = 'transparent';}	
	iframeReal.style.display = 'block';
	var realframe = document.getElementById('data_iframe');
	if(file == false){
		html='<iframe frameborder="0" src="iframeup.php?str='+globStr+'&amp;'+values+'"></iframe>';
	}else{
		html='<iframe frameborder="0" src="'+file+'?str='+globStr+values+'"></iframe>';
	}
	realframe.innerHTML = html;
	document.getElementById('body').style.overflow = 'hidden';
	document.getElementById('body').onscroll= "scrollTo(0,0)";

	window.scroll(0, 0) ;
}
function unshow_iframe(){
	var iframe = document.getElementById('frame_bcas');
	var realframe = document.getElementById('data_iframe');
	var iframeReal = document.getElementById('frame_bcas_real');
	iframe.style.display = 'none';
	iframeReal.style.display = 'none';
	realframe.innerHTML = "";
	document.getElementById('body').style.overflow = 'auto';

	document.getElementById('body').onscroll= "";
	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 kontrola_dotaz_form(){
	var hlaska = "";
	if(document.getElementById("jmeno_dotaz_form").value == ""){hlaska += "Musí být vyplněno jméno.\n";}
	if(document.getElementById("email_dotaz_form").value  == "" && document.getElementById("tel_dotaz_form").value  == ""){hlaska += "Musí být vyplněn e-mail nebo telefon.\n";}
	if(document.getElementById("dotaz_dotaz_form").value  == "" ){hlaska += "Musí být vyplněn dotaz.\n";}
	if(document.getElementById("antispam_dotaz_form").value  == "" ){hlaska += "Musíte opsat text z obrázku.\n";}
	if(hlaska != ""){alert(hlaska);return false};
	return true;
}

