//утф-8
function wo (url,html,sirka,vyska,l,t,vzdyNoveOkno) {
	var small = (sirka<800 && vyska<600);
  if (!small) {
    sirka+=16;
    vyska+=16;
  }
  popupWin = window.open(url , 'o'+(vzdyNoveOkno?"_"+d.toString():""),'Width=' +sirka +',Height=' +vyska +',Left=' +l +',Top=' +t +',status=no'+(small?"":",scrollbars=yes"));
  if (html) popupWin.document.write(html);
  popupWin.focus();
  return false;
}

//window popup - obrazek
function img(src,title){
  var titlebody = "height=10,width=10,resizable=1,scrollbars=0";
  newwindow=window.open('','name',titlebody);
  newwindow.document.write('<html><head><title>' +title +'</title></head><body  onload="window.resizeTo(document.images[0].width+12,document.images[0].height+51);" text="#000000" style="background-color:white; margin: 0px; padding: 0px;">');
  newwindow.document.write('<div align="center">');
  newwindow.document.write('<img title="po kliknutí se popup okno zavře"  onclick="window.close()"  border=0 src="');
  newwindow.document.write(src);
  newwindow.document.write('"');

  newwindow.document.write(' alt="');
  newwindow.document.write(title);
  newwindow.document.write('"');
  
  newwindow.document.write(' style="cursor:hand;">');
  newwindow.document.write('</div>');
  newwindow.document.write('</body></HTML>');
  newwindow.focus();
  newwindow.document.close();
  return false;
}

//onkeypress="return numbersonly(this, event)"
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

else if ((("0123456789").indexOf(keychar) > -1))
   return true;

else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

//otevirani / zavirani podmenu v levem menu
function openclose(obj){
  if (obj) {
    obj.className = (obj.className=="open")?"":"open"
  }
}
function cancelBubble(obj){
  document.location = obj.href;
  window.event.cancelBubble = true;
}
/*function cancelBubble(){return false;}*/

function mapa_on_change (url, id_zvetsi_mapu, id_mapa_iframe){
  var zvetsi_mapu = document.getElementById(id_zvetsi_mapu);
  var mapa_iframe = document.getElementById(id_mapa_iframe);
  if(url && zvetsi_mapu && mapa_iframe){
    zvetsi_mapu.href = url;
    zvetsi_mapu.href = url;
    mapa_iframe.src = url;
  }
}

// open popup window (target=_blank)
function popup(url) {
  var win = window.open(url, '_blank');
  return false;
}
