// BIBLIOTEKA FUNKCJI DO STRON TYPU _GATEx

function jsProcComp(n)
{
  // n-dowolny komponent formularza "form.comp"
  // sprawdza obecnosc

  var v = true;
  if (n == null) v = false;

 return(v);
}


function jsProcTextLength(n)
{
  // n-pole jedno/wielowierszowe (input/textarea)
  // ilosc znakow w polu

  var i = 0;
  var v = 0;
  var w = n.value;

  for (i = 0; i < w.length; i++)
    if ((w.substring(i, i + 1) != unescape("%2C")) &&
        (w.substring(i, i + 1) != unescape("%2D")) &&
        (w.substring(i, i + 1) != unescape("%2E")) &&
        (w.substring(i, i + 1) != unescape("%3A")) &&
        (w.substring(i, i + 1) != unescape("%3B")) &&
        (w.substring(i, i + 1) != unescape("%0A")) &&
        (w.substring(i, i + 1) != unescape("%0D")) &&
        (w.substring(i, i + 1) != unescape("%20"))) ++v;

 return(v);
}


function jsProcText(n)
{
  // n-pole jedno/wielowierszowe (input/textarea)
  // bez "=" i "<CR><LF>" - z "<br>"

  var i = 0;
  var v = "";
  var w = n.value;

  while (i < w.length)
  {
    if (w.substring(i, i + 1) == "=") 
    { ++i; }
    else 
    if ((w.substring(i, i + 1) == unescape("%0D")) &&
        (w.substring(i + 1, i + 2) == unescape("%0A")))
        { v += "<br>"; i += 2; }
        else 
        { v += w.substring(i, i + 1); ++i; } 
  }

 return(v);
}


function jsProcPlainText(n, m)
{
  // n-pole jedno/wielowierszowe (input/textarea)
  // m-wymagana dlugosc maksymalna tekstu
  // bez "=" i "<CR><LF>" - ze spacja do dlugosci m

  var i = 0;
  var v = "";
  var w = n.value;

  while ((i < w.length) && ((i < m) || (m == 0)))
  {
    if (w.substring(i, i + 1) == "=") 
    { ++i; }
    else 
    if ((w.substring(i, i + 1) == unescape("%0D")) &&
        (w.substring(i + 1, i + 2) == unescape("%0A")))
        { v += " "; i += 2; }
        else 
        { v += w.substring(i, i + 1); ++i; } 
  }

 return(v);
}



function jsProcNoEmpty(n)
{
  // n-dowolne pole tekstowe, ktore nie moze byc puste
  // sprawdzenie poprawnosci formatu

  var v = false;

  if (jsProcTextLength(n) > 0) v = true;

 if (v == false) n.focus();
 return(v);
}

function jsProcNameIsOk(n)
{
  // n-pole tekstowe nazwy pliku
  // sprawdzenie poprawnosci formatu

  var i = 0;
  var w = n.value;
  var u = "";
  var v = true;

  for (i = 0; i < w.length; i++)
  {
    u = w.substring(i, i + 1);
    
    if (((u >= "A") && (u <= "Z")) ||
        ((u >= "a") && (u <= "z")) ||
        ((u >= "0") && (u <= "9")) ||
        ((u >= " ") && (u <= "!")) ||
        ((u == "_") ||
         (u == ".") || (u == "-") || 
         (u == "¥") || (u == "¹") ||
         (u == "Æ") || (u == "æ") ||
         (u == "Ê") || (u == "ê") ||
         (u == "£") || (u == "³") ||
         (u == "Ñ") || (u == "ñ") ||
         (u == "Ó") || (u == "ó") ||
         (u == "Œ") || (u == "œ") ||
         (u == "¯") || (u == "¿") ||
         (u == "") || (u == "Ÿ"))) {}          // poprawne
         else {v = false;} // nie poprawne
  }
  
  if (w.substring(0, 1) == ".") v = false;

  if (v == false) n.focus();
  return(v);
}


function jsProcNameIsLatin(n)
{
  // n-pole tekstowe nazwy pliku
  // sprawdzenie poprawnosci formatu

  var i = 0;
  var w = n.value;
  var u = "";
  var v = true;

  for (i = 0; i < w.length; i++)
  {
    u = w.substring(i, i + 1);
    
    if (((u >= "A") && (u <= "Z")) ||
        ((u >= "a") && (u <= "z")) ||
        ((u >= "0") && (u <= "9")) ||
        ((u >= "-") && (u <= "-")) ||
        ((u >= " ") && (u <= "!"))) {}           // poprawne
        else {v = false;} // nie poprawne
  }

 if (v == false) n.focus();
 return(v);
}


function jsProcEMail(n)
{
  // n-pole tekstowe zawierajace adres mailowy
  // sprawdzenie poprawnosci formatu

  var w = n.value;
  var v = false;

  if (w == "") { v = true; }                              // brak
  else
  if ((w != "") && 
      (w.indexOf('@', 0) > 0) && 
      (w.indexOf('@', 0) < (w.length - 1))) { v = true; } // poprawny

 if (v == false) n.focus();
 return(v);
}


function jsProcZip(n)
{
  // n-pole tekstowe zawierajace Zip-Code
  // sprawdzenie poprawnosci formatu

  var w = jsProcText(n);
  var v = false;

  if ((w != "") && 
      (w.length == 6) && 
      (w.substring(2, 3) == "-")) v = true; // poprawny

 if (v == false) n.focus();
 return(v);
}


function jsProcNIP(n)
{
  // n-pole tekstowe zawierajace NIP
  // sprawdzenie poprawnosci formatu

  var w = jsProcText(n);
  var v = false;

  if (w == "") { v = true; }                           // brak
  else
  if ((w != "") && (w.length == 13))
  {
     if ((w.substring(3, 4) == "-") &&
         (w.substring(6, 7) == "-") &&
         (w.substring(9, 10) == "-") &&
         (parseInt(w.substring(0, 3)) != 0)) v = true; // poprawna
     else
     if ((w.substring(3, 4) == "-") &&
         (w.substring(7, 8) == "-") &&
         (w.substring(10, 11) == "-") &&
         (parseInt(w.substring(0, 3)) != 0)) v = true; // fizyczna
  }

 if (v == false) n.focus();
 return(v);
}


function jsProcFndYear(n)
{
  // n-pole tekstowe zawierajace FndYear
  // sprawdzenie poprawnosci formatu

  var w = jsProcText(n);
  var v = false;

  if (w == "") { v = true; }
  else
  if ((parseInt(w, 10) >= 1800) &&
      (parseInt(w, 10) <= 2010)) v = true;

 if (v == false) n.focus();
 return(v);
}


function jsProcNumEple(n)
{
  // n-pole tekstowe zawierajace NumEple
  // sprawdzenie poprawnosci formatu

  var w = jsProcText(n);
  var v = false;

  if (w == "") { v = true; }
  else
  if ((parseInt(w, 10) >= 1) &&
      (parseInt(w, 10) <= 50000)) v = true;

 if (v == false) n.focus();
 return(v);
}


function jsProcWeight(n)
{
  // n-pole tekstowe zawierajace udzial exp-imp
  // sprawdzenie poprawnosci formatu

  var w = jsProcText(n);
  var v = false;

  if (w == "") { v = true; }
  else
  if (w != "") 
  {
    if ((parseFloat(w) >= 0) && 
        (parseFloat(w) <= 100)) v = true;
  }

 if (v == false) n.focus();
 return(v);
}


function jsProcInvest(n)
{
  // n-pole wyboru opcji inwestycyjnej

  var v = "0";
  if (n.checked == true) v = "1";

 return(v);
}


function jsProcSelect(n)
{
  // n-lista rozwijana (select), w tym rowniez MULTIPLE

  var v = "";
  var i = 0;

  for (i = 0; i < n.length; ++i)
  {
    if (n.options[i].selected == true) 
    {
      if (v == "") 
      { v += n.options[i].value; } 
      else
      { v +=  ", " + n.options[i].value; } 
    }
  }

 return(v);
}


function jsProcBranch(n, m)
{
  // n-lista rozwijana branzy/podbranzy
  // m-odpowiednia lista rozwijana kierunkow

  var w = "";
  var v = "";

  if ((jsProcComp(n) == true) && (jsProcComp(m) == true))
  {

     w = n.options[n.selectedIndex].value;
     
     if (w != "00.00")
     {

       if (w.substring(3, 5) == "00") 
       { v = w.substring(0, 2) + ".99"; }
       else 
       { v = w; }

       w = m.options[m.selectedIndex].value;
        if (w == "01") v += "i";
        else if (w == "02") v += "e";
             else v += "a";
     }


  } // komponent
 
 return(v);
}


function jsProcSingleBranch(n)
{
  // n-lista rozwijana branzy/podbranzy

  var w = "";
  var v = "";

  if (jsProcComp(n) == true)
  {

     w = n.options[n.selectedIndex].value;
     
     if (w != "00.00")
     {
       if (w.substring(3, 5) == "00") 
       { v = w.substring(0, 2) + ".99"; }
       else 
       { v = w; }
     }


  } // komponent
 
 return(v);
}


function jsProcToday()
{
  // pobiera date i czas z systemu i zwraca jako wynik

    var datef = new Date();
    var w = 0;
    var v = 0;

    w = datef.getYear();
    if (w <= 99) w = 2000 + w; 
    v = w;

    w = datef.getMonth() + 1;
    v = (v * 100) + w;

    w = datef.getDate();
    v = (v * 100) + w;

    w = datef.getHours();
    v = (v * 100) + w;

    w = datef.getMinutes();
    v = (v * 100) + w;

    w = datef.getSeconds();
    v = (v * 100) + w;

 return(v);
}






//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

var b = true; 
var d = "http://www.export-import.pl/";

var s_data = d + "BmbCgi.exe/data";     // inicjacja
var s_edit = d + "BmbCgi.exe/edit";     // edycja
var s_res  = d + "BmbStore.exe/admn";   // platne
var p_edit = "_gate";                   // strona edycji

var err    = 0;                         // kod bledu

var err_pl = new Array();               // opis bledow PL
var err_uk = new Array();               // opis bledow UK
var err_ru = new Array();               // opis bledow RU
var err_ua = new Array();               // opis bledow UA
var err_de = new Array();               // opis bledow DE
var err_sp = new Array();               // opis bledow SP
var err_fr = new Array();               // opis bledow FR

err_pl[0] = "";
err_pl[1] = "B³êdny numer NIP.";
err_pl[2] = "B³êdny rok za³o¿enia.";
err_pl[3] = "B³êdne dane o iloœci zatrudnionych.";
err_pl[4] = "B³êdny kod pocztowy.";
err_pl[5] = "Dane pole nie mo¿e byc puste.";
err_pl[6] = "Dane pole mo¿e byæ puste lub mieæ wartoœæ od 0 do 100."
err_pl[7] = "B³êdny adres poczty elektronicznej."
err_pl[8] = "Dane pole mo¿e zawieraæ: litery - A..Z lub ¥.., cyfry - 0..9"
err_pl[9] = "Dane pole mo¿e zawieraæ: litery - A..Z, cyfry - 0..9"

err_uk[0] = "";
err_uk[1] = "";
err_uk[2] = "";
err_uk[3] = "";
err_uk[4] = "";
err_uk[5] = "Data error. This field should be filled.";
err_uk[6] = "";
err_uk[7] = "Data error. Wrong e-mail address."
err_uk[8] = "";
err_uk[9] = "This field may contain: letters - A..Z, digits - 0..9"

err_ru[0] = "";
err_ru[1] = "";
err_ru[2] = "";
err_ru[3] = "";
err_ru[4] = "";
err_ru[5] = "Äàííîå ïîëå íå ìîæåò áûòü ïóñòûì";
err_ru[6] = "";
err_ru[7] = "Àäðåñ ýëåêòðîííîé ïî÷òû èìååò íåïðàâèëüíûé ôîðìàò.";
err_ru[8] = "";
err_ru[9] = "Äàííîå ïîëå ìîæåò ñîäåðæàòü òîëüêî ëàòèíñêèå áóêâû è öèôðû îò 0 äî 9";

err_ua[0] = "";
err_de[0] = "";
err_sp[0] = "";
err_fr[0] = "";



function jsDataError()
{
  // Analiza i wyswietlanie bledow

  if (frmx.lang.value == "pl") { alert(err_pl[err]); }
  else if (frmx.lang.value == "uk") { alert(err_uk[err]); }
  else if (frmx.lang.value == "ru") { alert(err_ru[err]); }
  else if (frmx.lang.value == "ua") { alert(err_ua[err]); }
  else if (frmx.lang.value == "de") { alert(err_de[err]); }
  else if (frmx.lang.value == "sp") { alert(err_sp[err]); }
  else if (frmx.lang.value == "fr") { alert(err_fr[err]); }
  else { alert(err_uk[err]); }

  err = 0;

 return(0)
}


function jsInitSubmit(n)
{
  /* 
     WYWOLANIE STRONY AUTORYZACJI (id/haslo)

     Parametry funkcji:
     ==================
     n - nazwa formularza autoryzacji (this.form)

     Parametry formularza:
     =====================
     nmr  - numer bramki, z inicjacji jako <#vhidden> lub bezposrednio
     lang - jezyk strony, z inicjacji jako <#vhidden> lub bezposrednio
     page - pole strony hasla
     comm - polecenie wywolania strony (pswrd)

     UWAGI:
     Formularz ma tylko zadeklarowana dowolna nazwe.
     Atrybuty "method" i "action" zostana automatycznie
     dodane bezposrednio w ramach danej funkcji.
  */

  if (b == true)
  {

     if ((jsProcComp(n.lang) == true) &&
         (jsProcComp(n.comm) == true) &&
         (jsProcComp(n.page) == true) &&
         (jsProcComp(n.nmr) == true))
     {
      b = false;
      n.action = s_data; 
      n.method = "get";
      n.submit(); 
     }

  }

 return(0);
}


function jsPassSubmit(n)
{
  /* 
     AUTORYZACJA I WYWOLANIE EDYCJI

     Parametry funkcji:
     ==================
     n - nazwa formularza autoryzacji (this.form)

     Parametry formularza:
     =====================
     nmr  - numer bramki, z inicjacji jako <#vhidden>
     lang - jezyk strony, z inicjacji jako <#vhidden>
     idf  - id firmy, pole tekstowe formularza
     txt  - haslo, pole tekstowe formularza 
     page - puste pole strony edycji (doda wg bramki)

     UWAGI:
     1. Formularz ma tylko nazwe, zas "method" i 
        "action" zostana dodane bezposrednio przez
        funkcje.
     2. Przy tworzeniu nazwy strony edycji nie wiemy, ile
        znakow zawiera reprezentacja tekstowa "nmr", (np. 01)
        dlatego najpierw dokonujemy transformacji w liczbe, zas
        nastepnie dodajemy do nazwy strony bazowej (np. _gate).
  */

  if (b == true)
  {
  
     if ((jsProcComp(n.page) == true) &&
         (jsProcComp(n.lang) == true) &&
         (jsProcComp(n.nmr) == true) &&
         (jsProcComp(n.idf) == true) &&
         (jsProcComp(n.txt) == true)) 
     {
      b = false;
      n.page.value = p_edit + parseInt(n.nmr.value);
      n.action = s_edit; 
      n.method = "post";
      n.submit(); 
     }

  }

 return(0);
}


function jsResDataSubmit(n)
{
  /* 
     WYSYLANIE Z AUTORYZACJA

     Parametry funkcji:
     ==================
     0 - tryb zwykly wysylania
     1 - aktualizacja danych firmy
     2 - oferty zagraniczne: wprowadzanie
     3 - oferty zagraniczne: tlumaczenia/edycja

     Parametry formularza:
     =====================
     nmr  - numer bramki, otrzymany jako <#vhidden>
     lang - jezyk strony, otrzymany jako <#vhidden>
     idf  - id firmy, pole tekstowe formularza
     txt  - haslo, pole tekstowe formularza
     off  - tryb wymiany danych, wartosc wpisana
     page - puste pole strony reakcji (doda wg bramki)
     comm - polecenie serwera

  */

 if (b == true)
 {

    if (n == 0) jsDataCollect();
    else if (n == 1) jsDataActual();
    else if (n == 2) jsDataOffers();
    else if (n == 3) jsDataEdits();

    if (err == 0) 
    { 

      if ((jsProcComp(frmx.page) == true) &&
          (jsProcComp(frmx.lang) == true) &&
          (jsProcComp(frmx.comm) == true) &&
          (jsProcComp(frmx.nmr) == true) &&
          (jsProcComp(frmx.idf) == true) &&
          (jsProcComp(frmx.txt) == true) &&
          (jsProcComp(frmx.off) == true)) 
      {
       b = false;
       frmx.page.value = p_edit + parseInt(frmx.nmr.value);
       if (frmx.off.value == "") frmx.off.value = "303";
       frmx.action = s_res;
       frmx.method = "post";
       frmx.submit(); 
      }

    }
    else 
    { 
      jsDataError(); 
    }

 }

 return(0);
}


function jsDataCollect()
{
  /* 
     USTAWIANIE ZBIORU NOWYCH DANYCH

     Parametry funkcji:
     ==================
     brak

     Operacje:
     =========
     BEZWARUNKOWO:
      a) bada obecnosc i poprawnosc pol formularza "frm"
      b) ustawia ukryte pola "frmx", gdy sa odpowiedniki "frm"
      c) zwraca kody bledow, jesli wystapily

     Uwaga:
     ======
     Zalozenie stale: jesli istnieje pole o nazwie "nazwa"
     w formularzu frm (tzn. frm.nazwa) to pole o analogicznej
     nazwie POWINNO istniec w formularzu wysylanym ukrytych
     pol frmx (tzn. frmx.nazwa)
  */


    // nazwa
    if (jsProcComp(frm.name) == true)
    {
      if (jsProcNoEmpty(frm.name) == true) 
      {
        if (jsProcNameIsOk(frm.name) == true) 
        {
         frmx.name.value = jsProcText(frm.name); 
        }
        else { err = 8; }
      }
      else { err = 5; }
    }

    // ulica
    if (jsProcComp(frm.street) == true)
    {
      if (jsProcNoEmpty(frm.street) == true) 
       frmx.street.value = jsProcText(frm.street); 
       else err = 5;
    }

    // kod pocztowy
    if (jsProcComp(frm.zip) == true)
    {
      if (jsProcZip(frm.zip) == true) 
       frmx.zip.value = jsProcText(frm.zip); 
       else err = 4;
    }

    // miasto
    if (jsProcComp(frm.town) == true)
    {
      if (jsProcNoEmpty(frm.town) == true) 
       frmx.town.value = jsProcText(frm.town); 
       else err = 5;
    }

    // numer kierunkowy
    if (jsProcComp(frm.glpdir) == true)
    {
      if (jsProcNoEmpty(frm.glpdir) == true) 
       frmx.glpdir.value = jsProcText(frm.glpdir);
       else err = 5;
    }

    // numer(y) telefonu(ow)
    if (jsProcComp(frm.glpnum) == true)
    {
      if (jsProcNoEmpty(frm.glpnum) == true) 
       frmx.glpnum.value = jsProcText(frm.glpnum);
       else err = 5;
    }

    // numer(y) faksu(ow)
    if (jsProcComp(frm.glfnum) == true)
     frmx.glfnum.value = jsProcText(frm.glfnum);

    // e-mail
    if (jsProcComp(frm.glemail) == true)
    {
      if (jsProcNoEmpty(frm.glemail) == true) 
    {
      if (jsProcEMail(frm.glemail) == true) 
       frmx.glemail.value = jsProcText(frm.glemail);
       else err = 7;
    }
      else { err = 5; }
    }   

    // www
    if (jsProcComp(frm.glwww) == true)
     frmx.glwww.value = jsProcText(frm.glwww);

    // bank
    if (jsProcComp(frm.bank) == true)
     frmx.bank.value = jsProcText(frm.bank);

    // konto
    if (jsProcComp(frm.acct) == true)
     frmx.acct.value = jsProcText(frm.acct);

    // nip
    if (jsProcComp(frm.nip) == true)
     frmx.nip.value = jsProcText(frm.nip); 
      
    // regon
    if (jsProcComp(frm.regon) == true)
     frmx.regon.value = jsProcText(frm.regon);

    // rok zalozenia
    if (jsProcComp(frm.fndyear) == true)
    {
      if (jsProcFndYear(frm.fndyear) == true) 
       frmx.fndyear.value = jsProcText(frm.fndyear); 
       else err = 2;
    }

    // ilosc zatrudnionych
    if (jsProcComp(frm.numeple) == true)
    {
      if (jsProcNumEple(frm.numeple) == true) 
        frmx.numeple.value = jsProcText(frm.numeple); 
        else err = 3;
    }

    // wojewodztwo
    if (jsProcComp(frm.wojcode) == true)
     frmx.wojcode.value = jsProcSelect(frm.wojcode);

    // powiat
    if (jsProcComp(frm.powcode) == true)
     frmx.powcode.value = jsProcSelect(frm.powcode);

    // wlasnosc
    if (jsProcComp(frm.owncode) == true)
     frmx.owncode.value = jsProcSelect(frm.owncode);

    // forma prawna
    if (jsProcComp(frm.lawcode) == true)
     frmx.lawcode.value = jsProcSelect(frm.lawcode);

    // obrot, rok - 1
    if (jsProcComp(frm.tr1code) == true)
     frmx.tr1code.value = jsProcSelect(frm.tr1code);

    // obrot, rok - 2
    if (jsProcComp(frm.tr2code) == true)
     frmx.tr2code.value = jsProcSelect(frm.tr2code);



    // KIEROWNICTWO

    if (jsProcComp(frm.pm1nme) == true)
     frmx.pm1nme.value = jsProcText(frm.pm1nme);

    if (jsProcComp(frm.pm1pst) == true)
     frmx.pm1pst.value = jsProcText(frm.pm1pst);

    if (jsProcComp(frm.pm2nme) == true)
     frmx.pm2nme.value = jsProcText(frm.pm2nme);

    if (jsProcComp(frm.pm2pst) == true)
     frmx.pm2pst.value = jsProcText(frm.pm2pst);
 
    if (jsProcComp(frm.pm3nme) == true)
     frmx.pm3nme.value = jsProcText(frm.pm3nme);

    if (jsProcComp(frm.pm3pst) == true)
     frmx.pm3pst.value = jsProcText(frm.pm3pst);

    // kontakt
    if (jsProcComp(frm.phnme) == true)
     frmx.phnme.value  = jsProcText(frm.phnme);

    if (jsProcComp(frm.phpst) == true)
     frmx.phpst.value  = jsProcText(frm.phpst);


    // OPISY POSZERZONE

    // filie
    if (jsProcComp(frm.reploc) == true)
     frmx.reploc.value = jsProcText(frm.reploc);

    // zagraniczne
    if (jsProcComp(frm.repglb) == true)
     frmx.repglb.value = jsProcText(frm.repglb);

    // organy
    if (jsProcComp(frm.organs) == true)
     frmx.organs.value = jsProcText(frm.organs);

    // nagrody
    if (jsProcComp(frm.awards) == true)
     frmx.awards.value = jsProcText(frm.awards);

    // infrastruktura
    if (jsProcComp(frm.infras) == true)
     frmx.infras.value = jsProcText(frm.infras);

    // reklama
    if (jsProcComp(frm.advert) == true)
     frmx.advert.value = jsProcText(frm.advert);


    // ZDJECIA

    if (jsProcComp(frm.apic1) == true)
     frmx.apic1.value  = jsProcText(frm.apic1);

    if (jsProcComp(frm.apic2) == true)
     frmx.apic2.value  = jsProcText(frm.apic2);

    if (jsProcComp(frm.apic3) == true)
     frmx.apic3.value  = jsProcText(frm.apic3);

    if (jsProcComp(frm.apic4) == true)
     frmx.apic4.value  = jsProcText(frm.apic4);

    if (jsProcComp(frm.apic5) == true)
     frmx.apic5.value  = jsProcText(frm.apic5);

    if (jsProcComp(frm.apic6) == true)
     frmx.apic6.value  = jsProcText(frm.apic6);

    if (jsProcComp(frm.apic7) == true)
     frmx.apic7.value  = jsProcText(frm.apic7);

    if (jsProcComp(frm.apic8) == true)
     frmx.apic8.value  = jsProcText(frm.apic8);

    if (jsProcComp(frm.apic9) == true)
     frmx.apic9.value  = jsProcText(frm.apic9);


    // CHARAKTERYSTYKA

    // import-kraje
    if (jsProcComp(frm.cnsimp) == true)
     frmx.cnsimp.value = jsProcSelect(frm.cnsimp);

    // export-kraje
    if (jsProcComp(frm.cnsexp) == true)
     frmx.cnsexp.value = jsProcSelect(frm.cnsexp);

    // import-udzial
    if (jsProcComp(frm.udzimp) == true)
    {
      if (jsProcWeight(frm.udzimp) == true) 
       frmx.udzimp.value = jsProcText(frm.udzimp);
       else err = 6;
    }

    // export-udzial
    if (jsProcComp(frm.udzexp) == true)
    {
      if (jsProcWeight(frm.udzexp) == true) 
       frmx.udzexp.value = jsProcText(frm.udzexp);
       else err = 6;
    }


    // iloœæ ob. graf
    if (jsProcComp(frm.obg) == true)
     frmx.obg.value = jsProcText(frm.obg);

    // iloœæ logo
    if (jsProcComp(frm.logo) == true)
     frmx.logo.value = jsProcInvest(frm.logo);

    // iloœæ cena netto
    if (jsProcComp(frm.cena) == true)
     frmx.cena.value = jsProcText(frm.cena);


    
    // PARTNERSTWO
 
    if (jsProcComp(frm.istrg) == true)
     frmx.istrg.value = jsProcInvest(frm.istrg);

    if (jsProcComp(frm.ijv) == true)
     frmx.ijv.value = jsProcInvest(frm.ijv);

    if (jsProcComp(frm.ipss) == true)
     frmx.ipss.value = jsProcInvest(frm.ipss);

    if (jsProcComp(frm.itch) == true)
     frmx.itch.value = jsProcInvest(frm.itch);


    // BRANZA 1
 
    if ((jsProcComp(frm.forbrn1) == true) && 
        (jsProcComp(frm.fordir1) == true))
      frmx.brn1.value = jsProcBranch(frm.forbrn1, frm.fordir1);
    if (jsProcComp(frm.gdsoff1) == true)
     frmx.gdsoff1.value = jsProcText(frm.gdsoff1);
    if (jsProcComp(frm.gdssrc1) == true)
     frmx.gdssrc1.value = jsProcText(frm.gdssrc1);


    // BRANZA 2
 
    if ((jsProcComp(frm.forbrn2) == true) && 
        (jsProcComp(frm.fordir2) == true))
      frmx.brn2.value = jsProcBranch(frm.forbrn2, frm.fordir2);
    if (jsProcComp(frm.gdsoff2) == true)
     frmx.gdsoff2.value = jsProcText(frm.gdsoff2);
    if (jsProcComp(frm.gdssrc2) == true)
     frmx.gdssrc2.value = jsProcText(frm.gdssrc2);


    // BRANZA 3
 
    if ((jsProcComp(frm.forbrn3) == true) && 
        (jsProcComp(frm.fordir3) == true))
    frmx.brn3.value = jsProcBranch(frm.forbrn3, frm.fordir3);
    if (jsProcComp(frm.gdsoff3) == true)
     frmx.gdsoff3.value = jsProcText(frm.gdsoff3);
    if (jsProcComp(frm.gdssrc3) == true)
     frmx.gdssrc3.value = jsProcText(frm.gdssrc3);

    // rodzaj bazy
    if (jsProcComp(frm.rodz) == true)
     frmx.rodz.value = jsProcSelect(frm.rodz);

    if (jsProcComp(frm.bmbank) == true)
     frmx.bmbank.value = jsProcInvest(frm.bmbank);

    if (jsProcComp(frm.b2b) == true)
     frmx.b2b.value = jsProcInvest(frm.b2b);

    if (jsProcComp(frm.okr) == true)
     frmx.okr.value = jsProcSelect(frm.okr);





    // UWAGI

    if (jsProcComp(frm.notice) == true)
     frmx.notice.value  = jsProcText(frm.notice);

    // ZAMAWIA PAKIT OSOBA

    if (jsProcComp(frm.oszamow) == true)
     frmx.oszamow.value  = jsProcText(frm.oszamow);

    // PODPISUJE FAKTURY OSOBA

    if (jsProcComp(frm.osfaktur) == true)
     frmx.osfaktur.value  = jsProcText(frm.osfaktur);


    //AKWIZYTOR

    if (jsProcComp(frm.akwizytor) == true)
     frmx.akwizytor.value = jsProcInvest(frm.akwizytor);
   
   // rekordy
   if (jsProcComp(frm.rek) == true) 
        frmx.rek.value = jsProcText(frm.rek); 
     


   
    // DATA
   
    if (jsProcComp(frmx.datef) == true)
     frmx.datef.value = jsProcToday();

    // HASLO
    if (jsProcComp(frmx.txt) == true)
    {
      if (jsProcTextLength(frmx.txt) == 0)
      {
        frmx.txt.focus();
        err = 5;
      }
    }

    // ID
    if (jsProcComp(frmx.idf) == true)
    {
      if (jsProcTextLength(frmx.idf) == 0) 
      {
        frmx.idf.focus();
        err = 5;
      }
    } 

    // gminy - oferty inwestycyjne, aktualizacja

    if (jsProcComp(frm.status) == true)
     frmx.status.value  = jsProcText(frm.status);

    if (jsProcComp(frm.chef) == true)
     frmx.chef.value  = jsProcText(frm.chef);

    if (jsProcComp(frm.nrof) == true)
     frmx.nrof.value  = jsProcText(frm.nrof);

    if (jsProcComp(frm.index) == true)
     frmx.index.value = jsProcSelect(frm.index);

    if (jsProcComp(frm.dataof) == true)
     frmx.dataof.value  = jsProcText(frm.dataof);

    if (jsProcComp(frm.nameof) == true)
     frmx.nameof.value  = jsProcText(frm.nameof);    

    if (jsProcComp(frm.kodlok) == true) 
     frmx.kodlok.value = jsProcText(frm.kodlok); 

    if (jsProcComp(frm.townlok) == true)
     frmx.townlok.value  = jsProcText(frm.townlok);    

    if (jsProcComp(frm.adreslok) == true)
     frmx.adreslok.value  = jsProcText(frm.adreslok);    

    if (jsProcComp(frm.owner) == true)
     frmx.owner.value  = jsProcText(frm.owner);    

    if (jsProcComp(frm.kodowner) == true)
     frmx.kodowner.value  = jsProcText(frm.kodowner);    

    if (jsProcComp(frm.townowner) == true)
     frmx.townowner.value  = jsProcText(frm.townowner);    

    if (jsProcComp(frm.adresowner) == true)
     frmx.adresowner.value  = jsProcText(frm.adresowner);    

    if (jsProcComp(frm.pow) == true)
     frmx.pow.value  = jsProcText(frm.pow);    

    if (jsProcComp(frm.bud) == true)
     frmx.bud.value  = jsProcText(frm.bud);   

    if (jsProcComp(frm.infrael) == true)
     frmx.infrael.value  = jsProcInvest(frm.infrael);   

    if (jsProcComp(frm.infrawod) == true)
     frmx.infrawod.value  = jsProcInvest(frm.infrawod);   

    if (jsProcComp(frm.infrakan) == true)
     frmx.infrakan.value  = jsProcInvest(frm.infrakan);   

    if (jsProcComp(frm.infragaz) == true)
     frmx.infragaz.value  = jsProcInvest(frm.infragaz);   

    if (jsProcComp(frm.infratel) == true)
     frmx.infratel.value  = jsProcInvest(frm.infratel);   

    if (jsProcComp(frm.infradrog) == true)
     frmx.infradrog.value  = jsProcInvest(frm.infradrog);   

    if (jsProcComp(frm.infrakol) == true)
     frmx.infrakol.value  = jsProcInvest(frm.infrakol);   

    if (jsProcComp(frm.sprz) == true)
     frmx.sprz.value  = jsProcInvest(frm.sprz);   

    if (jsProcComp(frm.dzier) == true)
     frmx.dzier.value  = jsProcInvest(frm.dzier);   

    if (jsProcComp(frm.wiecz) == true)
     frmx.wiecz.value  = jsProcInvest(frm.wiecz);   

    if (jsProcComp(frm.aport) == true)
     frmx.wiecz.aport  = jsProcInvest(frm.aport);   

    if (jsProcComp(frm.ksw) == true)
     frmx.ksw.value  = jsProcText(frm.ksw);  

    if (jsProcComp(frm.uksw) == true)
     frmx.uksw.value  = jsProcText(frm.uksw);  
 
    if (jsProcComp(frm.cenaof) == true)
     frmx.cenaof.value  = jsProcText(frm.cenaof);  

    if (jsProcComp(frm.oppic1) == true)
     frmx.oppic1.value  = jsProcText(frm.oppic1);  

    if (jsProcComp(frm.oppic2) == true)
     frmx.oppic2.value  = jsProcText(frm.oppic2); 

    if (jsProcComp(frm.chef) == true)
     frmx.chef.value  = jsProcText(frm.chef); 

    if (jsProcComp(frm.namechef) == true)
     frmx.namechef.value  = jsProcText(frm.namechef); 

    if (jsProcComp(frm.emailchef) == true)
     frmx.emailchef.value  = jsProcText(frm.emailchef); 

    if (jsProcComp(frm.telchef) == true)
     frmx.telchef.value  = jsProcText(frm.telchef); 

    if (jsProcComp(frm.second) == true)
     frmx.second.value  = jsProcText(frm.second); 

    if (jsProcComp(frm.telsecond) == true)
     frmx.telsecond.value  = jsProcText(frm.telsecond); 

    if (jsProcComp(frm.emailsecond) == true)
     frmx.emailsecond.value  = jsProcText(frm.emailsecond); 

    if (jsProcComp(frm.przew) == true)
     frmx.przew.value  = jsProcText(frm.przew); 

    if (jsProcComp(frm.telprzew) == true)
     frmx.telprzew.value  = jsProcText(frm.telprzew); 

    if (jsProcComp(frm.emailprzew) == true)
     frmx.emailprzew.value  = jsProcText(frm.emailprzew); 

    if (jsProcComp(frm.sekret) == true)
     frmx.sekret.value  = jsProcText(frm.sekret); 

    if (jsProcComp(frm.telsekret) == true)
     frmx.telsekret.value  = jsProcText(frm.telsekret); 

    if (jsProcComp(frm.emailsekret) == true)
     frmx.emailsekret.value  = jsProcText(frm.emailsekret); 

    if (jsProcComp(frm.skarb) == true)
     frmx.skarb.value  = jsProcText(frm.skarb); 

    if (jsProcComp(frm.telskarb) == true)
     frmx.telskarb.value  = jsProcText(frm.telskarb); 

    if (jsProcComp(frm.emailskarb) == true)
     frmx.emailskarb.value  = jsProcText(frm.emailskarb); 

    if (jsProcComp(frm.kinv) == true)
     frmx.kinv.value  = jsProcText(frm.kinv); 

    if (jsProcComp(frm.telkinv) == true)
     frmx.telkinv.value  = jsProcText(frm.telkinv); 

    if (jsProcComp(frm.emailkinv) == true)
     frmx.emailkinv.value  = jsProcText(frm.emailkinv); 

    if (jsProcComp(frm.namepodpis) == true)
     frmx.namepodpis.value  = jsProcText(frm.namepodpis);  

    if (jsProcComp(frm.mailpodpis) == true)
     frmx.mailpodpis.value  = jsProcText(frm.mailpodpis);  

    if (jsProcComp(frm.telpodpis) == true)
     frmx.telpodpis.value  = jsProcText(frm.telpodpis);  

    if (jsProcComp(frm.zgoda) == true)
     frmx.zgoda.value  = jsProcText(frm.zgoda);  

    if (jsProcComp(frm.przedstawiciel) == true)
     frmx.przedstawiciel.value  = jsProcText(frm.przedstawiciel);  

 return(0)
}


function jsDataActual()
{
  /* 
     USTAWIANIE ZBIORU AKTUALIZACJI DANYCH

     Operacje:
     =========
     JESLI POLE ZOSTALO ZAZNACZONE JAKO POLE DO AKTUALIZACJI:
      a) bada obecnosc i poprawnosc pol formularza "frm"
      b) ustawia ukryte pola "frmx", gdy sa odpowiedniki "frm"
      c) zwraca kody bledow, jesli wystapily
  */

    // nazwa: nowa/stara
    frmx.newn.value = jsProcText(frm.newn); 
    frmx.name.value = jsProcText(frm.name); 

    // ulica
    if (frm.n_street.checked == true)
    {
       if (jsProcComp(frm.street) == true)
       {
         if (jsProcNoEmpty(frm.street) == true) 
          frmx.street.value = jsProcText(frm.street); 
          else err = 5;
       }
    }

    // kod pocztowy
    if (frm.n_zip.checked == true)
    {
       if (jsProcComp(frm.zip) == true)
       {
         if (jsProcZip(frm.zip) == true) 
          frmx.zip.value = jsProcText(frm.zip); 
          else err = 4;
       }
    }

    // miasto
    if (frm.n_town.checked == true)
    {
       if (jsProcComp(frm.town) == true)
       {
         if (jsProcNoEmpty(frm.town) == true) 
          frmx.town.value = jsProcText(frm.town); 
          else err = 5;
       }
    }

    // numer kierunkowy
    if (frm.n_glpdir.checked == true)
    {
       if (jsProcComp(frm.glpdir) == true)
       {
         if (jsProcNoEmpty(frm.glpdir) == true) 
          frmx.glpdir.value = jsProcText(frm.glpdir);
          else err = 5;
       }
    }

    // numer(y) telefonu(ow)
    if (frm.n_glpnum.checked == true)
    {
       if (jsProcComp(frm.glpnum) == true)
       {
         if (jsProcNoEmpty(frm.glpnum) == true) 
          frmx.glpnum.value = jsProcText(frm.glpnum);
          else err = 5;
       }
    }

    // numer(y) faksu(ow)
    if (frm.n_glfnum.checked == true)
    {
       if (jsProcComp(frm.glfnum) == true)
        frmx.glfnum.value = jsProcText(frm.glfnum);
    }

    // e-mail
    if (frm.n_glemail.checked == true)
    {
       if (jsProcComp(frm.glemail) == true)
       {
         if (jsProcEMail(frm.glemail) == true) 
          frmx.glemail.value = jsProcText(frm.glemail);
          else err = 7;
       }
    }

    // www
    if (frm.n_glwww.checked == true)
    {
       if (jsProcComp(frm.glwww) == true)
        frmx.glwww.value = jsProcText(frm.glwww);
    }

    // bank
    if (frm.n_bank.checked == true)
    {
       if (jsProcComp(frm.bank) == true)
        frmx.bank.value = jsProcText(frm.bank);
    }

    // konto
    if (frm.n_acct.checked == true)
    {
       if (jsProcComp(frm.acct) == true)
        frmx.acct.value = jsProcText(frm.acct);
    }

    // wojewodztwo
    if (frm.n_wojcode.checked == true)
    {
       if (jsProcComp(frm.wojcode) == true)
        frmx.wojcode.value = jsProcSelect(frm.wojcode);
    }

    // powiat
    if (frm.n_powcode.checked == true)
    {
       if (jsProcComp(frm.powcode) == true)
        frmx.powcode.value = jsProcSelect(frm.powcode);
    }

    // wlasnosc
    if (frm.n_owncode.checked == true)
    {
       if (jsProcComp(frm.owncode) == true)
        frmx.owncode.value = jsProcSelect(frm.owncode);
    }

    // forma prawna
    if (frm.n_lawcode.checked == true)
    {
       if (jsProcComp(frm.lawcode) == true)
        frmx.lawcode.value = jsProcSelect(frm.lawcode);
    }

    // OBROTY
    if (frm.n_tr1code.checked == true)
    {
       if (jsProcComp(frm.tr1code) == true)
        frmx.tr1code.value = jsProcSelect(frm.tr1code);
    }

    if (frm.n_tr2code.checked == true)
    {
       if (jsProcComp(frm.tr2code) == true)
        frmx.tr2code.value = jsProcSelect(frm.tr2code);
    }


    // kierownictwo/kontakt
    if (frm.n_pm1nme.checked == true)
    {
       if (jsProcComp(frm.pm1nme) == true)
        frmx.pm1nme.value = jsProcText(frm.pm1nme);
    }

    if (frm.n_pm1pst.checked == true)
    {
       if (jsProcComp(frm.pm1pst) == true)
        frmx.pm1pst.value = jsProcText(frm.pm1pst);
    }

    if (frm.n_pm2nme.checked == true)
    {
       if (jsProcComp(frm.pm2nme) == true)
        frmx.pm2nme.value = jsProcText(frm.pm2nme);
    }

    if (frm.n_pm2pst.checked == true)
    {
       if (jsProcComp(frm.pm2pst) == true)
        frmx.pm2pst.value = jsProcText(frm.pm2pst);
    }
 
    if (frm.n_pm3nme.checked == true)
    {
       if (jsProcComp(frm.pm3nme) == true)
        frmx.pm3nme.value = jsProcText(frm.pm3nme);
    }

    if (frm.n_pm3pst.checked == true)
    {
       if (jsProcComp(frm.pm3pst) == true)
        frmx.pm3pst.value = jsProcText(frm.pm3pst);
    }

    if (frm.n_phnme.checked == true)
    {
       if (jsProcComp(frm.phnme) == true)
        frmx.phnme.value  = jsProcText(frm.phnme);
    }

    if (frm.n_phpst.checked == true)
    {
       if (jsProcComp(frm.phpst) == true)
        frmx.phpst.value  = jsProcText(frm.phpst);
    }


    if (frm.n_invst.checked == true)
    {
       if (jsProcComp(frm.istrg) == true)
        frmx.istrg.value = jsProcInvest(frm.istrg);

       if (jsProcComp(frm.ijv) == true)
        frmx.ijv.value = jsProcInvest(frm.ijv);

       if (jsProcComp(frm.ipss) == true)
        frmx.ipss.value = jsProcInvest(frm.ipss);

       if (jsProcComp(frm.itch) == true)
        frmx.itch.value = jsProcInvest(frm.itch);
    }

    // UWAGI

    if (jsProcComp(frm.notice) == true)
     frmx.notice.value  = jsProcText(frm.notice);

    // DATA
   
    if (jsProcComp(frmx.datef) == true)
     frmx.datef.value = jsProcToday();

    // HASLO
    if (jsProcComp(frmx.txt) == true)
    {
      if (jsProcTextLength(frmx.txt) == 0)
      {
        frmx.txt.focus();
        err = 5;
      }
    }

    // ID
    if (jsProcComp(frmx.idf) == true)
    {
      if (jsProcTextLength(frmx.idf) == 0) 
      {
        frmx.idf.focus();
        err = 5;
      }
    } 


 return(0)
}


function jsDataOffers()
{
  /* 
     USTAWIANIE ZBIORU OFERT ZAGRANICZNYCH

     Operacje:
     =========
      a) bada obecnosc i poprawnosc pol formularza "frm"
      b) ustawia ukryte pola "frmx", gdy sa odpowiedniki "frm"
      c) zwraca kody bledow, jesli wystapily

  */

    var w = 0;
    var v = 0;


    // NUMER OFERTY
    if (jsProcComp(frm.nmof) == true)
     frmx.nmof.value = jsProcSelect(frm.nmof);
    else
     frmx.nmof.value = "1";

    // nazwa
    if (jsProcComp(frm.name) == true)
    {
      if (jsProcNoEmpty(frm.name) == true) 
      {
        if (jsProcNameIsLatin(frm.name) == true) 
        {
         frmx.o_name.value = jsProcPlainText(frm.name, 0); 
         frmx.name.value   = frmx.o_name.value + "(" + frmx.nmof.value + ")"; 
        }
        else { err = 9; }
      }
      else { err = 5; }
    }

    // adres
    if (jsProcComp(frm.addr) == true)
    {
      if (jsProcNoEmpty(frm.addr) == true) 
       frmx.o_addr.value = jsProcPlainText(frm.addr, 0); 
       else err = 5;
    }

    // osoba do kontaktu
    if (jsProcComp(frm.person) == true)
    {
      if (jsProcNoEmpty(frm.person) == true) 
       frmx.o_person.value = jsProcPlainText(frm.person, 0); 
       else err = 5;
    }


    // numer kierunkowy
    if (jsProcComp(frm.stdc) == true)
    {
      if (jsProcNoEmpty(frm.stdc) == true) 
       frmx.stdc.value = jsProcPlainText(frm.stdc, 0);
       else err = 5;
    }

    // telefon
    if (jsProcComp(frm.phone) == true)
    {
      if (jsProcNoEmpty(frm.phone) == true) 
       frmx.phone.value = jsProcPlainText(frm.phone, 0);
       else err = 5;
    }

    // fax
    if (jsProcComp(frm.fax) == true)
      frmx.fax.value = jsProcPlainText(frm.fax, 0);

    // e-mail
    if (jsProcComp(frm.email) == true)
    {
      if (jsProcEMail(frm.email) == true) 
       frmx.email.value = jsProcPlainText(frm.email, 0);
       else err = 7;
    }

    // www
    if (jsProcComp(frm.www) == true)
     frmx.www.value = jsProcPlainText(frm.www, 0);


    // rodzaj: import/export
    if (jsProcComp(frm.kndo) == true)
     frmx.kndo.value = jsProcSelect(frm.kndo);

    // branza
    if (jsProcComp(frm.brnc) == true)
     frmx.brnc.value = jsProcSingleBranch(frm.brnc);

    // kraj
    if (jsProcComp(frm.cnts) == true)
    {
      frmx.cnts.value = jsProcSelect(frm.cnts);
      frmx.cntx.value = frm.cnts.options[frm.cnts.selectedIndex].text;
    }

    // slowa kluczowe
    if (jsProcComp(frm.keyw) == true)
    {
      if (jsProcNoEmpty(frm.keyw) == true) 
       frmx.o_keyw.value = jsProcPlainText(frm.keyw, 100); 
       else err = 5;
    }

    // komentarz
    if (jsProcComp(frm.detl) == true)
     frmx.o_detl.value = jsProcPlainText(frm.detl, 400); 

    // INWESTYCJE
    if (jsProcComp(frm.istrg) == true)
     frmx.istrg.value = jsProcInvest(frm.istrg);

    if (jsProcComp(frm.ijv) == true)
     frmx.ijv.value = jsProcInvest(frm.ijv);

    if (jsProcComp(frm.ipss) == true)
     frmx.ipss.value = jsProcInvest(frm.ipss);

    if (jsProcComp(frm.itch) == true)
     frmx.itch.value = jsProcInvest(frm.itch);

    // PREZENTACJA
    if (jsProcComp(frm.media) == true)
     frmx.media.value = frm.media.value;

    // AUTOR
    if (jsProcComp(frmx.autof) == true) 
     frmx.autof.value = frmx.idf.value;

    // DATA
    if (jsProcComp(frmx.datef) == true)
     frmx.datef.value = jsProcToday();

    // STATUS
    if (jsProcComp(frm.statf) == true)
     frmx.statf.value = jsProcSelect(frm.statf); 

    // JEZYKI
    frmx.o_lang.value = frmx.lang.value; 
    frmx.a_lang.value = "pl";       

    if (frmx.o_lang.value == "pl")
    {
      frmx.statf.value = "1";  // jezyk polski     

      frmx.a_name.value   = frmx.o_name.value;
      frmx.a_addr.value   = frmx.o_addr.value;
      frmx.a_person.value = frmx.o_person.value;
      frmx.a_keyw.value   = frmx.o_keyw.value;
      frmx.a_detl.value   = frmx.o_detl.value;
    }
    else
    {
      frmx.statf.value = "0";  // jezyk obcy    

      frmx.a_name.value   = "";
      frmx.a_addr.value   = "";
      frmx.a_person.value = "";
      frmx.a_keyw.value   = "";
      frmx.a_detl.value   = "";
    }


 return(0)
}


function jsDataEdits()
{
  /* 
     USTAWIANIE ZBIORU OFERT ZAGRANICZNYCH
  */

    // kraj
    if (jsProcComp(frm.cntx) == true)
    {
      if (jsProcNoEmpty(frm.cntx) == true) 
       frmx.cntx.value = jsProcPlainText(frm.cntx, 0); 
       else err = 5; 
    }

    // kod kierunkowy
    if (jsProcComp(frm.stdc) == true)
    {
      if (jsProcNoEmpty(frm.stdc) == true) 
       frmx.stdc.value = jsProcPlainText(frm.stdc, 0); 
       else err = 5; 
    }

    // telefon
    if (jsProcComp(frm.phone) == true)
    {
      if (jsProcNoEmpty(frm.phone) == true) 
       frmx.phone.value = jsProcPlainText(frm.phone, 0); 
       else err = 5; 
    }

    // fax
    if (jsProcComp(frm.fax) == true)
     frmx.fax.value = jsProcPlainText(frm.fax, 0); 

    // email
    if (jsProcComp(frm.email) == true)
     frmx.email.value = jsProcPlainText(frm.email, 0); 

    // www
    if (jsProcComp(frm.www) == true)
     frmx.www.value = jsProcPlainText(frm.www, 0); 

    // nazwa
    if (jsProcComp(frm.a_name) == true)
    {
      if (jsProcNoEmpty(frm.a_name) == true) 
       frmx.a_name.value = jsProcPlainText(frm.a_name, 0); 
       else err = 5; 
    }

    // adres
    if (jsProcComp(frm.a_addr) == true)
    {
      if (jsProcNoEmpty(frm.a_addr) == true) 
       frmx.a_addr.value = jsProcPlainText(frm.a_addr, 0); 
       else err = 5;
    }

    // osoba do kontaktu
    if (jsProcComp(frm.a_person) == true)
    {
      if (jsProcNoEmpty(frm.a_person) == true) 
       frmx.a_person.value = jsProcPlainText(frm.a_person, 0); 
       else err = 5;
    }

    // slowa kluczowe
    if (jsProcComp(frm.a_keyw) == true)
    {
      if (jsProcNoEmpty(frm.a_keyw) == true) 
       frmx.a_keyw.value = jsProcPlainText(frm.a_keyw, 0); 
       else err = 5;
    }

    // komentarz
    if (jsProcComp(frm.a_detl) == true)
     frmx.a_detl.value = jsProcPlainText(frm.a_detl, 0); 

    // STATUS
    if (jsProcComp(frm.statf) == true)
     frmx.statf.value = jsProcSelect(frm.statf); 

    // przewracamy jezyk orygnalny (jezeli brak bledow !)
    if (err == 0)
     frmx.lang.value = frmx.o_lang.value;

 return(0)
}


