$(document).ready(function(){
	
	/* zavreni velkeho banneru */
	$("#closeme").click(function () {
		$(".hp-banner").css("display", "none");
		return false;
	});
	/* zavreni velkeho konec */
	
	/* otevirani menu */
	$("#left-menu ul.active-submenu").css("display", "block");
	$("#left-menu").find("a.hlav-kat-link").click(function() {
		$(".sub-kat-list").css("display", "none");
		$(this).parent(".hlav-kat-item").find(".sub-kat-list").css("display", "block");
		return false;
  });
  $("#left-menu2 ul.active-submenu").css("display", "block");
	$("#left-menu2").find("a.hlav-kat-link").click(function() {
		$(".sub-kat-list").css("display", "none");
		$(this).parent(".hlav-kat-item").find(".sub-kat-list").css("display", "block");
		return false;
  });
  /* otevirani menu - konec */
	
	$(function(){
	  $("a[rel^='lightbox']").lightbox();
	});
	
	$(function(){
		$("#main").corner("round 10px bottom cc:#5C5C5C");
		$("#left-menu").corner("round 10px");
	});
	
	/* tabulka - radky na stridacku */
	$(function() { 
		$(".zebra tr:even").addClass("rlichy");
		$(".zebra tr:odd").addClass("rsudy");
	});
	/* tabulka - radky na stridacku - konec */
	
});

re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;


function opencontent(id)
{
	if (id == 1)
	{
    document.getElementById("desc2").style.display = "none";
  	document.getElementById("desc").style.display = "block";
  	document.getElementById("first").style.backgroundPosition = "left top";
  	document.getElementById("first").style.color = "#fff";
  	document.getElementById("second").style.backgroundPosition = "right top";
  	document.getElementById("second").style.color = "#003985";
	}
	else
	{
   	document.getElementById("desc").style.display = "none";
  	document.getElementById("desc2").style.display = "block";
  	document.getElementById("second").style.backgroundPosition = "left top";
  	document.getElementById("second").style.color = "#fff";
  	document.getElementById("first").style.backgroundPosition = "right top";
  	document.getElementById("first").style.color = "#003985";
	}
}
/* kontrola formuláře pro poslání emailu z www */
function kontrolanapiste() {
	
	if (document.napiste.napiste_jmeno.value== ""){
		alert("Prosím, vložte své jméno a příjmení");
		document.napiste.napiste_jmeno.focus();
		document.napiste.napiste_jmeno.select();
		return false;
	}

	if (document.napiste.napiste_email.value== ""){
		alert("Prosím, vložte svůj email");
		document.napiste.napiste_email.focus();
		document.napiste.napiste_email.select();
		return false;
	}

//	Kontrola e-mailu
	if ( document.napiste.napiste_email.value != "" ) {
		if (re.test(document.napiste.napiste_email.value) == 0) {
			alert ("E-mailová adresa není správná");
			document.napiste.napiste_email.focus();
			document.napiste.napiste_email.select();
			return false;
		}
	}
	
	if (document.napiste.napiste_zprava.value== "") {
		alert("Prosím, vložte zprávu");
		document.napiste.napiste_zprava.focus();
		document.napiste.napiste_zprava.select();
		return false;
	}	
}

function kontrolasearch() {

	co=document.hledat.co.value;

if (co == "" || co.length < 3){
			alert("Prosím, vložte minimálně 3 znaky");
		  document.hledat.co.focus();
  		document.hledat.co.select();
			return false;
}
}

/* kontrola dotazníku pro zájemce o zaměstnání */
function kontroldotaznik()
{
	if (document.dotaznik.pozice.value=="")
	{
		alert("Prosím, vyplňte pole POZICE.");
    document.dotaznik.pozice.focus();
    document.dotaznik.pozice.select();
		return false;
	}
	if (document.dotaznik.jmeno.value=="")
	{
		alert("Prosím, vyplňte pole JMÉNO.");
    document.dotaznik.jmeno.focus();
    document.dotaznik.jmeno.select();
		return false;
	}
	if (document.dotaznik.prijmeni.value=="")
	{
		alert("Prosím, vyplňte pole PŘIJMENÍ.");
    document.dotaznik.prijmeni.focus();
    document.dotaznik.prijmeni.select();
		return false;
	}
	if (document.dotaznik.rok_narozeni.value=="")
	{
		alert("Prosím, vyplňte pole ROK NAROZENÍ.");
    document.dotaznik.rok_narozeni.focus();
    document.dotaznik.rok_narozeni.select();
		return false;
	}
	if (document.dotaznik.email.value=="")
	{
		alert("Prosím, vložte svůj e-mail.");
    document.dotaznik.email.focus();
    document.dotaznik.email.select();
		return false;
	}
 	if ( document.dotaznik.email.value !="" )
 	{
		if (re.test(document.dotaznik.email.value) == 0)
		{
			alert ("E-mailová adresa není správná.");
			document.dotaznik.email.focus();
			document.dotaznik.email.select();
			return false;
		}
	}
	if (document.dotaznik.telefon.value=="")
	{
		alert("Prosím, vyplňte pole TELEFON.");
    document.dotaznik.telefon.focus();
    document.dotaznik.telefon.select();
		return false;
	}
	if (document.dotaznik.adresa.value=="")
	{
		alert("Prosím, vyplňte pole ADRESA.");
    document.dotaznik.adresa.focus();
    document.dotaznik.adresa.select();
		return false;
	}
	if (document.dotaznik.vzdelani.value=="")
	{
		alert("Prosím, vyberte si prosím ze seznamu VZDĚLÁNÍ.");
    document.dotaznik.vzdelani.focus();
		return false;
	}
	if (document.dotaznik.obor.value=="")
	{
		alert("Prosím, vyplňte pole OBOR VZDĚLÁNÍ.");
    document.dotaznik.obor.focus();
    document.dotaznik.obor.select();
		return false;
	}
}
