$(document).ready(function(){

	$(function() {
	  $("a[rel^='lightbox']").lightbox();
	});
	
	$('.box, .box-svetly, #search').corner('5px');
	$('.odeslat').corner('right 3px');
	$('.odeslat2, .linky a').corner('3px');
	$('#main').corner('top 5px');

	$(function() { 
		$("table.obecna").find("tr:even").addClass("suda");
	});
	
	/* tabulka - radky na stridacku */
	$(function() { 
		$("table.tabulka").find("tr:even").addClass("suda");
	});

    $(".showttip2").hover(function () {
    $(this).css("z-index","5");
    $(this).find("span").fadeIn("slow");
    return false;
  },
  function () {
    $(this).css("z-index","1");
    $(this).find("span").css("display","none");
    return false;
  });


});

re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;

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;
			}
}


