
$(document).ready(function(){
	
	/* animace mainMenu */
	$("#main-menu li").each(function () {
		var theString = $(this).html() + "<div class='onmouse'></div>";
		$(this).html(theString)
	});
	
	$("#main-menu li").hover(function () {
		$(this).find(".onmouse").animate({ 
			top: "0px"
		}, 200 );
	}, function() {
		$(this).find(".onmouse").animate({ 
			top: "50px"
		}, 300 );
	});
	/* animace mainMenu - konec */
	
	/* pridani kulatych rohu a prouzek nahore */
		$("h2").each(function() {
			var newHTML = $(this).html() + "<span class='phlavicka'></span>";
			$(this).html(newHTML);
			elSirka = $(this).width() + parseInt($(this).css("paddingLeft"), 10) + parseInt($(this).css("paddingRight"), 10);
			elVyska = ($(this).height() + parseInt($(this).css("paddingTop"), 9) + parseInt($(this).css("paddingBottom"), 11))/2;
			$(this).find(".phlavicka:last").css("width",elSirka).css("height",elVyska);
		});
	/* pridani kulatych rohu a prouzek nahore - konec */
	
	/* obecna tabulka */
	$(function() { 
		$("#table-kontakt tr:even").addClass("rlichy");
	});
	/* obecna tabulka - konec */
	
});

function openinput()
{
	document.getElementById('adresa').style.display="block";
	document.getElementById('odkudkam').style.display="none";
}
function closeinput()
{
	document.getElementById('adresa').style.display="none";
	document.getElementById('odkudkam').style.display="block";
}

re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;
/* konrola formuláře pro vložení dotazu do odborné poradny */
function kontrolapoptavka()
{
	if (document.getElementById('adresa').style.display == "block" && document.poptavka.adresa.value=="")
	{
		alert("Prosím, vyplňte svoji adresu.");
	  document.poptavka.adresa.focus();
	  document.poptavka.adresa.select();
		return false;
	}	
	if (document.poptavka.adresa.value=="" && document.poptavka.odkud.value=="")
	{
		alert("Prosím, vyplňte pole Odkud.");
	  document.poptavka.odkud.focus();
	  document.poptavka.odkud.select();
		return false;
	}	
	if (document.poptavka.adresa.value=="" && document.poptavka.kam.value=="")
	{
		alert("Prosím, vyplňte pole Kam.");
	  document.poptavka.kam.focus();
	  document.poptavka.kam.select();
		return false;
	}	
	if (document.poptavka.jmeno.value=="")
	{
		alert("Prosím, vyplňte své jméno.");
    document.poptavka.jmeno.focus();
    document.poptavka.jmeno.select();
		return false;
	}
	if (document.poptavka.prijmeni.value=="")
	{
		alert("Prosím, vyplňte své příjmení.");
    document.poptavka.prijmeni.focus();
    document.poptavka.prijmeni.select();
		return false;
	}
	if (document.poptavka.firma.value=="")
	{
		alert("Prosím, vyplňte pole Firma.");
    document.poptavka.firma.focus();
    document.poptavka.firma.select();
		return false;
	}
	if (document.poptavka.telefon.value=="")
	{
		alert("Prosím, vyplňte svůj telefon.");
    document.poptavka.telefon.focus();
    document.poptavka.telefon.select();
		return false;
	}
 if (document.poptavka.email.value==""){
			alert("Prosím, vložte svůj e-mail.");
    document.poptavka.email.focus();
    document.poptavka.email.select();
			return false;
 		}
 if ( document.poptavka.email.value !="" ) {
		if (re.test(document.poptavka.email.value) == 0) {
			alert ("E-mailová adresa není správná.");
			document.poptavka.email.focus();
			document.poptavka.email.select();
			return false;
		}
	 }
}

