
 var o, o1, obr1, cis_obr;

 function zmen() {
  if (document.f1.B1 != null) {
	if (document.f1.B1.disabled) {
		 document.f1.B1.disabled = false;
		 document.f1.B1.className = "tlac";         
                document.f1.zamek.value = 0;
	   if (document.f1.pripraveno != null) document.f1.pripraveno.value = "1";
	} else {                    
		document.f1.B1.disabled = true;
		document.f1.B1.className = "tlac disabled";        
                document.f1.zamek.value = 1;
	   if (document.f1.pripraveno != null) document.f1.pripraveno.value = "";
	}
  }
  if (document.f1.B2 != null) {
	if (document.f1.B2.disabled) {
		document.f1.B2.disabled = false;
		document.f1.B2.className = "tlac";
                document.f1.zamek.value = 0;
	 } else {
		document.f1.B2.disabled = true;
		document.f1.B2.className = "tlac disabled";
        document.f1.zamek.value = 1;
	 }
  }
 }




 function over_mail(obj) {	
  if (window.RegExp) {		 // jsou podporovany regularni vyrazy?
	var tempStr = "a";
	var tempReg = new RegExp(tempStr);

    if (tempReg.test(tempStr)) {
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$");

	if (!(r1.test(obj.value)) && !(r2.test(obj.value))) {
		// alert("Špatně zadaná e-mailová adresa.");
		return false;
	}  else return true;
    }
  }
		
  if ((obj.value.indexOf(".") < 3) || (obj.value.indexOf("@") <= 0)) {
		// alert("Špatně zadaná e-mailová adresa.");
		return false;
  } else return true;

 }



 function zobraz(cis) {			
	velky = document.getElementById("vo");
	pop_obr = document.getElementById("id_popis_obr");
	if (velky != null && pop_obr != null) {

		document.forms['fvo'].cis_obr.value = cis;
		pop_obr.style.width = (parseInt(f_sirky[cis])-60) + "px";
		document.forms['fvo'].popis_obr.value = f_popis[cis]+" (foto: "+(parseInt(cis)+1)+"/"+fotky.length+")";

       		velky.style.display = "block";
     		velky.style.width = f_sirky[cis] + 30 + "px";                
       		velky.style.zIndex = "3";

		obr1 = document.getElementById("vo01");    
		obr1.width = f_sirky[cis];
		obr1.height = f_vysky[cis];
		obr1.src = "./img/b-tmsed.png";
      
		o1 = new Image();     
		o1.src = fotky[cis];     		

		casuj = setTimeout("zobraz2('"+fotky[cis]+"',"+cis+")", 100);
	}
 }
 
 function zobraz2(obr,cis) {
	obr1 = document.getElementById("vo01");     	
	if (o1.complete) {
		obr1.src = obr;
        }  else casuj = setTimeout("zobraz2('"+obr+"',"+cis+")", 100);
 }

 function zavri_v() {
	velky = document.getElementById("vo");
	if (velky != null) {
       		velky.style.display = "none";
       		velky.style.zIndex = "-1";
		document.forms['fvo'].cis_obr.value = 0;
		document.forms['fvo'].popis_obr.value = "";

	}
	if (o != null) if (!o.closed) o.close();        
 }


 function zobr_nastr(obr,s,v) { 	
	if (document.getElementById("nastr_obr") != null) {
		obr1 = document.getElementById("nastr_obr");
		obr1.width = s;
		obr1.height = v;
		obr1.src = "./img/b-tmsed.png";
      
		o1 = new Image();     
		o1.src = "./img/"+obr;     		

		casuj = setTimeout("zobr_nastr2('"+obr+"')", 100);
	}
 } 

 function zobr_nastr2(obr) {
	obr1 = document.getElementById("nastr_obr");
	if (o1.complete) {
		obr1.src = "./img/"+obr;
        }  else casuj = setTimeout("zobr_nastr2('"+obr+"')", 100);
 }

