
/*
** Check Diskuze
*/

function checkPoradna() {

	f = document.forms["InsOt"];
        
	mail = "^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+[\.]{1}[a-zA-Z]{2,4}$";
	
	if (f.jmeno.value == ""){
		alert("Vyplňte prosím vaše jméno a příjmení.");
		f.jmeno.focus();
		return false;
	}
	
	if (f.email.value == ""){
		alert("Vyplňte prosím váš email.");
		f.email.focus();      
		return false;
	}
	if (!f.email.value.match(mail)) {
		alert ("Neplatný formát e-mailové adresy.");
		f.email.focus();
		return false;
	}
	
// 	if (f.dotaz.value == ""){
// 		alert("Vyplňte prosím dotaz.");
// 		f.dotaz.focus();
// 		return false;
// 	}
	
	if (f.text.value == ""){
		alert("Vyplňte prosím obsah dotazu.");
		f.text.focus();      
		return false;
	}
	return true;
} 
            
           
function checkReg(f) {

//	f = document.forms["InsUs"];
//	f = form;

	mail = "^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+[\.]{1}[a-zA-Z]{2,4}$";
	
	if (f.jmeno.value == ""){
		alert("Vyplňte prosím vaše jméno .");
		f.jmeno.focus();
		return false;
	}
	
	if (f.prijmeni.value == ""){
		alert("Vyplňte prosím vaše příjmení.");
		f.prijmeni.focus();
		return false;
	}
	
	if (f.ulice.value == ""){
		alert("Vyplňte prosím vaši ulici.");
		f.ulice.focus();      
		return false;
	}
	
	if (f.obec.value == ""){
		alert("Vyplňte prosím vaši obec.");
		f.obec.focus();      
		return false;
	}
	
	if (f.psc.value == ""){
		alert("Vyplňte prosím vaše PSČ.");
		f.psc.focus();      
		return false;
	}
	
	if (f.email.value == ""){
		alert("Vyplňte prosím váš email.");
		f.email.focus();      
		return false;
	}	
	
	if (!f.email.value.match(mail)) {
		alert ("Neplatný formát e-mailové adresy.");
		f.email.focus();
		return false;
	}

	if ((f.pass1.value != f.pass2.value) || (f.pass1.value == "") || (f.pass2.value == "")){
		alert("Heslo a potvrzení hesla musejí být vyplněná a shodná.");
		f.pass1.focus();
		return false;
	}

	if (!f.souhlas.checked) {
		alert("Souhlas se zpracováním Vašich osobních údajů je nezbytný pro dokončení registrace. Zaškrtněte prosím příslušné políčko.");
		f.pass1.focus();
		return false;
	}
	
	return true;
}


function oChildAgeSelect(eID) {
	var e = document.getElementById(eID);

	if (!e.style.visibility) {
		e.style.visibility = "hidden";
		e.style.top = "";
		e.style.bottom ="133px";
	}
	else if (e.style.visibility == "hidden") {
		e.style.visibility = "visible";
		e.style.top = "20px";
		e.style.bottom = "";
	}
	else if (e.style.visibility == "visible") {
		e.style.visibility = "hidden";
		e.style.top = "";
		e.style.bottom = "133px";
	}
}


function selectChildAge(value_form, value_text) {
	var e = document.getElementById('kalendar_selected');
	var f = document.forms["kalendar"];

	e.firstChild.nodeValue = value_text;
	f.vek_decka.value      = value_form;

	oChildAgeSelect('kalendar_select');
	return false;
}

function fotoview(obrazek,popis,sirka,vyska) {
  var browser = navigator.appName
  var verze = parseInt(navigator.appVersion)
  if ((browser == "Microsoft Internet Explorer" & verze >= 4) | (browser == "Netscape" & verze >= 4)){
    winW = screen.availHeight;//screen.width;
    winH = screen.availWidth;//screen.height;
  }else{
    winW = 640 ;
    winH = 480 ;
  }
  var scrb = ((sirka > winW ) || (vyska > winH )) ? 'yes' : 'no' ;

  okno_fotka = window.open("fotoview.php?img="+obrazek+"&popis="+popis+"&sirka="+sirka+"&vyska="+vyska+"","okno_fotka","width=" + sirka + ",height=" + vyska + ",menubar=no,directories=no,toolbar=no,location=no,status=no,scrollbars="+scrb+",resizable=no");
  okno_fotka.focus();
}



/*
** Check Připomínek
*/

function checkPripominky() {

	f = document.forms["form_pripominky"];

	mail = "^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+[\.]{1}[a-zA-Z]{2,4}$";

	if (f.jmeno.value == ""){
		alert("Vyplňte prosím vaše jméno a příjmení.");
		f.jmeno.focus();
		return false;
	}

	if (f.email.value == ""){
		alert("Vyplňte prosím váš email.");
		f.email.focus();
		return false;
	}
	if (!f.email.value.match(mail)) {
		alert ("Neplatný formát e-mailové adresy.");
		f.email.focus();
		return false;
	}

	if (f.text.value == ""){
		alert("Vyplňte prosím obsah dotazu.");
		f.text.focus();
		return false;
	}
	return true;
}



/*
**    zobrazování Bloku s výhodným nákupem
*/

function znova_zobraz_BVN(){
  dejDalsi = setInterval(zobraz_BVN, 5000); //proved funkci vždy po 5sekundách (5000 milisek)
}

function zobraz_BVN(){
  var pocitadlo_BVN = 0;
  var jeBlok = false;
  
  for (i=1; i < 11; i++){
    if (document.getElementById("blok_"+i)){
      pocitadlo_BVN++;
      document.getElementById("blok_"+i).style.visibility = "hidden";
      document.getElementById("blok_"+i).style.display = "none";
      jeBlok = true;
    }
  }
  if (jeBlok){
    BVN_ON = Math.ceil(Math.random() * pocitadlo_BVN);
    document.getElementById("blok_"+BVN_ON).style.visibility = "visible";
    document.getElementById("blok_"+BVN_ON).style.display = "block";
  }
}

function zobraz_deti(){

  document.getElementById('dite03').style.visibility = 'visible';
  document.getElementById('dite03').style.display    = 'block';
  document.getElementById('dite04').style.visibility = 'visible';
  document.getElementById('dite04').style.display    = 'block';
  document.getElementById('dite05').style.visibility = 'visible';
  document.getElementById('dite05').style.display    = 'block';
  document.getElementById('dite06').style.visibility = 'visible';
  document.getElementById('dite06').style.display    = 'block';
  document.getElementById('dite07').style.visibility = 'visible';
  document.getElementById('dite07').style.display    = 'block';
  if (document.getElementById('deti_link_detiOn')){
    document.getElementById('deti_link_detiOn').style.visibility = 'hidden';
    document.getElementById('deti_link_detiOn').style.display    = 'none';
  }
  if (document.getElementById('deti_link_detiOff')){
    document.getElementById('deti_link_detiOff').style.visibility = 'visible';
    document.getElementById('deti_link_detiOff').style.display    = 'block';
  }
}

function skryj_deti(){

  document.getElementById('dite03').style.visibility = 'hidden';
  document.getElementById('dite03').style.display    = 'none';
  document.getElementById('dite04').style.visibility = 'hidden';
  document.getElementById('dite04').style.display    = 'none';
  document.getElementById('dite05').style.visibility = 'hidden';
  document.getElementById('dite05').style.display    = 'none';
  document.getElementById('dite06').style.visibility = 'hidden';
  document.getElementById('dite06').style.display    = 'none';
  document.getElementById('dite07').style.visibility = 'hidden';
  document.getElementById('dite07').style.display    = 'none';
  document.getElementById('deti_link_detiOn').style.visibility = 'visible';
  document.getElementById('deti_link_detiOn').style.display    = 'block';
  document.getElementById('deti_link_detiOff').style.visibility = 'hidden';
  document.getElementById('deti_link_detiOff').style.display    = 'none';

}

function zobraz_bublinu(id){
  if(document.getElementById(id)){
    document.getElementById(id).style.visibility = "visible";
    document.getElementById(id).style.display = "block";
  }
}

function schovej_bublinu(id){
  if(document.getElementById(id)){
    document.getElementById(id).style.visibility = "hidden";
    document.getElementById(id).style.display = "none";
  }
}


/*
  Added by Michal Brauner 18-7-2006
*/
function zdrobnelina_click(id) {
  if(document.getElementById('zdrobneliny_'+id)){
    if (document.getElementById('zdrobneliny_'+id).style.visibility == "visible")
      skryj_zdrobnelinu(id);
    else
      zobraz_zdrobnelinu(id);
  }
}

function zobraz_zdrobnelinu(id) {
  if(document.getElementById('zdrobneliny_'+id)){
    document.getElementById('zdrobneliny_'+id).style.visibility = "visible";
    document.getElementById('zdrobneliny_'+id).style.display = "block";
  }
}

function skryj_zdrobnelinu(id) {
  if(document.getElementById('zdrobneliny_'+id)){
    document.getElementById('zdrobneliny_'+id).style.visibility = "hidden";
    document.getElementById('zdrobneliny_'+id).style.display = "none";
  }
}

function vznik_click(id) {
  if(document.getElementById('vznik_'+id)){
    if (document.getElementById('vznik_'+id).style.visibility == "visible")
      skryj_vznik(id);
    else
      zobraz_vznik(id);
  }
}

function zobraz_vznik(id) {
  if(document.getElementById('vznik_'+id)){
    document.getElementById('vznik_'+id).style.visibility = "visible";
    document.getElementById('vznik_'+id).style.display = "block";
  }
}

function skryj_vznik(id) {
  if(document.getElementById('vznik_'+id)){
    document.getElementById('vznik_'+id).style.visibility = "hidden";
    document.getElementById('vznik_'+id).style.display = "none";
  }
}

function info_click(id) {
  if(document.getElementById('vice_'+id)){
    if (document.getElementById('vice_'+id).style.visibility == "visible")
      skryj_info(id);
    else
      zobraz_info(id);
  }
}

function skryj_info(id) {
  if(document.getElementById('vice_'+id)){
    document.getElementById('vice_'+id).style.visibility = "hidden";
    document.getElementById('vice_'+id).style.display = "none";
    
  }
}

function zobraz_info(id) {
  if(document.getElementById('vice_'+id)){
    document.getElementById('vice_'+id).style.visibility = "visible";
    document.getElementById('vice_'+id).style.display = "block";
  }
}

function viditelnost_tehotnosti(str){

	if (str == "muz"){
		document.getElementById('tehotna_u_zeny').style.display = "none";
		document.getElementById('tehotna_u_zeny').style.visibility = "hidden";
		document.getElementById('tehotna_u_zenyPopis').style.display = "none";
		document.getElementById('tehotna_u_zenyPopis').style.visibility = "hidden";
		document.getElementById('tehotna_ano').checked = "false";
		document.getElementById('tehotna_ne').checked = "true";
	}else{
		document.getElementById('tehotna_u_zeny').style.display = "block";
		document.getElementById('tehotna_u_zeny').style.visibility = "visible";
 		document.getElementById('tehotna_u_zenyPopis').style.display = "block";
		document.getElementById('tehotna_u_zenyPopis').style.visibility = "visible";
	}


}


        function checkMails()
          {
            var f = document.forms["formPohlednice"];
            var mail = "^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+[\.]{1}[a-zA-Z]{2,4}$";

            if (f.odesilatel.value==""){
              alert("Je nutno vyplnit odesílatele.");
              f.odesilatel.focus();
              return false;
            }

          	if (!f.odesilatel.value.match(mail)) {
          		alert ("Neplatný formát e-mailové adresy v poli odesílatel.");
          		f.odesilatel.focus();
          		return false;
          	}

            if (f.prijemce.value==""){
              alert("Je nutno vyplnit příjemce.");
              f.prijemce.focus();
              return false;
            }

          	if (!f.prijemce.value.match(mail)) {
          		alert ("Neplatný formát e-mailové adresy v poli příjemce.");
          		f.prijemce.focus();
          		return false;
          	}

            return true;
          }

function zobraz_blok(id) {
	var blok = document.getElementById(id);
	if(blok){
		if(blok.style.display == "none") {
			blok.style.display = "block";
		} else if(blok.style.display == "block") {
			blok.style.display = "none";
		}	
	}
}

function display_tyden(id) {
	var tyden = document.getElementById("tydny"+id);
	if(tyden){
		if(tyden.style.display == "none") {
			tyden.style.display = "block";
		} else if(tyden.style.display == "block") {
			tyden.style.display = "none";
		}
		for(var i=1; i<10; i++) {
			tyden = document.getElementById("tydny"+i);
			if(i != id) {
				tyden.style.display = "none";
			}
		}
	}
}

function print_flash(path, id, width, height){

  var out;

  out = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
  out+= '       codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
  out+= '       width="'+width+'"';
  out+= '       height="'+height+'"';
  out+= '       id="'+id+'"';
  out+= '       align="middle">';
  out+= ' <param name="allowScriptAccess" value="sameDomain" />';
  out+= ' <param name="movie" value="'+path+'" />';
  out+= ' <param name="quality" value="high" />';
  out+= ' <param name="bgcolor" value="#ffffff" />';
  out+= ' <param name="wmode" value="transparent" />';
  out+= ' <embed src="'+path+'"';
  out+= '        quality="high"';
  out+= '        bgcolor="#ffffff"';
  out+= '        width="'+width+'"';
  out+= '        height="'+height+'"';
  out+= '        name="'+id+'"';
  out+= '        align="middle"';
  out+= '        wmode="transparent"';
  out+= '        allowScriptAccess="sameDomain"';
  out+= '        type="application/x-shockwave-flash"';
  out+= '        pluginspage="http://www.macromedia.com/go/getflashplayer" />';
  out+= '</object>';

  document.write(out);

}
