function max3(a,b,c){
  ab=Math.max(a,b);
  bc=Math.max(b,c);
  return Math.max(ab,bc);
}

function build(){
  //document.getElementsByTagName('h1')[0].innerHTML=wMain;

  hMainMin=400;

  if(document.getElementById('main')){
    hMain=document.getElementById('main').offsetHeight;
  }
  else{
    hMain=0;
  }
  
  if(document.getElementById('left')){
    hLeft=document.getElementById('left').offsetHeight;
  }
  else{
    hLeft=0;
  }

  if(document.getElementById('right')){
    hRight=document.getElementById('right').offsetHeight;
  }
  else{
    hRight=0;
  }

  hMax=max3(hLeft,hMain,hRight);

  if(0){
    a='Omluvte prosím tuto zprávu,\nmomentálně se testuje.\n';
    a+='hMain: '+hMain;
    a+='\nhLeft: '+hLeft;
    a+='\nhRight: '+hRight;
    a+='\nhMax: '+hMax;
    alert(a);
  }


  if(hMax<hMainMin){
    hMax=hMainMin;
  /*
    if(document.getElementById('left')){
      document.getElementById('left').style.height = hMainMin+'px';
    }
    if(document.getElementById('main')){
      document.getElementById('main').style.height = hMainMin+'px';
    }
    if(document.getElementById('right')){
      document.getElementById('right').style.height = hMainMin+'px';
    }
    */
  }
  if(hLeft<hMax){
      document.getElementById('left').style.height = hMax+'px';
  }
  if(hMain<hMax){
      document.getElementById('main').style.height = hMax+'px';
  }
  if(hRight<hMax){
      document.getElementById('right').style.height = hMax+'px';
  }
  //setTimeout('build()',1000);
}

function k_fo(){
  jm=document.fo.jmeno;
  em=document.fo.email;
  pt=document.fo.predmet;
  zp=document.fo.zprava;
  ret=true;
  if(jm.value==""){
    alert("Zadejte prosím jméno.");
    jm.focus();
    ret=false;
  }
  else if(em.value=="@" || em.value==""){
    if(confirm("Chcete vyplnit e-mail?")){
        em.focus();
        ret=false;
    }
  }
  else if(pt.value==''){
    alert("Zadejte prosím předmět zprávy\n(o čem zpráva je).");
    pt.focus();
    ret=false;
  }
  if((ret==true) && (zp.value=="")){
    alert("Napište prosím, co nám chcete sdělit.");
    zp.focus();
    ret=false;
  }
  return ret;
}

function emil(id,jm,dom2,dom1,param){
  if(dom1==''){
    dom1='cz';
  }
  adr=jm+'@'+dom2+'.'+dom1;
  href='mailto:'+adr;
  if(param){href+= '?'+param;}
  document.getElementById(id).href=href;
  document.getElementById(id).innerHTML=adr;
}



function zobraz_obrazek(img,wi,he,a){
  sw=screen.width;
  sh=screen.height;
  wid=Math.min(wi,sw);
  hei=Math.min(he,sh);
  tp=(sh-hei)/2;
  le=(sw-wid)/2;
  url="okenko.php?img="+img+"&amp;a="+a;
  vlastnosti='width='+wid+',height='+hei+',toolbar=no, ';
  vlastnosti+='menubar=no, location=no, scrollbars=no, resize=yes, ';
  vlastnosti+='top='+tp+', left='+le;
  window.open(url,'detail',vlastnosti);
}

