function fk(a,b)
{
   txb="url(menu/grafika/stin-hlav-b.jpg)";
   if (b==0) {txb="url(menu/grafika/pruhled.gif)"; }
   a.style.backgroundImage = txb;          
}

function fk1(obr,nov)
{
   document.images[obr].src='menu/grafika/kost'+nov+'.jpg';
}

function fim(obr,nov)
{
   document.images[obr].src=nov;
}

function pozadijava(a,b)
{
tx='';
tx1="dv"+a;
if (b==1) { tx="url(menu/grafika/podvyr2.jpg)";  }
if (b==0) { tx="url(menu/grafika/podvyr1.jpg)";  }
//document.getElementById("dv3").style.backgroundImage="";
document.getElementById(tx1).style.backgroundImage=tx; 
//document.getElementById("dv3").innerHTML="";
//document.writeln(tx2);
}


function odeslistranu(a){
   document.kriter.submit();  
}

function vymazit() {
 if (document.kriter.delka.value == "vyhledat...") { document.kriter.delka.value ="";}
 if (document.kriter.delka.value == "search...") { document.kriter.delka.value ="";}
}


function setSlide(index) {
    $('.slajdic3').cycle(index);
  }


function zapni() {

document.writeln('aa');

}


var slajdcislo=3;

function slajdik3(a){
slajdcislo=3;
if (a==1) {
       fim('umv1','menu/grafika/umyv1v.jpg');
       fim('umv2','menu/grafika/umyv2v.jpg');
       fim('umv3','menu/grafika/umyv3v.jpg');
       fim('umv4','menu/grafika/umyv4v.jpg');
        //setSlide(0);
        document.getElementById('slajdic3a').style.backgroundColor='#BCC5E5';
        document.getElementById('slajdic3a').onclick=function (){window.open('pdf/riho_umyvadla.pdf');};
        document.getElementById('slajdic3a').style.visibility='visible';         
   }

if (a==0) {
         document.getElementById('slajdic3a').style.visibility='hidden';           
   }
}


function slajdik4(a){
slajdcislo=4;
if (a==1) {
        fim('umv1','menu/grafika/ros1v.jpg');
        fim('umv2','menu/grafika/ros2v.jpg');
        fim('umv3','menu/grafika/ros3v.jpg');
        fim('umv4','menu/grafika/ros4v.jpg');
        //setSlide(0);
        document.getElementById('slajdic3a').style.backgroundColor='#FFFFFF';
        document.getElementById('slajdic3a').onclick=function (){window.open('pdf/riho_zlaby.pdf');};
        document.getElementById('slajdic3a').style.visibility='visible';
                 
   }

if (a==0) {
         document.getElementById('slajdic3a').style.visibility='hidden';           
   }
}


function slajdik34(a){

if (a==1) {       
        document.getElementById('slajdic3a').style.visibility='visible';                 
   }

if (a==0) {
         document.getElementById('slajdic3a').style.visibility='hidden';           
   }

}


function otevri_okno(naz) {
  var width = 710;
  var height = screen.height-120-80;
  if (height<640) { height=640;}
  if (height>screen.height) { height=screen.height;}
  x = parseInt(screen.width / 2.0) - (width / 2.0);
  y = parseInt(screen.height / 2.0) - (height / 2.0);
  imPopup = window.open(naz, '', 'top=' + y + ',left=' + x + ',width='+ width +', height='+ height +', resizable=1,status=1,scrollbars=1');
  imPopup.focus();
return false;
}




function kontrolasouteze() {

a=1;
if (document.formsoutez.jmeno.value == '') { a=0; }
if (document.formsoutez.prijmeni.value == '') { a=0; }
if (document.formsoutez.adresa.value == '') { a=0; }
if (document.formsoutez.datum_narozeni.value == '') { a=0; }
if (document.formsoutez.email.value == '') { a=0; }
if (document.formsoutez.telefon.value == '') { a=0; }

if (document.formsoutez.fotka1.value == '') { a=0; }
if (document.formsoutez.fotka2.value == '') { a=0; }
if (document.formsoutez.fotka3.value == '') { a=0; }
if (document.formsoutez.doklad.value == '') { a=0; }

if (a==0) { alert('Je nutné vyplnit všechny údaje a přiložit 3 fotky a doklad!'); 
		return false;
	}
	
 a=1;	
 if (document.formsoutez.kod.value == '') { a=0; }	
 if (a==0) { alert('Je nutné opsat kontrolní KOD!'); 
		return false;
	}

 a=1;	
 if (document.formsoutez.rad1.checked == false) { a=0; }	
 if (a==0) { alert('Musíte zaškrtnout souhlas s podmínkami soutěže!'); 
		return false;
	}

  
 a=1;
 //sometext.toLowerCase();
 text=document.formsoutez.fotka1.value;
 text=text.toLowerCase();
 if ((text.indexOf(".jpg") == -1)&&(text.indexOf(".jpeg") == -1)) { a=0; } 

 text=document.formsoutez.fotka2.value;
 text=text.toLowerCase();		
 if ((text.indexOf(".jpg") == -1)&&(text.indexOf(".jpeg") == -1)) { a=0; }
 
 text=document.formsoutez.fotka3.value;
 text=text.toLowerCase();		
 if ((text.indexOf(".jpg") == -1)&&(text.indexOf(".jpeg") == -1)) { a=0; }

 text=document.formsoutez.doklad.value;
 text=text.toLowerCase();		
 if ((text.indexOf(".jpg") == -1)&&(text.indexOf(".jpeg") == -1)) { a=0; }

 if (a==0) { alert('Všechny 3 fotky i doklad musí být ve formátu JPEG nebo JPG!'); 
		return false;
	}

return true;

}


function kontrolasouteze2() {

a=1;
if (document.formsoutez.jmeno.value == '') { a=0; }
if (document.formsoutez.prijmeni.value == '') { a=0; }
if (document.formsoutez.adresa.value == '') { a=0; }
if (document.formsoutez.datum_narozeni.value == '') { a=0; }
if (document.formsoutez.email.value == '') { a=0; }
if (document.formsoutez.telefon.value == '') { a=0; }

if (document.formsoutez.doklad.value == '') { a=0; }

if (a==0) { alert('Je nutné vyplnit všechny údaje, přiložit doklad a odpovědět na všechny 3 otázky!'); 
		return false;
	}
	
 a=1;	
 if (document.formsoutez.kod.value == '') { a=0; }	
 if (a==0) { alert('Je nutné opsat kontrolní KOD!'); 
		return false;
	}

 a=1;	
 if (document.formsoutez.rad1.checked == false) { a=0; }	
 if (a==0) { alert('Musíte zaškrtnout souhlas s podmínkami soutěže!'); 
		return false;
	}

  
 a=1;
 //sometext.toLowerCase();
 
 text=document.formsoutez.doklad.value;
 text=text.toLowerCase();		
 if ((text.indexOf(".jpg") == -1)&&(text.indexOf(".jpeg") == -1)) { a=0; }

 if (a==0) { alert('Doklad musí být ve formátu JPEG nebo JPG!'); 
		return false;
	}

return true;

}

function odesilamf(){

}

function odeslatf(){
if (kontrolasouteze()==true) {
     document.formsoutez.submit();
     document.getElementById("odeslatik").href ="javascript:odesilamf();";
     document.getElementById("odeslatik").innerHTML ="** FORMULÁŘ SE ODESÍLÁ **";
    }

}


function odeslatf2(){
if (kontrolasouteze2()==true) {
     document.formsoutez.submit();
     document.getElementById("odeslatik").href ="javascript:odesilamf();";
     document.getElementById("odeslatik").innerHTML ="** FORMULÁŘ SE ODESÍLÁ **";
    }

}

