
 var obr1;

 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 zobraz(obr, s, v) {
	obr1 = document.getElementById("jr01");    
	obr1.width = s;		
	obr1.height = v;
	obr1.src = "./img/b-tmsed.png";
      
	o1 = new Image();     
	o1.src = "."+obr;

	casuj = setTimeout("zobraz2('"+obr+"')", 100);
 }
    
 function zobraz2(obr) {
	obr1 = document.getElementById("jr01");
	if (o1.complete) {
       		obr1.src = "."+obr;
   } else id = setTimeout("zobraz2('"+obr+"')", 100);
 }	    
    

 function nahled(nahl_obr, zobrazit) {
  tmpx = document.getElementById("nahl"); 

   if (zobrazit) {	
     tmpy = document.getElementById("nahl_obr");
	tmpy.src = nahl_obr; 
   }  
  tmpx.className = "odk_nahled_"+((zobrazit) ? "a" : "n");


 }


 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 zmen_jazyk(lang) {
	var puv, novy, poz, poz2;

   if (lang == "cz") novy = "/"; else novy = "/"+lang+"/";

	if (location.href.indexOf("/en/") > 1) puv = "/en/";
	 else if (location.href.indexOf("/ru/") > 1) puv = "/ru/";
	  else  puv = "/";


   if (novy != puv) {

     if (lang == "cz" || puv == "/") {
	poz2 = location.href.lastIndexOf("/");
	if (puv != "/") poz = location.href.substring(0, poz2).lastIndexOf("/");
	  else poz = poz2;

	location.href = location.href.substring(0, poz) + novy + location.href.substring(poz2+1, location.href.length);

     } else {
	location.href = location.href.replace(puv, novy);
       }	
   }

 }

