re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;

Shadowbox.init({
    language:   "cs"
});

$(document).ready(function(){

  $(".ttip").hover(function () {
    $(this).css("z-index","2");
    $(this).find("span").fadeIn("slow");
    return false;
  },
  function () {
    $(this).css("z-index","1");
    $(this).find("span").fadeOut("slow");
    return false;
  });

    $(".showttip2").hover(function () {
    $(this).css("z-index","2");
    $(this).find("span").fadeIn("slow");
    return false;
  },
  function () {
    $(this).css("z-index","1");
    $(this).find("span").css("display","none");
    return false;
  });

	$(function() {
	  $("a[rel^='lightbox']").lightbox();
	});
/* kulate rohy */  
	$('.kulate, h1, h2, #submenu').corner('5px');
	$('.fotoThumbDet').corner('5px');
	
	$('.text, .text1').corner('0 0 5px 5px');

/* tabulka - radky na stridacku */
	$(function() { 
		$("table").find("tr:even").addClass("suda");
		$("table.tabulka").find("tr:even").removeClass("suda");
	});

  /* kalendar */
	$(".skoleni .vice").click(
	  function () {
			$(".skoleni").find(".popisskol").slideUp("fast");
      $(this).parent().parent().find(".popisskol").slideDown("fast");
		}
	);
  /* kalendar */


/* header boxy */
	
	$("#produkt1").css("marginLeft", "0px");
	$(".produktactive:first .bg_desc, .produktactive:first .desc").css("display","block");
	$(".produkt").click(function() {
    if ($(this).hasClass("produktactive") != true) {
			$(".produkt").removeClass("produktactive"); 
	    $(".produkt .bg_desc, .produkt .desc").css("display","none");
	    $(this).addClass("produktactive");
	    $(this).find(".bg_desc").show("fast", function() {
				$(this).parent("div").find(".desc").fadeIn("fast");
			});
		}
  });
});

function kontrola() {
	Firma=document.uprav.Firma.value;
	Jmeno=document.uprav.Jmeno.value;
	Email=document.uprav.Email.value;
	Adresa=document.uprav.Adresa.value;
	Mesto=document.uprav.Mesto.value;
	PSC=document.uprav.PSC.value;
	ICO=document.uprav.ICO.value;

 if (Firma == ""){
			alert("Zadejte prosím firmu");
    document.uprav.Firma.focus();
    document.uprav.Firma.select();
			return false;
			}
 if (Jmeno == ""){
			alert("Zadejte prosim jméno odpovědné osoby");
    document.uprav.Jmeno.focus();
    document.uprav.Jmeno.select();
			return false;
			}
 if ((Email == "") || (Email.indexOf("@")<1)){
			alert("Zadejte prosím email");
    document.uprav.Email.focus();
    document.uprav.Email.select();
			return false;
			}                      
 if (Adresa == ""){
			alert("Zadejte prosim adresu sídla");
    document.uprav.Adresa.focus();
    document.uprav.Adresa.select();
			return false;
			}
 if (Mesto == ""){
			alert("Zadejte prosim město");
    document.uprav.Mesto.focus();
    document.uprav.Mesto.select();
			return false;
			}
 if (PSC == ""){
			alert("Zadejte prosim PSČ");
    document.uprav.PSC.focus();
    document.uprav.PSC.select();
			return false;
			}
 if (ICO == ""){
			alert("Není zadáno IČ");
    document.uprav.ICO.focus();
    document.uprav.ICO.select();
			return false;
			}
} 

function kontroladownload() {
 if (document.uprav.email.value== ""){
			alert("Prosím, vložte svůj email");
    document.uprav.email.focus();
    document.uprav.email.select();
			return false;
			}
//	Kontrola e-mailu
	if ( document.uprav.email.value != "" ) {
		if (re.test(document.uprav.email.value) == 0) {
			alert ("E-mailová adresa není správná");
			document.uprav.email.focus();
			document.uprav.email.select();
			return false;
		}
	}
}

function kontrolaporadna() {
	Jmeno=document.uprav.Jmeno.value;
	Email=document.uprav.Email.value;
	Otazka=document.uprav.Otazka.value;

 if (Jmeno == ""){
			alert("Nezadal jste své jméno");
    document.uprav.Jmeno.focus();
    document.uprav.Jmeno.select();
			return false;
			}
 if ((Email == "") || (Email.indexOf("@")<1)){
			alert("Zadejte prosím email");
    document.uprav.Email.focus();
    document.uprav.Email.select();
			return false;
			}                      

 if (Otazka == ""){
			alert("Nezadal jste svůj dotaz");
    document.uprav.Otazka.focus();
    document.uprav.Otazka.select();
			return false;
			}
 } 


function kontrolasearch() {

 if (document.vyhledat.co.value == ""){
			alert("Prosím, vložte co chcete vyhledat.");
    document.vyhledat.co.focus();
    document.vyhledat.co.select();
			return false;
			}
 } 

 function kontrolaskoleni() {
 if (document.uprav.email.value== ""){
			alert("Prosím, vložte svůj email");
    document.uprav.email.focus();
    document.uprav.email.select();
			return false;
			}
//	Kontrola e-mailu
	if ( document.uprav.email.value != "" ) {
		if (re.test(document.uprav.email.value) == 0) {
			alert ("E-mailová adresa není správná");
			document.uprav.email.focus();
			document.uprav.email.select();
			return false;
		}
	}
 if (document.uprav.firma.value== ""){
			alert("Prosím, vložte název firmy");
    document.uprav.firma.focus();
    document.uprav.firma.select();
			return false;
			}
 if (document.uprav.ic.value== ""){
			alert("Prosím, vložte IČ");
    document.uprav.ic.focus();
    document.uprav.ic.select();
			return false;
			}
}


