<!--
function show(obrazek,jmenoobrazku,sirka,vyska) {
  popupWin = window.open(obrazek, jmenoobrazku, 'width=' +sirka +',height=' +vyska)
  popupWin.focus();
}
//window popup - obrazek
function img(src,title){
  var titlebody = "height=10,width=10,resizable=1,scrollbars=0,top=50,left=200";
  newwindow=window.open('','name',titlebody);
  newwindow.document.write('<html><head><title>' +title +'</title></head><body onload="window.moveTo((screen.width-document.images[0].width-12)/2,(screen.height-document.images[0].height-51)/2); 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="kliknutím okno s obrázkem zavřete" 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;
}

//veci k ceniku
function WindowClose(Text) {
if (confirm(Text)) {
  window.close(); 
  return true;
 }
}
//Window open
function WO(idCenik) {
  var okno;
  okno = window.open("/cenikD.asp?smazano=0&id="+idCenik,"m"+idCenik,"width=540,height=440, left=150, top=200, toolbar=no,resizable=yes,location=no,status=no,scrollbars=yes"); 
  okno.focus();
}
//Window open admin
function WA(id) {
  var okno;
  okno = window.open("/cenikD.asp?id="+id,"m"+id,"width=540,height=360, left=500, top=200, toolbar=no,resizable=yes,location=no,status=no,scrollbars=yes"); 
  okno.focus();
  if (event) event.cancelBubble=true;
}
//Window open soubory
function WS(id) {
  var okno;
  okno = window.open("/admin/cenik.asp?stav=60&id="+id,"s","width=398,height=528, left=500, top=200, toolbar=no,resizable=yes,location=no,status=no,scrollbars=no"); 
  okno.focus();
  if (event) event.cancelBubble=true;
}
//Window edit - otevre okno pro editaci polozky v ceniku
function WE(obj) {
  var okno;
  okno = window.open("/admin/cenik.asp?stav=18&id="+obj.c,"m","width=398,height=528, left=500, top=200, toolbar=no,resizable=yes,location=no,status=no,scrollbars=no"); 
  okno.focus();
  if (obj.className.indexOf("skrtnuta")>0){
    obj.className = "skrtnuta oranzova"
  }else{
    obj.className = "oranzova"
  }
}
//Window new - otevre okno pro pridani polozky do ceniku, ktera ma uz specifikovano idMotorka
function WN(id) {
  var okno;
  okno = window.open("/admin/cenik.asp?stav=17&idMotorka="+id,"m","width=398,height=528, left=500, top=200, toolbar=no,resizable=yes,location=no,status=no,scrollbars=no"); 
  okno.focus();
}
//Window new blak - otevre okno pro pridani polozky do ceniku, ktera NEma specifikovano idMotorka
function WNblank() {
  var okno;
  okno = window.open("/admin/cenik.asp?stav=17","m","width=398,height=528, left=500, top=200, toolbar=no,resizable=yes,location=no,status=no,scrollbars=no"); 
  okno.focus();
}

// otevre help v malem okne
function help(L,idHelp,idStyleHelp,sirka,vyska){
  var d = new Date();
  if (sirka){}else{sirka='300';}
  if (vyska){}else{vyska='300';}
  var t=event.screenY+14;
  var l=event.screenX-parseInt(sirka)-20;
  popupWin = window.open('/admin/help.asp?L=' +L +'&idHelp=' +idHelp +"&idStyleHelp=" +idStyleHelp +'&d=' +d.toString(), 'Help','Width=' +sirka +',Height=' +vyska +',Left=' +l +',Top=' +t +',resizable=yes,status=no');
  popupWin.focus();
}

//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;
}

function NastavVysku(ObjKomu,ObjPodle){
  ObjKomu.style.height = ObjPodle.offsetHeight;
}

function NastavVyskuOkna(ObjPodle){
  //document.body.clientTop
  //document.body.clientHeight
  //alert(ObjPodle.offsetHeight +',' +document.body.clientHeight)
  if (ObjPodle.offsetHeight){
    window.resizeTo(300, ObjPodle.offsetHeight + 50);
  }
}


// konec skryti -->
