
    // Hlavní funkce zobrazující obrázek
    function ShowFoto (Img, W, H){
      // Zjistí rozlišení monitoru (velikost obrazovky)
      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;
      }

      // Vypočítání správné velikosti a souřadnic pozice nového okna
      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 = "";

      // Vytvoření nového okna
      var NewWin = window.open("", "Fotografie",
        "toolbar=no,location=no,width="+W+",height="+H+
        ",directories=no,status=no,menubar=no,"+
        "resizable=yes,scrollbars=yes"+
        Position);

      // Naplnění - zapsání zdrojového kódu nového okna
      with (NewWin.document){
        write("<HTML><HEAD><TITLE>Fotka - kliknutím zavřete"+
              "</TITLE></HEAD>");
        write('<BODY BgColor="white" Text="white"'+
              ' >');
        write('<center><A Href="javascript:close();"><IMG src="'+Img+
              '" HSpace="'+BorderW+'" VSpace="'+BorderW+'" Border="0"></A><center>');
        write("</BODY></HTML>");
        close();
      }
    }



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
    var d=document; 
    
    if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      
      var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
      for(i=0; i<a.length; i++) {
        if (a[i].indexOf("#")!=0) {
            d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
        }
      }
    }
}




function ValidForm(formID) {
    
    
    this.init = function(id) {
      form = document.getElementById(id);
      inputs = form.getElementsByTagName('input');
    
      
      for (var obj in inputs) {
          child = inputs[obj];
            
          
          childClassName = child.className;
          
          if (childClassName == 'ValidFormText') {
            if (!this.text(child.value)) {
              alert(this.dontVaild(child));
              return false;
            }
          }
          
          if (childClassName == 'ValidFormNumber') {
            if (!this.number(child.value)) {
              alert(this.dontVaild(child));
              return false;
            }
          }
          
          if (childClassName == 'ValidFormEmail') {
            if (!this.email(child.value)) {
              alert(this.dontVaild(child));
              return false;
            }
          }
          
          if (childClassName == 'ValidFormChecked') {
            var ret = this.checked(child, inputs);
            if (ret == false) {
              alert(this.dontVaild(child));
              return false;
            }
          }
        
          
      }
     
      return true;
    }
    
    
    
    
    
    this.dontVaild = function(item) {
      
      var dt = item.parentNode;
      var dl = dt.parentNode;
      var dtContent = dl.firstChild.firstChild;
  
      
      if (dtContent != null) {
        return 'Nebyla vyplněna položka "'+dtContent.nodeValue+ '".';
      } else {
        return 'Stále nebyly vyplněny všechny povinné položky.';
      }
      
    }
    
    
    
    
    
    this.checked = function(item, inputs) {
      if (item.type == 'checkbox') {
        if (item.checked == true) {
          return true;
        }
      } 
      
      if(item.type == 'radio') {
        for (var obj in inputs) {
          if (inputs[obj].name == item.name && inputs[obj].checked) {
            return true;
          }
        } 
      }
      
      return false;
    }
    
    
    this.number = function(value) {
      if (isNaN(value) || value.length == 0) {
        return false;
      }
      return true;
    }
    this.text = function(value) {
      if (value.length <= 0) {
        return false;
      }
      return true;
    }
    this.email = function(mail) {
       if (mail.indexOf("@") != -1 && mail.indexOf(".") != -1) {
          return true;
       } 
	     return false;
    }
    
    
    this.getSameRadio = function() {
    
    }
    
    return this.init(formID);
}

