function phover(){
  if (!document.getElementById) return

  var p = document.getElementsByTagName('p');
  for(var i = 0; i < p.length; i++){
   p[i].onmouseover = function(){
    this.className = 'hover';
   }
   p[i].onmouseout  = function(){
    this.className = '';
   }
  }
}

function clear_box(hodnota){
	document.forms[0].email.value=hodnota;
}

function validate_reg(formular)
{
	if (formular.email.value=="")
	{
		alert("Musíte zadat email");
		formular.email.focus();
		return false;
	}
	else if (window.RegExp)
	{
		re = new RegExp("^[^@]+@[^.]+\..+$");
		if (!re.test(formular.email.value))
		{
			alert("Zadaný email není platný");
			formular.email.focus();
			return false;
		}
	}
	else
	return true;
}

function Menu(n)
{
if (document.getElementById("menu_skryte_"+n).style.display=="none") {
  document.getElementById("menu_skryte_"+n).style.display="block";
  document.getElementById("obr_"+n).src="./obrazky/kuzdas_11.gif";}
else {
  document.getElementById("menu_skryte_"+n).style.display="none";
  document.getElementById("obr_"+n).src="./obrazky/kuzdas_10.gif";};
}

function Zobraz_Menu(){
document.getElementById("menu").style.visibility="visible";
document.getElementById("leftcol").style.visibility="visible";
}

function Kontrola()
{
   if (document.dotaznik.jmeno.value == "")
   {
      document.dotaznik.jmeno.focus();
      alert ("Nezadali jste váše jméno");
      return false;
   }
   if (document.dotaznik.prijmeni.value == "")
   {
      document.dotaznik.prijmeni.focus();
      alert ("Nezadali jste váše příjmení");
      return false;
   }   
   if (document.dotaznik.telefon.value == "")
   {
      document.dotaznik.telefon.focus();
      alert ("Nezadali jste váš telefón");
      return false;
   }   
   if (document.dotaznik.kod.value != "7795")
   {
      document.dotaznik.kod.focus();
      alert ("Byl špatně opsán kód z obrázku");
      return false;
   }     
}

function Kontrola2()
{
   if (document.formular.mail_odesilatele.value == "")
   {
      document.formular.mail_odesilatele.focus();
      alert ("Nezadali jste váš e-mail");
      return false;
   }
   if (document.formular.mail_odesilatele.value.indexOf("@") == -1)
   {
      document.formular.mail_odesilatele.focus();
      alert ("Chybný formát e-mailu");
      return false;
   }
   if (document.formular.predmet.value == "")
   {
      document.formular.predmet.focus();
      alert ("Nezadali jste Vaše jméno");
      return false;
   }
   if (document.formular.zprava.value == "")
   {
      document.formular.zprava.focus();
      alert ("Nezadali jste žádnou zprávu");
      return false;
   }
   if (document.formular.kod.value != "7795")
   {
      document.formular.kod.focus();
      alert ("Byl špatně opsán kód z obrázku");
      return false;
   }      
}

function Kontrola3()
{
   if (document.formular.jmeno.value == "")
   {
      document.formular.jmeno.focus();
      alert ("Nezadali jste Vaše jméno");
      return false;
   }
   if (document.formular.prijmeni.value == "")
   {
      document.formular.prijmeni.focus();
      alert ("Nezadali jste Vaše příjmení");
      return false;
   }
   if (document.formular.telefon.value == "")
   {
      document.formular.telefon.focus();
      alert ("Nezadali jste Váš telefon");
      return false;
   }
   if (document.formular.mail_odesilatele.value == "")
   {
      document.formular.mail_odesilatele.focus();
      alert ("Nezadali jste váš e-mail");
      return false;
   }
   if (document.formular.mail_odesilatele.value.indexOf("@") == -1)
   {
      document.formular.mail_odesilatele.focus();
      alert ("Chybný formát e-mailu");
      return false;
   }
   if (document.formular.kod.value != "7795")
   {
      document.formular.kod.focus();
      alert ("Byl špatně opsán kód z obrázku");
      return false;
   }      
}


  function showDetail(adresa)
  {
    if (!(iD = document.getElementById('product_detail')))
    {
      iD = document.createElement('div');
      iD.setAttribute('id', 'product_detail');
      document.getElementById('page').appendChild(iD);
      aHref = document.createElement('a');
      aHref.setAttribute('href', 'javascript:hideDetail()');
      iD.appendChild(aHref);
      img = document.createElement('img');
      img.setAttribute('src', adresa);
      img.setAttribute('width', 380);
      img.setAttribute('height', 540);
      aHref.appendChild(img);
    }
    iD.getElementsByTagName('img')[0].setAttribute('src', adresa);
    iD.className = 'show';
    alert(adresa);
  }

  function hideDetail()
  {
    if (document.getElementById('product_detail'))
      document.getElementById('product_detail').className = '';
  }


function ShowFoto (Img, W, H){
var Browser = navigator.appName;
var Version = parseInt(navigator.appVersion);
if ((Browser == "Netscape" & Version >= 4) ||
(Browser == "Microsoft Internet Explorer" & Version >= 4)){
ScrH = screen.height;
ScrW = screen.width;
} else {
ScrH = 0;
ScrW = 0;
}

var BorderW = 1;
W += 2*BorderW;
H += 2*BorderW;

var Position;
if ((ScrH > 0) && (ScrW > 0)) Position = ",left="+(ScrW - W)/2+",top="+(ScrH-H)/2;
else Position = "";

var TmpName= new Date();
var NewName = "Name_"+TmpName.getTime();
var Scrollbars = ",scrollbars=no";
if ((ShowFoto.arguments.length>3) && (ShowFoto.arguments[3]== true)) Scrollbars = ",scrollbars=yes";

var NewWin = window.open('', NewName, "toolbar=no,location=no,width="+W+",height="+H+",directories=no,status =no,menubar=no,resizable=no"+Scrollbars+Position);


if (NewWin && NewWin.document){
with (NewWin.document) {
open();
write('<html><head><title>Velká fotografie</title></head><body style="margin:0px;padding:0px;background-color:#000000;">');
write('<A href="javascript:close();" title="Kliknutím zavřete"><IMG src="'+
Img+'" hspace="'+BorderW+'" vspace="'+
BorderW+'" border="0"></a>');
write('</body></html>');
close();
}
return (false)
} else return (true)
} 
