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 i(id,w,h){
  sw=screen.width;
  sh=screen.height;
  wid=Math.min(w,sw);
  hei=Math.min(h,sh);
  tp=(sh-hei)/2;
  le=(sw-wid)/2;
  url='/index.php?i='+id+'&w='+w+'&h='+h;
  vla='width='+wid+',height='+hei+',toolbar=no, ';
  vla+='menubar=no, location=no, scrollbars=auto, resize=yes, ';
  vla+='top='+tp+', left='+le;
  window.open(url,'foto',vla);
}


var kam1;//global
function redir(kam){
  kam1=kam;
  setTimeout("redir1()",1000);
}
function redir1(){
  document.location=kam1;
}



function build(){
  //document.getElementsByTagName('h1')[0].innerHTML=wMain;

  hMainMin=500;

  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(0){
    a='Omluvte prosím tuto zprávu,\nmomentálně se testuje.';
    a+='\nhMain: '+hMain;
    a+='\nhLeft: '+hLeft;
    alert(a);
  }

  max=max3(hMainMin,hMain,hLeft);
  k=0;
  if(hLeft>hMain-k){
    hLeft=hLeft+k;
    document.getElementById('main').style.height = hLeft+'px';
  }
  /*
  if(hMain<max){
    if(document.getElementById('mozz')){
      document.getElementById('mozz').style.height = max+'px';
    }
  }
  if(hLeft<max){
    if(document.getElementById('left-obal')){
      document.getElementById('left-obal').style.height = max+'px';
    }
  }
  */

  setTimeout('build()',500);
}



function elementSwap(id){
  disp=document.getElementById(id).style.display;
  if(disp=='block'){
    elementClose(id);
  }
  else{
    elementOpen(id);
  }
}
function elementClose(id){
  document.getElementById(id).style.display='none';
}
function elementOpen(id){
  document.getElementById(id).style.display='block';
}



function max3(a,b,c){
  ab=Math.max(a,b);
  bc=Math.max(b,c);
  return Math.max(ab,bc);
}



function srovnejVysku(clanek1,clanek2){
  h1=document.getElementById(clanek1).offsetHeight;
  h2=document.getElementById(clanek2).offsetHeight;
  if(h1>h2){
    document.getElementById(clanek2).style.height=h1+'px';
  }
}


function disp(id,styl){
  switch(styl){
    case 0:
      st='none';
    break;

    case 1:
      st='block';
    break;

    default:
      return;
  }
  if(document.getElementById(id)){
    document.getElementById(id).style.display=st;
  }
}
