// JavaScript Document

var zak;
function novy_zakaznik( zak ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 580) / 2;

  window.open
		("edit_zak.php?zak="+ zak +"",
		 "zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=635, height=580");
}

var zak;
function novy_zakaznik_full( zak ) {
  wleft = (screen.width - 1010) / 2;
  wtop = (screen.height - 750) / 2;

  window.open
		("new_zak.php?zak="+ zak +"",
		 "n_zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=980, height=750");
}

var spo;
var kod;
function zakaznik( spo, kod ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 540) / 2;

  window.open
		("edit_zak.php?spr=Z&spo="+ spo +"&kod="+ kod +"",
		 "zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=635, height=540");
}

var spo;
var kod;
function oprav_zakaznika( spo, kod ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 580) / 2;

  window.open
		("edit_zak.php?spr=Oprav&spo="+ spo +"&kod="+ kod +"",
		 "zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=635, height=580");
}

var spo;
var kod;
function vytlac_zakaznika( spo, kod ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 540) / 2;

  window.open
		("gen_zak.php?spr=T&spo="+ spo +"&kod="+ kod +"",
		 "t_zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=635, height=540");
}

var spo;
var kod;
function vytlac_obalzakaznika( spo ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 540) / 2;

  window.open
		("gen_obal.php?spo="+ spo +"",
		 "obal_zakaznik",
     "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=635, height=540");
}


var spo;
var kod;
function vytlac_harok_zakaznika( spo, kod ) {
  wleft = (screen.width - 950) / 2;
  wtop = (screen.height - 540) / 2;

  window.open
		("gen_zakH.php?spr=T&spo="+ spo +"&kod="+ kod +"",
		 "t_zakaznikH",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=1, scrollbars=1, resizable=1, left="+ wleft +", top="+ wtop +", width=950, height=540");
}

var spo;
var kod;
function vymaz_zakaznika( spo, kod ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zak.php?spr=V&spo="+ spo +"&kod="+ kod +"",
		 "zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

var spo;
var kod;
function unlock_zakaznik( spo, kod ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zak.php?spr=U&spo="+ spo +"&kod="+ kod +"",
		 "Uzakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

function vytlac_statistiku_zakaznikov( spo, mesiac, rok, den ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 520) / 2;

  window.open
		("gen_statistika.php?spo="+ spo +"&rok="+ rok +"&mes="+ mesiac +"&den="+ den +"",
		 "stat_zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=520");
}

var spo;
var kod;
var poradie;
function zobraz_dotaznik( spo, kod, poradie ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 700) / 2;

  window.open
		("edit_ziad.php?typ=D&spo="+ spo +"&kod="+ kod +"&poradie="+ poradie +"",
		 "dotaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=665, height=700");
}

var spo;
var kod;
var poradie;
function zobraz_namety( spo, kod, poradie ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 360) / 2;

  window.open
		("edit_ziad.php?typ=N&spo="+ spo +"&kod="+ kod +"&poradie="+ poradie +"",
		 "namety",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=665, height=360");
}

var typ;
var spo;
var kod;
var poradie;
function rekl_servis( typ, spo, kod, poradie ) {
  wleft = (screen.width - 580) / 2;
  wtop = (screen.height - 750) / 2;

  window.open
		("edit_ziad.php?typ="+ typ +"&spo="+ spo +"&kod="+ kod +"&poradie="+ poradie +"",
		 "rekservis",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=580, height=750");
}

var spo;
var kod;
var poradie;
function objednavka( spo, kod, poradie, uloz ) {
  wleft = (screen.width - 580) / 2;
  wtop = (screen.height - 650) / 2;

  window.open
		("edit_ziad.php?typ=O&spo="+ spo +"&kod="+ kod +"&poradie="+ poradie +"&uloz="+ uloz +"",
		 "objednavka",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=580, height=650");
}

var zak;
function obj_uzivatel( zak, typ ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 710) / 2;

  window.open
		("edit_zak.php?zak="+ zak +"&typ="+ typ +"",
		 "zakaznik",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=665, height=710");
}



function ziadost_o_program( ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("evid_ziad.php?typ=P",
		 "ziadost_zak",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=665, height=400");
}

function ziadost_objednavka( ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("evid_ziad.php?typ=O",
		 "ziadost_zak",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=665, height=400");
}

function zaeviduj_dotaznik( ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 660) / 2;

  window.open
		("evid_ziad.php?typ=D",
		 "namet_zak",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=665, height=660");
}

function zaeviduj_namet( ) {
  wleft = (screen.width - 640) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("evid_ziad.php?typ=N",
		 "namet_zak",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=665, height=400");
}


var spo;
var rok;
var mesiac;
var urcenie;
var termin;
var kod;
var nazov;
var popis;
var vyb;
function gen_servis( spo, rok, mesiac, den, urcenie, termin, kod, nazov, popis, vyb ) {
  wleft = (screen.width - 840) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("gen_servis.php?spo="+ spo +"&rok="+ rok +"&mes="+ mesiac +"&den="+ den +"&urc="+ urcenie +"&term="+ termin +"&kod="+ kod +"&naz="+ nazov +"&popis="+ popis +"&vyb="+ vyb+"",
		 "gen_servis",
     "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=855, height=500");
}

//-----------------------\\
var spo;
var kod;
function nova_platba( spo, kod ) {
  wleft = (screen.width - 320) / 2;
  wtop = (screen.height - 320) / 2;

  window.open
		("edit_zakU.php?spo="+ spo +"&kod="+ kod +"",
		 "zakaznik_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=320, height=320");
}


var spo;
var kod;
var poradie;
function oprav_zakaznika_platby( spo, kod, poradie) {
  wleft = (screen.width - 320) / 2;
  wtop = (screen.height - 320) / 2;

  window.open
		("edit_zakU.php?spr=Oprav_Uz&spo="+ spo +"&kod="+ kod +"&poradie="+ poradie +"",
		 "zakaznik_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=320, height=320");
}


var spo;
var kod;
var poradie;
function oprav_zakplatbu( spo, kod, poradie) {
  wleft = (screen.width - 320) / 2;
  wtop = (screen.height - 320) / 2;

  window.open
		("edit_zakU.php?spr=Oprav&spo="+ spo +"&kod="+ kod +"&poradie="+ poradie +"",
		 "zakaznik_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=320, height=320");
}

var spo;
var kod;
var poradie;
function vymaz_zakplatbu( spo, kod, poradie) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zakU.php?spr=V&spo="+ spo +"&kod="+ kod +"&poradie="+ poradie +"",
		 "Vzakaznik_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


var spo;
var kod;
function zobraz_zakplatbu( spo, kod) {
  wleft = (screen.width - 920) / 2;
  wtop = (screen.height - 620) / 2;

  window.open
		("zak_platby.php?typ=U&spo="+ spo +"&kod="+ kod +"",
		 "zak_platby",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=920, height=620");
}


var spo;
function import_platieb( spo ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 620) / 2;

  window.open
		("edit_zakPl.php?spo="+ spo +"",
		 "imp_platby",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=620");
}
//-----------------------\\
function nova_faktura( ) {
  wleft = (screen.width - 700) / 2;
  wtop = (screen.height - 520) / 2;

  window.open
		("edit_fak.php",
		 "faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=695, height=520");
}

var spo;
var kod;
var mesiac;
var rok;
function vytvor_tlac_faktury( spo, kod, mesiac, rok ) {
  wleft = (screen.width - 700) / 2;
  wtop = (screen.height - 520) / 2;

  window.open
		("gen_vfak.php?spr=N&spo="+ spo +"&kod="+ kod +"&mes="+ mesiac +"&rok="+ rok +"",
		 "faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=695, height=520");
}

var spo;
function vytvor_faktury_dodlist( spo ) {
  wleft = (screen.width - 650) / 2;
  wtop = (screen.height - 520) / 2;

  window.open
		("gen_fakdl.php?spo="+ spo +"",
		 "faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=635, height=520");
}

function cis_faktur() {
  wleft = (screen.width - 530) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("edit_fakT.php",
		 "cis_faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=525, height=400");
}

var spo;
var rok;
var cis;
function faktura( spo, rok, cis) {
  wleft = (screen.width - 700) / 2;
  wtop = (screen.height - 530) / 2;

  window.open
		("edit_fak.php?spr=Z&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=695, height=530");
}

var spo;
var rok;
var cis;
function oprav_fakturu( spo, rok, cis) {
  wleft = (screen.width - 700) / 2;
  wtop = (screen.height - 530) / 2;

  window.open
		("edit_fak.php?spr=Oprav&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=695, height=530");
}

var spo;
var rok;
var cis;
function vytlac_fakturu( spo, rok, cis) {
  wleft = (screen.width - 800) / 2;
  wtop = (screen.height - 610) / 2;

  window.open
		("gen_fak.php?spr=T&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "pdf_faktur",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=1, left="+ wleft +", top="+ wtop +", width=795, height=610");

}

var spo;
var rok;
var cis;
function vytlac_zak_fakturu( spo, rok, cis) {
  wleft = (screen.width - 800) / 2;
  wtop = (screen.height - 610) / 2;

  window.open
		("gen_fak.php?typ=Z&spr=T&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "pdf_faktur",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=1, left="+ wleft +", top="+ wtop +", width=795, height=610");

}


var spo;
var rok;
var cis;
function mail_zak_fakturu( typ, spo, rok, cis) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 610) / 2;

  window.open
		("gen_fakM.php?typ="+ typ +"&spr=T&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "pdf_faktur",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=1, left="+ wleft +", top="+ wtop +", width=595, height=610");

}

var spo;
var rok;
var cis_od;
var cis_do;
function zobraz_od_do_fakturu( spo, rok, cis_od, cis_do) {
  wleft = (screen.width - 500) / 2;
  wtop = (screen.height - 320) / 2;

  window.open
		("zobr_gen_fak.php?typ=Z&spo="+ spo +"&rok="+ rok +"&cis_od="+ cis_od +"&cis_do="+ cis_do +"",
		 "zpdf_faktur",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=1, left="+ wleft +", top="+ wtop +", width=530, height=320");

}

var spo;
var rok;
var cis_od;
var cis_do;
function vytlac_od_do_fakturu( spo, rok, cis_od, cis_do) {
  wleft = (screen.width - 800) / 2;
  wtop = (screen.height - 640) / 2;

  window.open
		("gen_fak.php?typ=T&spr=T&spo="+ spo +"&rok="+ rok +"&cis_od="+ cis_od +"&cis_do="+ cis_do +"",
		 "pdf_faktur",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=1, left="+ wleft +", top="+ wtop +", width=795, height=640");

}

var spo;
var rok;
var cis;
function vytlac_fakturu_zak( spo, rok, cis) {
  wleft = (screen.width - 800) / 2;
  wtop = (screen.height - 640) / 2;

  window.open
		("../sprava/gen_fak.php?spr=T&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "pdf_faktur",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=1, left="+ wleft +", top="+ wtop +", width=795, height=640");

}

var spo;
var rok;
var cis;
function zobraz_fakturu( spo, rok, cis) {
  wleft = (screen.width - 800) / 2;
  wtop = (screen.height - 640) / 2;

  window.open
		("../dokumenty_"+ spo +"/"+ rok +"/faktury/"+ cis +".pdf",
		 "Zfaktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=795, height=640");
}

var spo;
var rok;
var cis;
function zobraz_tlac_fakturu( spo, rok, cis) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 640) / 2;

  window.open
		("gen_tfak.php?spr=T&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "tlac_faktur",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=640");
}


var spo;
var rok;
var cis;
function vymaz_fakturu( spo, rok, cis) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 200) / 2;

  window.open
		("edit_fak.php?spr=V&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "Vfaktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=200");
}

var spo;
var rok;
var cis;
function unlock_faktura( spo, rok, cis) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_fak.php?spr=U&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "Ufaktura",
     	 "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


//-----------------------\\
var spo;
var kod;
var mesiac;
var rok;
var cis;
var por;
var datup;
function vytlac_upom_fakturu( spo, mesiac, rok, cis, por, kod, datup ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 510) / 2;

  window.open
		("gen_fakTU.php?spr=N&spo="+ spo +"&rok="+ rok +"&mes="+ mesiac +"&cis="+ cis +"&poradie="+ por +"&kod="+ kod +"&datup="+ datup +"",
		 "faktura_upom",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=510");
}


var spo;
var kod;
var mesiac;
var rok;
var cis;
var por;
var datup;
function vygen_upom_fakturu( spo, mesiac, rok, cis, por, kod, datup) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 510) / 2;

  window.open
		("gen_fakU.php?spr=N&spo="+ spo +"&rok="+ rok +"&mes="+ mesiac +"&cis="+ cis +"&poradie="+ por +"&kod="+ kod +"&datup="+ datup +"",
		 "faktura_upom",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=510");
}


var spo;
var kod;
var mesiac;
var rok;
var cis;
var por;
var datup;
function stat_upom_fakturu( spo, mesiac, rok, cis, por, kod, datup) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 510) / 2;

  window.open
		("gen_statis_pausal.php?spr=N&spo="+ spo +"&rok="+ rok +"&mes="+ mesiac +"&cis="+ cis +"&poradie="+ por +"&kod="+ kod +"&datup="+ datup +"",
		 "statistika_upom",
     "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=510");
}


var spo;
var rok;
var cis;
var por;
var datup;
function vymaz_upom_fakturu( spo, rok, cis, por, kod, datup ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_fakUp.php?spr=V&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"&poradie="+ por +"&kod="+ kod +"&datup="+ datup +"",
		 "Vfaktura_upom",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


var spo;
var rok;
var cis;
var por;
var datup;
function unlock_upom_fakturu( spo, rok, cis, por, kod, datup ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_fakUp.php?spr=U&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"&poradie="+ por +"&kod="+ kod +"&datup="+ datup +"",
		 "Ufaktura_upom",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

//-----------------------\\
function nova_uhrada( ) {
  wleft = (screen.width - 320) / 2;
  wtop = (screen.height - 320) / 2;

  window.open
		("edit_fakU.php",
		 "faktura_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=320, height=320");
}

var spo;
var rok;
var cis;
function oprav_uhradu( spo, rok, cis) {
  wleft = (screen.width - 320) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_fakU.php?spr=Oprav&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "faktura_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=320, height=300");
}

var spo;
var rok;
var cis;
function vymaz_uhradu( spo, rok, cis) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_fakU.php?spr=V&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "Vfaktura_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


var spo;
var kod;
var rok;
var cis;
function pridaj_zakplatbu( spo, kod, rok, cis) {
  wleft = (screen.width - 320) / 2;
  wtop = (screen.height - 280) / 2;

  window.open
		("edit_fakU.php?spr=N&spo="+ spo +"&kod="+ kod +"&rok="+ rok +"&cis="+ cis +"",
		 "faktura_uhr",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=320, height=280");
}
//-----------------------\\
var spo;
var rok;
var cis;
function nova_polfakt( spo, rok, cis) {
  wleft = (screen.width - 500) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("edit_fakP.php?spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "opol_faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=495, height=400");
}

var spo;
var rok;
var cis;
var pol;
function vymaz_polfakt( spo, rok, cis, pol) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_fakP.php?spr=V&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"&pol="+ pol +"",
		 "vpol_faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


var spo;
var rok;
var cis;
var pol;
function oprav_polfakt( spo, rok, cis, pol) {
  wleft = (screen.width - 500) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("edit_fakP.php?spr=Oprav&spo="+ spo +"&rok="+ rok +"&cis="+ cis +"&pol="+ pol +"",
		 "opol_faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=495, height=400");
}

var spo;
var rok;
var cis;
function zobraz_pol_faktury( spo, rok, cis) {
  wleft = (screen.width - 920) / 2;
  wtop = (screen.height - 600) / 2;

  window.open
		("pol_faktury.php?spo="+ spo +"&rok="+ rok +"&cis="+ cis +"",
		 "pol_faktura",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=920, height=600");
}


//-----------------------\\
function nova_zmluva( ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_zml.php",
		 "zmluva",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var zml;
function zmluva( spo, zml ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_zml.php?spr=Z&spo="+ spo +"&zml="+ zml +"",
		 "zmluva",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var zml;
function oprav_zmluvu( spo, zml ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_zml.php?spr=Oprav&spo="+ spo +"&zml="+ zml +"",
		 "zmluva",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var zml;
function vymaz_zmluvu( spo, zml ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zml.php?spr=V&spo="+ spo +"&zml="+ zml +"",
		 "zmluva",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

var spo;
var zml;
var typ;
function zobraz_polzmluvy( typ, spo, zml) {
  wleft = (screen.width - 700) / 2;
  wtop = (screen.height - 600) / 2;

  window.open
		("pol_zmluvy.php?typ="+ typ +"&spo="+ spo +"&zml="+ zml +"",
		 "pol_zmluvy",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=695, height=600");
}


var spo;
var zml;
function novy_zmlprogram( spo, zml ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_zmlP.php?spr=Novy&spo="+ spo +"&zml="+ zml +"",
		 "zmluva_program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=300");
}

var spo;
var zml;
var kod;
function oprav_zmlprogram( spo, zml, kod ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_zmlP.php?spr=Oprav&spo="+ spo +"&zml="+ zml +"&kod="+ kod +"",
		 "zmluva_program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=300");
}

var spo;
var zml;
var kod;
function vymaz_zmlprogram( spo, zml, kod ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zmlP.php?spr=V&spo="+ spo +"&zml="+ zml +"&kod="+ kod +"",
		 "zmluva_program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

var spo;
var zml;
function novy_zmlspotreba( spo, zml ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_zmlS.php?spr=Novy&spo="+ spo +"&zml="+ zml +"",
		 "zmluva_spotreba",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=300");
}

var spo;
var zml;
var dat_od;
var dat_do;
function oprav_zmlspotreba( spo, zml, dat_od, dat_do ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_zmlS.php?spr=Oprav&spo="+ spo +"&zml="+ zml +"&dat="+ dat_od +"",
		 "zmluva_spotreba",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=300");
}

var spo;
var zml;
var dat_od;
var dat_do;
function vymaz_zmlspotreba( spo, zml, dat_od, dat_do ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zmlS.php?spr=V&spo="+ spo +"&zml="+ zml +"&dat="+ dat_od +"",
		 "zmluva_spotreba",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

var spo;
var zml;
function novy_zmldoporuc( spo, zml ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 180) / 2;

  window.open
		("edit_zmlD.php?spr=Novy&spo="+ spo +"&zml="+ zml +"",
		 "zmluva_doporuc",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=180");
}

var spo;
var zml;
var kod;
function oprav_zmldoporuc( spo, zml, kod ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 180) / 2;

  window.open
		("edit_zmlD.php?spr=Oprav&spo="+ spo +"&zml="+ zml +"&kod="+ kod +"",
		 "zmluva_doporuc",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=180");
}

var spo;
var zml;
var kod;
function vymaz_zmldoporuc( spo, zml, kod ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zmlD.php?spr=V&spo="+ spo +"&zml="+ zml +"&kod="+ kod +"",
		 "zmluva_doporuc",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

var spo;
var zml;
function novy_zmlakcie( spo, zml ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 200) / 2;

  window.open
		("edit_zmlA.php?spr=Novy&spo="+ spo +"&zml="+ zml +"",
		 "zmluva_akcie",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=200");
}

var spo;
var zml;
var kod;
function oprav_zmlakcie( spo, zml, kod ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 200) / 2;

  window.open
		("edit_zmlA.php?spr=Oprav&spo="+ spo +"&zml="+ zml +"&kod="+ kod +"",
		 "zmluva_akcie",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=200");
}

var spo;
var zml;
var kod;
function vymaz_zmlakcie( spo, zml, kod ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zmlA.php?spr=V&spo="+ spo +"&zml="+ zml +"&kod="+ kod +"",
		 "zmluva_akcie",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

//-----------------------\\
function novy_program( ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_prog.php",
		 "program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var kod_prog;
function program( spo, kod_prog ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_prog.php?spr=Z&spo="+ spo +"&kod_prog="+ kod_prog +"",
		 "program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var kod_prog;
function oprav_program( spo, kod_prog ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_prog.php?spr=Oprav&spo="+ spo +"&kod_prog="+ kod_prog +"",
		 "program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var kod_prog;
function vymaz_program( spo, kod_prog ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_prog.php?spr=V&spo="+ spo +"&kod_prog="+ kod_prog +"",
		 "program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

//-----------------------\\
var spo;
function zobraz_akcie( spo ) {
  wleft = (screen.width - 700) / 2;
  wtop = (screen.height - 600) / 2;

  window.open
		("akcie.php?spo="+ spo +"",
		 "akcie",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=695, height=600");
}

var spo;
var kod_prog;
function novy_akcie( spo ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_akc.php?spr=Novy&spo="+ spo +"",
		 "zmluva_program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=300");
}

var spo;
var kod_prog;
var poradie;
function oprav_akcie( spo, kod_akc ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_akc.php?spr=Oprav&spo="+ spo +"&kod_akc="+ kod_akc +"",
		 "zmluva_program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=300");
}

var spo;
var kod_prog;
var poradie;
function vymaz_akcie( spo, kod_akc ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_akc.php?spr=V&spo="+ spo +"&kod_akc="+ kod_akc +"",
		 "zmluva_program",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


//--------------------//
function novy_zakpriv( ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 280) / 2;

  window.open
		("edit_cis.php?typ=X",
		 "ciselnik_x",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=495, height=300");
}

var spo;
var kod;
var priv;
function oprav_zakpriv( spo, kod, priv ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 280) / 2;

  window.open
		("edit_cis.php?typ=X&spr=Oprav&spo="+ spo +"&kod="+ kod +"&priv="+ priv +"",
		 "ciselnik_x",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=495, height=300");
}

var spo;
var kod;
var priv;
function vymaz_zakpriv( spo, kod, priv ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_cis.php?typ=X&spr=V&spo="+ spo +"&kod="+ kod +"&priv="+ priv +"",
		 "ciselnik_x",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


//--------------------//
var spo;
var kod;
function novy_vysielac( ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_cis.php?typ=V",
		 "ciselnik_v",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=300");
}

var spo;
var kod;
function oprav_vysielac( spo, kod ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_cis.php?typ=V&spr=Oprav&spo="+ spo +"&kod="+ kod +"",
		 "ciselnik_v",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=300");
}

var spo;
var kod;
function vymaz_vysielac( spo, kod ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_cis.php?typ=V&spr=V&spo="+ spo +"&kod="+ kod +"",
		 "ciselnik_v",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


//--------------------//
var spo;
var kod;
var typ;
function nova_aktualita( typ ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 570) / 2;

  window.open
		("edit_cis.php?typ="+ typ +"",
		 "ciselnik_a",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=570");
}

var spo;
var dat;
var typ;
function oprav_aktualita( spo, dat, typ ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 570) / 2;

  window.open
		("edit_cis.php?typ=A&spr=Oprav&spo="+ spo +"&dat="+ dat +"&typ="+ typ +"",
		 "ciselnik_a",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=570");
}

var spo;
var dat;
var typ;
function vymaz_aktualita( spo, dat, typ ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_cis.php?typ=A&spr=V&spo="+ spo +"&dat="+ dat +"&typ="+ typ +"",
		 "ciselnik_a",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

//--------------------//
var spo;
var kod;
function nova_pokrytie( ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_cis.php?typ=P",
		 "ciselnik_p",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=300");
}

var spo;
var kod;
function oprav_pokrytie( spo, kod ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 300) / 2;

  window.open
		("edit_cis.php?typ=P&spr=Oprav&spo="+ spo +"&kod="+ kod +"",
		 "ciselnik_p",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=300");
}

var spo;
var kod;
function vymaz_pokrytie( spo, kod ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_cis.php?typ=P&spr=V&spo="+ spo +"&kod="+ kod +"",
		 "ciselnik_p",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

//--------------------//
var spo;
var kod;
function nova_download( ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("edit_cis.php?typ=S",
		 "ciselnik_s",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=400");
}

var spo;
var nazov;
function oprav_download( spo, nazov ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("edit_cis.php?typ=S&spr=Oprav&spo="+ spo +"&nazov="+ nazov +"",
		 "ciselnik_s",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=400");
}

var spo;
var nazov;
function vymaz_download( spo, nazov ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_cis.php?typ=S&spr=V&spo="+ spo +"&nazov="+ nazov +"",
		 "ciselnik_s",
     	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


function odoslat_mail( ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 400) / 2;

  window.open
		("mail.php",
		 "o_mail",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=400");
}


var spo;
function import_artiklov_dodavatel( spo ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 600) / 2;

  window.open
		("spusti_volby.php?spo="+ spo +"&imp=IA",
		 "import_art",
     "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=600");
}

var spo;
function import_artiklov_vlastne( spo ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 600) / 2;

  window.open
		("spusti_volby.php?spo="+ spo +"&imp=IvA",
		 "import_art",
     "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=600");
}


var spo;
var ip;
var idx_cislo;
var cislo;
var cis_fak;
var rok_fak;
function zobraz_obj_obchod( spo, ip, idx_cislo, cislo, cis_fak, rok_fak ) {
  wleft = (screen.width - 1000) / 2;
  wtop = (screen.height - 600) / 2;

  window.open
		("edit_obchod.php?spo="+ spo +"&cislo="+ cislo+ "&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&cis_fak="+ cis_fak+ "&rok_fak="+ rok_fak+ "",
		 "zobr_obchod",
     "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=1000, height=600");
}


var spo;
var ip;
var idx_cislo;
var cislo;
var cis_odb;
function zobraz_pol_obchod( spo, ip, idx_cislo, cislo, cis_odb ) {
  wleft = (screen.width - 900) / 2;
  wtop = (screen.height - 600) / 2;

  window.open
		("pol_obchod.php?spo="+ spo +"&cislo="+ cislo+ "&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&cis_odb="+ cis_odb+ "",
		 "pol_obchod",
     "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=895, height=600");
}

var spo;
var ip;
var idx_cislo;
var cislo;
var cis_odb;
var email;
function schvalenie_obj ( spo, ip, idx_cislo, cislo, cis_odb, email ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 400) / 2;

  nazov = "Potvrdenie objednávky";
	popis = 'Dobrý deň, <br /><br /> zasielame Vám potvrdenie objednávky číslo: '+ cislo+ '. <br /><br /> Objednávka bola zaradená na spracovanie. <br /> O vybavení a dodaní objednávky Vás budeme informovať.';
	
  window.open
		("mail.php?cislo="+ cislo+ "&potvrd=2&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&cis_odb="+ cis_odb+ "&email="+ email+"&nazov="+ nazov+ "&popis="+ popis+ "",
		 "os_mail",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=400");
}


var spo;
var ip;
var idx_cislo;
var cislo;
var cis_odb;
var email;
function stornovanie_obj ( spo, ip, idx_cislo, cislo, cis_odb, email ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 400) / 2;

  nazov = "Stornovanie objednávky";
	popis = 'Dobrý deň, <br /><br /> touto cestou Vás chceme informovať o stornovaní objednávky číslo: '+ cislo+ '. <br /><br /> Objednávku nebolo možné vybaviť.';
	
  window.open
		("mail.php?cislo="+ cislo+ "&potvrd=3&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&cis_odb="+ cis_odb+ "&email="+ email+"&nazov="+ nazov+ "&popis="+ popis+ "",
		 "os_mail",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=400");
}


var spo;
var ip;
var idx_cislo;
var cislo;
var cis_odb;
var email;
function dodanie_obj ( spo, ip, idx_cislo, cislo, cis_odb, email ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 400) / 2;

  nazov = "Dodanie objednávky";
	popis = 'Dobrý deň, <br /><br /> zasielame Vám informáciu o dodaní objednávky číslo: '+ cislo+ '. <br /><br /> Objednávka Vám bola zaslaná prostredníctvom kuriéra.';
	
  window.open
		("mail.php?cislo="+ cislo+ "&potvrd=5&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&cis_odb="+ cis_odb+ "&email="+ email+"&nazov="+ nazov+ "&popis="+ popis+ "",
		 "os_mail",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=400");
}


var spo;
var ip;
var idx_cislo;
var cislo;
var cis_odb;
var email;
function vyfakturovanie_obj ( spo, ip, idx_cislo, cislo, cis_odb, email ) {
  wleft = (screen.width - 600) / 2;
  wtop = (screen.height - 400) / 2;

  nazov = "Vyfakturovenie objednávky";
  window.open
		("gen_vfakO.php?cislo="+ cislo+ "&potvrd=4&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&cis_odb="+ cis_odb+ "&email="+ email+ "&spo="+ spo+"&nazov="+ nazov+ "",
		 "os_faktura",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=595, height=400");
}


function nova_dobierka( ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 270) / 2;

  window.open
		("edit_doprava.php?spr=N",
		 "dobierka",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=270");
}

function dobierky( ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_doprava.php?spr=Z",
		 "zoz_dobierka",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var dobierka;
var hod_od;
function oprav_dobierka( spo, dobierka, hod_od ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 270) / 2;

  window.open
		("edit_doprava.php?spr=Oprav&spo="+ spo +"&dob_sluzba="+ dobierka +"&hod_od="+ hod_od +"",
		 "dobierka",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=270");
}

var spo;
var dobierka;
var hod_od;
function vymaz_dobierka( spo, dobierka, hod_od ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_doprava.php?spr=V&spo="+ spo +"&dob_sluzba="+ dobierka +"&hod_od="+ hod_od +"",
		 "dobierka",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


function nova_marza( ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 270) / 2;

  window.open
		("edit_marza.php?spr=N",
		 "marza",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=270");
}

function marza( ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_marza.php?spr=Z",
		 "zoz_marza",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var marza;
var hod_od;
function oprav_marza( spo, marza, hod_od ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 270) / 2;

  window.open
		("edit_marza.php?spr=Oprav&spo="+ spo +"&kod_marze="+ marza +"&hod_od="+ hod_od +"",
		 "marza",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=270");
}

var spo;
var marza;
var hod_od;
function vymaz_marza( spo, marza, hod_od ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_marza.php?spr=V&spo="+ spo +"&kod_marze="+ marza +"&hod_od="+ hod_od +"",
		 "marza",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}


function nova_zlava( ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 270) / 2;

  window.open
		("edit_zlava.php?spr=N",
		 "zlava",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=270");
}

function zlava( ) {
  wleft = (screen.width - 570) / 2;
  wtop = (screen.height - 500) / 2;

  window.open
		("edit_zlava.php?spr=Z",
		 "zoz_zlava",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=1, resizable=0, left="+ wleft +", top="+ wtop +", width=565, height=500");
}

var spo;
var zlava;
var hod_od;
function oprav_zlava( spo, zlava, hod_od ) {
  wleft = (screen.width - 370) / 2;
  wtop = (screen.height - 270) / 2;

  window.open
		("edit_zlava.php?spr=Oprav&spo="+ spo +"&kod_zlavy="+ zlava +"&hod_od="+ hod_od +"",
		 "zlava",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=365, height=270");
}

var spo;
var zlava;
var hod_od;
function vymaz_zlava( spo, zlava, hod_od ) {
  wleft = (screen.width - 300) / 2;
  wtop = (screen.height - 100) / 2;

  window.open
		("edit_zlava.php?spr=V&spo="+ spo +"&kod_zlavy="+ zlava +"&hod_od="+ hod_od +"",
		 "marza",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=295, height=100");
}

var spo;
var ip;
var idx_cislo;
var cislo;
function novy_artikel_obj ( spo, ip, idx_cislo, cislo ) {
  wleft = (screen.width - 550) / 2;
  wtop = (screen.height - 200) / 2;

  window.open
		("edit_obch.php?cislo="+ cislo+ "&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&spo="+ spo+"",
		 "art_obch",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=545, height=200");
}

var spo;
var ip;
var idx_cislo;
var cislo;
var pol_cislo;
var artikel;
function vymaz_artikel_obj ( spo, ip, idx_cislo, cislo, pol_cislo, artikel ) {
  wleft = (screen.width - 550) / 2;
  wtop = (screen.height - 200) / 2;

  window.open
		("edit_obch.php?spr=V&cislo="+ cislo+ "&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&pol_cislo="+ pol_cislo+ "&artikel="+ artikel+"&spo="+ spo+"",
		 "art_obch",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=545, height=200");
}

var spo;
var ip;
var idx_cislo;
var cislo;
var pol_cislo;
var artikel;
function oprav_artikel_obj ( spo, ip, idx_cislo, cislo, pol_cislo, artikel ) {
  wleft = (screen.width - 550) / 2;
  wtop = (screen.height - 200) / 2;

  window.open
		("edit_obch.php?spr=Oprav&cislo="+ cislo+ "&ip="+ ip+ "&idx_cislo="+ idx_cislo+ "&pol_cislo="+ pol_cislo+ "&artikel="+ artikel+"&spo="+ spo+"",
		 "art_obch",
   	 "toolbar=0, location=0, directories=0, status=5, menubar=0, scrollbars=0, resizable=0, left="+ wleft +", top="+ wtop +", width=545, height=200");
}


//-----------------------\\
function close_window() {
  window.close ();
}

//-----------------------\\
function posli_zmenu( cislo ) {
  if ( cislo=='stranka' ) 
    document.stranka.submit();
  if ( cislo=='strankaH' ) 
    document.strankaH.submit();
  if ( cislo=='strankaM' ) 
    document.strankaH.submit();
  if ( cislo=='strankaY' ) 
    document.strankaH.submit();
  if ( cislo=='strankaF' ) 
    document.strankaF.submit();
  if ( cislo=='strankaP' ) 
    document.strankaP.submit();
  if ( cislo=='zmen' ) 
    document.zmen.submit();
  if ( cislo=='zmen1' ) 
    document.zmen1.submit();
}


function zobraz_pole(elementId,display)
{
    var element = document.getElementById(elementId);
        if(display)
            element.style.display='block';
        else
            element.style.display='none';
}

function zatvor_pole(elementId)
{
    var element = document.getElementById(elementId);
    element.style.display='none';
}



//------------------  ZAKAZNIK  ---------------\\
  function odblokovanie_form ( cislo ) {
    return window.confirm('Chcete odblokovať záznam číslo:'+cislo+'?');
  }
  function fakt_form ( cislo ) {
    return window.confirm('Chcete vyfakturovať záznam číslo:'+cislo+'?');
  }
  function vytvor_pdfzak_form ( ) {
    return window.confirm('Chcete vytvoriť pdf dokumenty zákazníkov?');
  }
  function vytvor_pdfobalzak_form ( ) {
    return window.confirm('Chcete vytvoriť pdf obálky zákazníkov?');
  }
  function vytvor_harokzak_form ( ) {
    return window.confirm('Chcete vytvoriť pdf hárok zákazníkov?');
  }


//------------------  ZMLUVY  ---------------\\
  function vytvor_statzak_form ( mes, rok, den ) {
    return window.confirm('Chcete vytvoriť pdf štatistiku zákazníkov ku '+den+'.'+mes+'.'+rok+'?');
  }


//------------------  OBCHOD  ---------------\\
  function import_art_dod_form ( ) {
    return window.confirm('Chcete naimportovať artikle do databázy?');
  }
  function schval_objednavky ( cislo ) {
    return window.confirm('Chcete schváliť objednávku číslo:'+cislo+'?');
  }
  function storno_objednavky ( cislo ) {
    return window.confirm('Chcete stornovať objednávku číslo:'+cislo+'?');
  }
  function faktura_objednavky ( cislo ) {
    return window.confirm('Chcete vygenerovať faktúru na objednávku číslo:'+cislo+'?');
  }
  function dodanie_objednavky ( cislo ) {
    return window.confirm('Chcete odoslať mail o dodaní objednávky číslo:'+cislo+'?');
  }


//------------------  FAKTURY  ---------------\\
  function delete_form ( cislo ) {
    return window.confirm('Chcete vymazať záznam číslo:'+cislo+'?');
  }
  function deleteU_form ( cislo ) {
    return window.confirm('Chcete vymazať úhradu k faktúre číslo:'+cislo+'?');
  }
  function delete_form_upom ( cislo, cislo2 ) {
    if ( cislo2 ) {
	  alert ("Pre danú upomienku je už vygenerovaná faktúra.");
	  return false;
	}
	else {
      return window.confirm('Chcete vymazať záznam číslo:'+cislo+'?');
	}
  }
  function platba_form ( cislo ) {
    return window.confirm('Chcete pridať platbu k záznamu číslo:'+cislo+'?');
  }
  function vytvor_fakt_form ( mesiac, rok ) {
    return window.confirm('Chcete vytvoriť faktúry na obdobie :'+rok+'/'+mesiac+'?');
  }
  function vytvor_faktdl_form ( ) {
    return window.confirm('Chcete vytvoriť faktúry k dod.listom?');
  }
  function vytvor_pdffakt_form ( ) {
    return window.confirm('Chcete vytvoriť pdf dokumenty faktúr');
  }
  function vytvor_zakfakt_form ( ) {
    return window.confirm('Chcete vytvoriť pdf dokumenty faktúr pre zákazníkov?');
  }
  function mail_zakfakt_form ( ) {
    return window.confirm('Chcete odoslať pdf dokumenty faktúr mailom zákazníkom?');
  }
  function vygen_upomfakt_form ( mesiac, rok ) {
    return window.confirm('Chcete vygenerovať upomienky na obdobie: '+rok+'/'+mesiac+'?');
  }
  function vytvor_upomfakt_form ( mesiac, rok ) {
    return window.confirm('Chcete vytvoriť pdf dokument upomienok pre zákazníkov: '+rok+'/'+mesiac+'?');
  }
  function stat_upomfakt_form ( mesiac, rok ) {
    return window.confirm('Chcete vytvoriť štatistiku upomienok pre zákazníkov: '+rok+'/'+mesiac+'?');
  }
  function zobraz_od_do_fakt_form () {
    return window.confirm('Chcete opätovne vytvoriť pdf dokumenty faktúr?');
  }

  function odblokuj_faktury_form ( spo, mesiac, rok ) {
    var name = window.prompt('Chcete odblokovať všetky faktúry z'+rok+'/'+mesiac+' ? \n B- Generuj PDF\n Z- Poslať zák.poštou\n M- Poslať zák.mail', 'Z');
 
    if ( name ){
	
      if ( name == "B" ) 
        var popis = 'B- Generuj PDF';
      if ( name == "Z" ) 
        var popis = 'Z- Poslať zák.poštou';
      if ( name == "M" ) 
        var popis = 'M- Poslať zák.mail';
	  
      if ( name == "B" || name == "Z" || name == "M" ) 
	    var otazka = window.confirm('Chcete odblokovať faktúry typu:'+popis+'?');
		
		if ( otazka ) {
 		  var lklav = odblokuj_faktury_v_obdobi ( name, spo, mesiac, rok );
          if ( lklav ) {
            if ( name == "B" )
	          window.alert('Faktúry `Generuj PDF` boli odblokované.');
            if ( name == "Z" )
	          window.alert('Faktúry `Poslať zák.poštou` boli odblokované.');
            if ( name == "M" )
	          window.alert('Faktúry `Poslať zák.mail` boli odblokované.');
			  
			return 1;
		  }
		  else {
         	return 0;
		  }  
		}
	    else
	      return 0;

	}
	return 0;
  }
  function potvrd_den_zml( ) {
    document.strankaDMR.submit();
	}	
  function potvrd_mesiac_zml( ) {
    document.strankaDMR.submit();
	}
  function potvrd_rok_zml( ) {
    document.strankaDMR.submit();
	}	

