
function openFoto($mkey) {
msg = window.open('foto_d.php?cislo='+$mkey, '_blank', 'toolbar=no, menubar=no, location=no, directories=no, scrollbars=no, resizable=no, status=no, width=40, height=40, top=40, left=40')
}

function openPrint($mkey) {
msg = window.open('tisk.php?id='+$mkey, '_blank', 'toolbar=yes, menubar=yes, location=no, directories=no, scrollbars=yes, resizable=no, status=no, width=660, height=550, top=40, left=40')
}

function showGroup(marr,moval,mval) {
for( var i=0; i<marr.length; i++){ 
  if (moval==mval) {
    document.getElementById(marr[i]).className="";
    document.getElementById(marr[i]).style.visibility="visible";
    document.getElementById(marr[i]).style.display="block";  
  } else {
    document.getElementById(marr[i]).style.visibility="hidden";
    document.getElementById(marr[i]).style.display="none";  
  }
}
}

function disGroup(marr,moval,mval) {
for( var i=0; i<marr.length; i++){ 
  if (moval==mval) {
    document.getElementById(marr[i]).disabled=true;  
    document.getElementById(marr[i]).className="dis";
  } else {
    document.getElementById(marr[i]).disabled=false;
    document.getElementById(marr[i]).className="";
  }
}
}

function disBlok(div,val) {
  if(!div) {
    return;
  }
  div = typeof div === "string" ? document.getElementById(div) : div;
  var elms = div.getElementsByTagName("*");
  for(var i = 0, maxI = elms.length; i < maxI; ++i) {
    var elm = elms[i];
    switch(elm.type) {
      case "text":
      case "textarea":
      case "button":
      case "reset":
      case "submit":
      case "file":
      case "hidden":
      case "password":
      case "image":
      case "radio":
      case "select-multiple":
        elm.disabled=val;  
        elm.readOnly=val;  
        break;
      case "checkbox":
      case "select-one":
        elm.disabled=val;  
        break;

//      alert("Type: " + elm.type + "\nName: " +  elm.name + "\nId: " + elm.id);
    }
  }
}

function setFoto(foto,popis) {
  obj=document.getElementById("fotoB");
  obsah="<img src='"+foto+"' border='0' vspace='0' hspace='0' alt='"+popis+"'>";
  obj.innerHTML = obsah;
}

function setMap(mgps1,mgps2) {
  obj=document.getElementById("fotoB");
  obsah="<div id='mapaBZ'></div>";
  obj.innerHTML = obsah;
  if (GBrowserIsCompatible()) { 
    // základní inicializace mapy
    var map = new GMap2(document.getElementById("mapaBZ")); 
    map.setCenter(new GLatLng(49.75, 15.5), 6);
    map.setUIToDefault(); 
    // nastavení typu mapy
    map.setMapType(G_PHYSICAL_MAP);  
    map.disableScrollWheelZoom();
     // vložení bodu nan mapu
    mgr = new MarkerManager(map);
    var mmks = [];
    var pnt1=new GLatLng(mgps1, mgps2);
    var bz1 = new GMarker(pnt1);
    mmks.push(bz1);
    mgr.addMarkers(mmks,0);
    mmks=[];
    map.setCenter(pnt1, 10);
    mgr.refresh();
  } 
}

function selZal(mval) {
  for( var i=0; i<10; i++){ 
    if(document.getElementById("z"+i)) document.getElementById("z"+i).className="";
  }
  if(document.getElementById(mval)) document.getElementById(mval).className="sel";
}


