// 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);
}



//xxxxxxxxxxxx

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);

    if (jsProcComp(frm.replocuk) == true)
     frmx.replocuk.value = jsProcText(frm.replocuk);

    if (jsProcComp(frm.replocde) == true)
     frmx.replocde.value = jsProcText(frm.replocde);

    if (jsProcComp(frm.replocfr) == true)
     frmx.replocfr.value = jsProcText(frm.replocfr);

    if (jsProcComp(frm.replocsp) == true)
     frmx.replocsp.value = jsProcText(frm.replocsp);

    if (jsProcComp(frm.replocru) == true)
     frmx.replocru.value = jsProcText(frm.replocru);

    if (jsProcComp(frm.replocua) == true)
     frmx.replocua.value = jsProcText(frm.replocua);

    // zagraniczne
    if (jsProcComp(frm.repglb) == true)
     frmx.repglb.value = jsProcText(frm.repglb);

    if (jsProcComp(frm.repglbuk) == true)
     frmx.repglbuk.value = jsProcText(frm.repglbuk);


    if (jsProcComp(frm.repglbde) == true)
     frmx.repglbde.value = jsProcText(frm.repglbde);


    if (jsProcComp(frm.repglbfr) == true)
     frmx.repglbfr.value = jsProcText(frm.repglbfr);


    if (jsProcComp(frm.repglbsp) == true)
     frmx.repglbsp.value = jsProcText(frm.repglbsp);


    if (jsProcComp(frm.repglbru) == true)
     frmx.repglbru.value = jsProcText(frm.repglbru);

    if (jsProcComp(frm.repglbua) == true)
     frmx.repglbua.value = jsProcText(frm.repglbua);


    // organy
    if (jsProcComp(frm.organs) == true)
     frmx.organs.value = jsProcText(frm.organs);

    if (jsProcComp(frm.organsuk) == true)
     frmx.organsuk.value = jsProcText(frm.organsuk);

    if (jsProcComp(frm.organsde) == true)
     frmx.organsde.value = jsProcText(frm.organsde);

    if (jsProcComp(frm.organsfr) == true)
     frmx.organsfr.value = jsProcText(frm.organsfr);

    if (jsProcComp(frm.organssp) == true)
     frmx.organssp.value = jsProcText(frm.organssp);

    if (jsProcComp(frm.organsru) == true)
     frmx.organsru.value = jsProcText(frm.organsru);

    if (jsProcComp(frm.organsua) == true)
     frmx.organsua.value = jsProcText(frm.organsua);

    // nagrody
    if (jsProcComp(frm.awards) == true)
     frmx.awards.value = jsProcText(frm.awards);

    if (jsProcComp(frm.awardsuk) == true)
     frmx.awardsuk.value = jsProcText(frm.awardsuk);

    if (jsProcComp(frm.awardsde) == true)
     frmx.awardsde.value = jsProcText(frm.awardsde);

    if (jsProcComp(frm.awardsfr) == true)
     frmx.awardsfr.value = jsProcText(frm.awardsfr);

    if (jsProcComp(frm.awardssp) == true)
     frmx.awardssp.value = jsProcText(frm.awardssp);

    if (jsProcComp(frm.awardsru) == true)
     frmx.awardsru.value = jsProcText(frm.awardsru);

    if (jsProcComp(frm.awardsua) == true)
     frmx.awardsua.value = jsProcText(frm.awardsua);


    // infrastruktura
    if (jsProcComp(frm.infras) == true)
     frmx.infras.value = jsProcText(frm.infras);

    if (jsProcComp(frm.infrasuk) == true)
     frmx.infrasuk.value = jsProcText(frm.infrasuk);

    if (jsProcComp(frm.infrasde) == true)
     frmx.infrasde.value = jsProcText(frm.infrasde);

    if (jsProcComp(frm.infrasfr) == true)
     frmx.infrasfr.value = jsProcText(frm.infrasfr);

    if (jsProcComp(frm.infrassp) == true)
     frmx.infrassp.value = jsProcText(frm.infrassp);

    if (jsProcComp(frm.infrasru) == true)
     frmx.infrasru.value = jsProcText(frm.infrasru);

    if (jsProcComp(frm.infrasua) == true)
     frmx.infrasua.value = jsProcText(frm.infrasua);


    // reklama
    if (jsProcComp(frm.advert) == true)
     frmx.advert.value = jsProcText(frm.advert);

    if (jsProcComp(frm.advertuk) == true)
     frmx.advertuk.value = jsProcText(frm.advertuk);

    if (jsProcComp(frm.advertde) == true)
     frmx.advertde.value = jsProcText(frm.advertde);

    if (jsProcComp(frm.advertfr) == true)
     frmx.advertfr.value = jsProcText(frm.advertfr);

    if (jsProcComp(frm.advertsp) == true)
     frmx.advertsp.value = jsProcText(frm.advertsp);

    if (jsProcComp(frm.advertru) == true)
     frmx.advertru.value = jsProcText(frm.advertru);

    if (jsProcComp(frm.advertua) == true)
     frmx.advertua.value = jsProcText(frm.advertua);


    // ZDJECIA
    if (jsProcComp(frm.apic1) == true)
     frmx.apic1.value  = jsProcText(frm.apic1);

    if (jsProcComp(frm.apic1uk) == true)
     frmx.apic1uk.value  = jsProcText(frm.apic1uk);

    if (jsProcComp(frm.apic1de) == true)
     frmx.apic1de.value  = jsProcText(frm.apic1de);

    if (jsProcComp(frm.apic1fr) == true)
     frmx.apic1fr.value  = jsProcText(frm.apic1fr);

    if (jsProcComp(frm.apic1sp) == true)
     frmx.apic1sp.value  = jsProcText(frm.apic1sp);

    if (jsProcComp(frm.apic1ru) == true)
     frmx.apic1ru.value  = jsProcText(frm.apic1ru);

    if (jsProcComp(frm.apic1ua) == true)
     frmx.apic1ua.value  = jsProcText(frm.apic1ua);



    if (jsProcComp(frm.apic2) == true)
     frmx.apic2.value  = jsProcText(frm.apic2);

    if (jsProcComp(frm.apic2uk) == true)
     frmx.apic2uk.value  = jsProcText(frm.apic2uk);

    if (jsProcComp(frm.apic2de) == true)
     frmx.apic2de.value  = jsProcText(frm.apic2de);

    if (jsProcComp(frm.apic2fr) == true)
     frmx.apic2fr.value  = jsProcText(frm.apic2fr);

    if (jsProcComp(frm.apic2sp) == true)
     frmx.apic2sp.value  = jsProcText(frm.apic2sp);

    if (jsProcComp(frm.apic2ru) == true)
     frmx.apic2ru.value  = jsProcText(frm.apic2ru);

    if (jsProcComp(frm.apic2ua) == true)
     frmx.apic2ua.value  = jsProcText(frm.apic2ua);



    if (jsProcComp(frm.apic3) == true)
     frmx.apic3.value  = jsProcText(frm.apic3);

    if (jsProcComp(frm.apic3uk) == true)
     frmx.apic3uk.value  = jsProcText(frm.apic3uk);

    if (jsProcComp(frm.apic3de) == true)
     frmx.apic3de.value  = jsProcText(frm.apic3de);

    if (jsProcComp(frm.apic3fr) == true)
     frmx.apic3fr.value  = jsProcText(frm.apic3fr);

    if (jsProcComp(frm.apic3sp) == true)
     frmx.apic3sp.value  = jsProcText(frm.apic3sp);

    if (jsProcComp(frm.apic3ru) == true)
     frmx.apic3ru.value  = jsProcText(frm.apic3ru);

    if (jsProcComp(frm.apic3ua) == true)
     frmx.apic3ua.value  = jsProcText(frm.apic3ua);



    if (jsProcComp(frm.apic4) == true)
     frmx.apic4.value  = jsProcText(frm.apic4);

    if (jsProcComp(frm.apic4uk) == true)
     frmx.apic4uk.value  = jsProcText(frm.apic4uk);

    if (jsProcComp(frm.apic4de) == true)
     frmx.apic4de.value  = jsProcText(frm.apic4de);

    if (jsProcComp(frm.apic4fr) == true)
     frmx.apic4fr.value  = jsProcText(frm.apic4fr);

    if (jsProcComp(frm.apic4sp) == true)
     frmx.apic4sp.value  = jsProcText(frm.apic4sp);

    if (jsProcComp(frm.apic4ru) == true)
     frmx.apic4ru.value  = jsProcText(frm.apic4ru);

    if (jsProcComp(frm.apic4ua) == true)
     frmx.apic4ua.value  = jsProcText(frm.apic4ua);



    if (jsProcComp(frm.apic5) == true)
     frmx.apic5.value  = jsProcText(frm.apic5);

    if (jsProcComp(frm.apic5uk) == true)
     frmx.apic5uk.value  = jsProcText(frm.apic5uk);

    if (jsProcComp(frm.apic5de) == true)
     frmx.apic5de.value  = jsProcText(frm.apic5de);

    if (jsProcComp(frm.apic5fr) == true)
     frmx.apic5fr.value  = jsProcText(frm.apic5fr);

    if (jsProcComp(frm.apic5sp) == true)
     frmx.apic5sp.value  = jsProcText(frm.apic5sp);

    if (jsProcComp(frm.apic5ru) == true)
     frmx.apic5ru.value  = jsProcText(frm.apic5ru);

    if (jsProcComp(frm.apic5ua) == true)
     frmx.apic5ua.value  = jsProcText(frm.apic5ua);


    if (jsProcComp(frm.apic6) == true)
     frmx.apic6.value  = jsProcText(frm.apic6);

    if (jsProcComp(frm.apic6uk) == true)
     frmx.apic6uk.value  = jsProcText(frm.apic6uk);

    if (jsProcComp(frm.apic6de) == true)
     frmx.apic6de.value  = jsProcText(frm.apic6de);

    if (jsProcComp(frm.apic6fr) == true)
     frmx.apic6fr.value  = jsProcText(frm.apic6fr);

    if (jsProcComp(frm.apic6sp) == true)
     frmx.apic6sp.value  = jsProcText(frm.apic6sp);

    if (jsProcComp(frm.apic6ru) == true)
     frmx.apic6ru.value  = jsProcText(frm.apic6ru);

    if (jsProcComp(frm.apic6ua) == true)
     frmx.apic6ua.value  = jsProcText(frm.apic6ua);



    if (jsProcComp(frm.apic7) == true)
     frmx.apic7.value  = jsProcText(frm.apic7);

    if (jsProcComp(frm.apic7uk) == true)
     frmx.apic7uk.value  = jsProcText(frm.apic7uk);

    if (jsProcComp(frm.apic7de) == true)
     frmx.apic7de.value  = jsProcText(frm.apic7de);

    if (jsProcComp(frm.apic7fr) == true)
     frmx.apic7fr.value  = jsProcText(frm.apic7fr);

    if (jsProcComp(frm.apic7sp) == true)
     frmx.apic7sp.value  = jsProcText(frm.apic7sp);

    if (jsProcComp(frm.apic7ru) == true)
     frmx.apic7ru.value  = jsProcText(frm.apic7ru);

    if (jsProcComp(frm.apic7ua) == true)
     frmx.apic7ua.value  = jsProcText(frm.apic7ua);



    if (jsProcComp(frm.apic8) == true)
     frmx.apic8.value  = jsProcText(frm.apic8);

    if (jsProcComp(frm.apic8uk) == true)
     frmx.apic8uk.value  = jsProcText(frm.apic8uk);

    if (jsProcComp(frm.apic8de) == true)
     frmx.apic8de.value  = jsProcText(frm.apic8de);

    if (jsProcComp(frm.apic8fr) == true)
     frmx.apic8fr.value  = jsProcText(frm.apic8fr);

    if (jsProcComp(frm.apic8sp) == true)
     frmx.apic8sp.value  = jsProcText(frm.apic8sp);

    if (jsProcComp(frm.apic8ru) == true)
     frmx.apic8ru.value  = jsProcText(frm.apic8ru);

    if (jsProcComp(frm.apic8ua) == true)
     frmx.apic8ua.value  = jsProcText(frm.apic8ua);



    if (jsProcComp(frm.apic9) == true)
     frmx.apic9.value  = jsProcText(frm.apic9);

    if (jsProcComp(frm.apic9uk) == true)
     frmx.apic9uk.value  = jsProcText(frm.apic9uk);

    if (jsProcComp(frm.apic9de) == true)
     frmx.apic9de.value  = jsProcText(frm.apic9de);

    if (jsProcComp(frm.apic9fr) == true)
     frmx.apic9fr.value  = jsProcText(frm.apic9fr);

    if (jsProcComp(frm.apic9sp) == true)
     frmx.apic9sp.value  = jsProcText(frm.apic9sp);

    if (jsProcComp(frm.apic9ru) == true)
     frmx.apic9ru.value  = jsProcText(frm.apic9ru);

    if (jsProcComp(frm.apic9ua) == true)
     frmx.apic9ua.value  = jsProcText(frm.apic9ua);



    // 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);

    // logo
    if (jsProcComp(frm.logo) == true)
     frmx.logo.value = jsProcInvest(frm.logo);

    // reklama 
    if (jsProcComp(frm.advpl) == true)
     frmx.advpl.value = jsProcInvest(frm.advpl);

    if (jsProcComp(frm.advuk) == true)
     frmx.advuk.value = jsProcInvest(frm.advuk);

    if (jsProcComp(frm.advde) == true)
     frmx.advde.value = jsProcInvest(frm.advde);

    if (jsProcComp(frm.advfr) == true)
     frmx.advfr.value = jsProcInvest(frm.advfr);

    if (jsProcComp(frm.advsp) == true)
     frmx.advsp.value = jsProcInvest(frm.advsp);

    if (jsProcComp(frm.advru) == true)
     frmx.advru.value = jsProcInvest(frm.advru);

    if (jsProcComp(frm.advua) == true)
     frmx.advua.value = jsProcInvest(frm.advua);




    // 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.index1) == true)
     frmx.index1.value = jsProcSelect(frm.index1);

    if (jsProcComp(frm.index2) == true)
     frmx.index2.value = jsProcSelect(frm.index2);

    if (jsProcComp(frm.index3) == true)
     frmx.index3.value = jsProcSelect(frm.index3);

    if (jsProcComp(frm.index4) == true)
     frmx.index4.value = jsProcSelect(frm.index4);

    if (jsProcComp(frm.index5) == true)
     frmx.index5.value = jsProcSelect(frm.index5);

    if (jsProcComp(frm.index6) == true)
     frmx.index6.value = jsProcSelect(frm.index6);

    if (jsProcComp(frm.index7) == true)
     frmx.index7.value = jsProcSelect(frm.index7);

    if (jsProcComp(frm.dataof1) == true)
     frmx.dataof1.value  = jsProcText(frm.dataof1);

    if (jsProcComp(frm.dataof2) == true)
     frmx.dataof2.value  = jsProcText(frm.dataof2);

    if (jsProcComp(frm.dataof3) == true)
     frmx.dataof3.value  = jsProcText(frm.dataof3);

    if (jsProcComp(frm.dataof4) == true)
     frmx.dataof4.value  = jsProcText(frm.dataof4);

    if (jsProcComp(frm.dataof5) == true)
     frmx.dataof5.value  = jsProcText(frm.dataof5);

    if (jsProcComp(frm.dataof6) == true)
     frmx.dataof6.value  = jsProcText(frm.dataof6);

    if (jsProcComp(frm.dataof7) == true)
     frmx.dataof7.value  = jsProcText(frm.dataof7);

     if (jsProcComp(frm.nameof1) == true)
     frmx.nameof1.value  = jsProcText(frm.nameof1);  

    if (jsProcComp(frm.nameof2) == true)
     frmx.nameof2.value  = jsProcText(frm.nameof2);  

    if (jsProcComp(frm.nameof3) == true)
     frmx.nameof3.value  = jsProcText(frm.nameof3);  

    if (jsProcComp(frm.nameof4) == true)
     frmx.nameof4.value  = jsProcText(frm.nameof4);  

    if (jsProcComp(frm.nameof5) == true)
     frmx.nameof5.value  = jsProcText(frm.nameof5);  

     if (jsProcComp(frm.nameof6) == true)
     frmx.nameof6.value  = jsProcText(frm.nameof6);  

     if (jsProcComp(frm.nameof7) == true)
     frmx.nameof7.value  = jsProcText(frm.nameof7);  

    if (jsProcComp(frm.kodlok1) == true) 
     frmx.kodlok1.value = jsProcText(frm.kodlok1); 

    if (jsProcComp(frm.kodlok2) == true)
     frmx.kodlok2.value = jsProcText(frm.kodlok2);

    if (jsProcComp(frm.kodlok3) == true)
     frmx.kodlok3.value = jsProcText(frm.kodlok3);

    if (jsProcComp(frm.kodlok4) == true)
     frmx.kodlok4.value = jsProcText(frm.kodlok4);

    if (jsProcComp(frm.kodlok5) == true) 
     frmx.kodlok5.value = jsProcText(frm.kodlok5);

    if (jsProcComp(frm.kodlok6) == true) 
     frmx.kodlok6.value = jsProcText(frm.kodlok6); 

    if (jsProcComp(frm.kodlok7) == true) 
     frmx.kodlok7.value = jsProcText(frm.kodlok7); 

    if (jsProcComp(frm.townlok1) == true)
     frmx.townlok1.value  = jsProcText(frm.townlok1);    

    if (jsProcComp(frm.townlok2) == true)
     frmx.townlok2.value  = jsProcText(frm.townlok2);    

    if (jsProcComp(frm.townlok3) == true)
     frmx.townlok3.value  = jsProcText(frm.townlok3);    

    if (jsProcComp(frm.townlok4) == true)
     frmx.townlok4.value  = jsProcText(frm.townlok4);    

    if (jsProcComp(frm.townlok5) == true)
     frmx.townlok5.value  = jsProcText(frm.townlok5);    

    if (jsProcComp(frm.townlok6) == true)
     frmx.townlok6.value  = jsProcText(frm.townlok6);    

    if (jsProcComp(frm.townlok7) == true)
     frmx.townlok7.value  = jsProcText(frm.townlok7);    

    if (jsProcComp(frm.adreslok1) == true)
     frmx.adreslok1.value  = jsProcText(frm.adreslok1);    

    if (jsProcComp(frm.adreslok2) == true)
     frmx.adreslok2.value  = jsProcText(frm.adreslok2);    

    if (jsProcComp(frm.adreslok3) == true)
     frmx.adreslok3.value  = jsProcText(frm.adreslok3);    

    if (jsProcComp(frm.adreslok4) == true)
     frmx.adreslok4.value  = jsProcText(frm.adreslok4);    

    if (jsProcComp(frm.adreslok5) == true)
     frmx.adreslok5.value  = jsProcText(frm.adreslok5);    

    if (jsProcComp(frm.adreslok6) == true)
     frmx.adreslok6.value  = jsProcText(frm.adreslok6);    

    if (jsProcComp(frm.adreslok7) == true)
     frmx.adreslok7.value  = jsProcText(frm.adreslok7);    

    if (jsProcComp(frm.owner1) == true)
     frmx.owner1.value  = jsProcText(frm.owner1);    

    if (jsProcComp(frm.owner2) == true)
     frmx.owner2.value  = jsProcText(frm.owner2);    

    if (jsProcComp(frm.owner3) == true)
     frmx.owner3.value  = jsProcText(frm.owner3);    

    if (jsProcComp(frm.owner4) == true)
     frmx.owner4.value  = jsProcText(frm.owner4);    

    if (jsProcComp(frm.owner5) == true)
     frmx.owner5.value  = jsProcText(frm.owner5);    

    if (jsProcComp(frm.owner6) == true)
     frmx.owner6.value  = jsProcText(frm.owner6);    

    if (jsProcComp(frm.owner7) == true)
     frmx.owner7.value  = jsProcText(frm.owner7);    

    if (jsProcComp(frm.kodowner1) == true)
     frmx.kodowner1.value  = jsProcText(frm.kodowner1);    

    if (jsProcComp(frm.kodowner2) == true)
     frmx.kodowner2.value  = jsProcText(frm.kodowner2);    

    if (jsProcComp(frm.kodowner3) == true)
     frmx.kodowner3.value  = jsProcText(frm.kodowner3);    

    if (jsProcComp(frm.kodowner4) == true)
     frmx.kodowner4.value  = jsProcText(frm.kodowner4);    

    if (jsProcComp(frm.kodowner5) == true)
     frmx.kodowner5.value  = jsProcText(frm.kodowner5);    

    if (jsProcComp(frm.kodowner6) == true)
     frmx.kodowner6.value  = jsProcText(frm.kodowner6);    

    if (jsProcComp(frm.kodowner7) == true)
     frmx.kodowner7.value  = jsProcText(frm.kodowner7);    

    if (jsProcComp(frm.townowner1) == true)
     frmx.townowner1.value  = jsProcText(frm.townowner1);    

    if (jsProcComp(frm.townowner2) == true)
     frmx.townowner2.value  = jsProcText(frm.townowner2);    

    if (jsProcComp(frm.townowner3) == true)
     frmx.townowner3.value  = jsProcText(frm.townowner3);    

    if (jsProcComp(frm.townowner4) == true)
     frmx.townowner4.value  = jsProcText(frm.townowner4);    

    if (jsProcComp(frm.townowner5) == true)
     frmx.townowner5.value  = jsProcText(frm.townowner5);    

    if (jsProcComp(frm.townowner6) == true)
     frmx.townowner6.value  = jsProcText(frm.townowner6);    

    if (jsProcComp(frm.townowner7) == true)
     frmx.townowner7.value  = jsProcText(frm.townowner7);    

    if (jsProcComp(frm.adresowner1) == true)
     frmx.adresowner1.value  = jsProcText(frm.adresowner1);    

    if (jsProcComp(frm.adresowner2) == true)
     frmx.adresowner2.value  = jsProcText(frm.adresowner2);    

    if (jsProcComp(frm.adresowner3) == true)
     frmx.adresowner3.value  = jsProcText(frm.adresowner3);    

    if (jsProcComp(frm.adresowner4) == true)
     frmx.adresowner4.value  = jsProcText(frm.adresowner4);    

    if (jsProcComp(frm.adresowner5) == true)
     frmx.adresowner5.value  = jsProcText(frm.adresowner5);    

    if (jsProcComp(frm.adresowner6) == true)
     frmx.adresowner6.value  = jsProcText(frm.adresowner6);    

    if (jsProcComp(frm.adresowner7) == true)
     frmx.adresowner7.value  = jsProcText(frm.adresowner7);    

    if (jsProcComp(frm.pow1) == true)
     frmx.pow1.value  = jsProcText(frm.pow1);    

    if (jsProcComp(frm.pow2) == true)
     frmx.pow2.value  = jsProcText(frm.pow2);    

    if (jsProcComp(frm.pow3) == true)
     frmx.pow3.value  = jsProcText(frm.pow3);    

    if (jsProcComp(frm.pow4) == true)
     frmx.pow4.value  = jsProcText(frm.pow4);    

    if (jsProcComp(frm.pow5) == true)
     frmx.pow5.value  = jsProcText(frm.pow5);    

    if (jsProcComp(frm.pow6) == true)
     frmx.pow6.value  = jsProcText(frm.pow6);    

    if (jsProcComp(frm.pow7) == true)
     frmx.pow7.value  = jsProcText(frm.pow7);    

    if (jsProcComp(frm.bud1) == true)
     frmx.bud1.value  = jsProcText(frm.bud1);   

    if (jsProcComp(frm.bud2) == true)
     frmx.bud2.value  = jsProcText(frm.bud2);   

    if (jsProcComp(frm.bud3) == true)
     frmx.bud3.value  = jsProcText(frm.bud3);   

    if (jsProcComp(frm.bud4) == true)
     frmx.bud4.value  = jsProcText(frm.bud4);   

    if (jsProcComp(frm.bud5) == true)
     frmx.bud5.value  = jsProcText(frm.bud5);   

    if (jsProcComp(frm.bud6) == true)
     frmx.bud6.value  = jsProcText(frm.bud6);   

    if (jsProcComp(frm.bud7) == true)
     frmx.bud7.value  = jsProcText(frm.bud7);   

    if (jsProcComp(frm.infrael1) == true)
     frmx.infrael1.value  = jsProcInvest(frm.infrael1);   

    if (jsProcComp(frm.infrael2) == true)
     frmx.infrael2.value  = jsProcInvest(frm.infrael2);   

    if (jsProcComp(frm.infrael3) == true)
     frmx.infrael3.value  = jsProcInvest(frm.infrael3);   

    if (jsProcComp(frm.infrael4) == true)
     frmx.infrael4.value  = jsProcInvest(frm.infrael4);   

    if (jsProcComp(frm.infrael5) == true)
     frmx.infrael5.value  = jsProcInvest(frm.infrael5);   

    if (jsProcComp(frm.infrael6) == true)
     frmx.infrael6.value  = jsProcInvest(frm.infrael6);   

    if (jsProcComp(frm.infrael7) == true)
     frmx.infrael7.value  = jsProcInvest(frm.infrael7);   

    if (jsProcComp(frm.infrawod1) == true)
     frmx.infrawod1.value  = jsProcInvest(frm.infrawod1);   

    if (jsProcComp(frm.infrawod2) == true)
     frmx.infrawod2.value  = jsProcInvest(frm.infrawod2);   

    if (jsProcComp(frm.infrawod3) == true)
     frmx.infrawod3.value  = jsProcInvest(frm.infrawod3);   

    if (jsProcComp(frm.infrawod4) == true)
     frmx.infrawod4.value  = jsProcInvest(frm.infrawod4);   

    if (jsProcComp(frm.infrawod5) == true)
     frmx.infrawod5.value  = jsProcInvest(frm.infrawod5);   

    if (jsProcComp(frm.infrawod6) == true)
     frmx.infrawod6.value  = jsProcInvest(frm.infrawod6);   

    if (jsProcComp(frm.infrawod7) == true)
     frmx.infrawod7.value  = jsProcInvest(frm.infrawod7);   

    if (jsProcComp(frm.infrakan1) == true)
     frmx.infrakan1.value  = jsProcInvest(frm.infrakan1);   

    if (jsProcComp(frm.infrakan2) == true)
     frmx.infrakan2.value  = jsProcInvest(frm.infrakan2);   

    if (jsProcComp(frm.infrakan3) == true)
     frmx.infrakan3.value  = jsProcInvest(frm.infrakan3);   

    if (jsProcComp(frm.infrakan4) == true)
     frmx.infrakan4.value  = jsProcInvest(frm.infrakan4);   

    if (jsProcComp(frm.infrakan5) == true)
     frmx.infrakan5.value  = jsProcInvest(frm.infrakan5);   

    if (jsProcComp(frm.infrakan6) == true)
     frmx.infrakan6.value  = jsProcInvest(frm.infrakan6);   

    if (jsProcComp(frm.infrakan7) == true)
     frmx.infrakan7.value  = jsProcInvest(frm.infrakan7);   

    if (jsProcComp(frm.infragaz1) == true)
     frmx.infragaz1.value  = jsProcInvest(frm.infragaz1);   

    if (jsProcComp(frm.infragaz2) == true)
     frmx.infragaz2.value  = jsProcInvest(frm.infragaz2);   

    if (jsProcComp(frm.infragaz3) == true)
     frmx.infragaz3.value  = jsProcInvest(frm.infragaz3);   

    if (jsProcComp(frm.infragaz4) == true)
     frmx.infragaz4.value  = jsProcInvest(frm.infragaz4);   

    if (jsProcComp(frm.infragaz5) == true)
     frmx.infragaz5.value  = jsProcInvest(frm.infragaz5);   

    if (jsProcComp(frm.infragaz6) == true)
     frmx.infragaz6.value  = jsProcInvest(frm.infragaz6);   

    if (jsProcComp(frm.infragaz7) == true)
     frmx.infragaz7.value  = jsProcInvest(frm.infragaz7);   

    if (jsProcComp(frm.infratel1) == true)
     frmx.infratel1.value  = jsProcInvest(frm.infratel1);   

    if (jsProcComp(frm.infratel2) == true)
     frmx.infratel2.value  = jsProcInvest(frm.infratel2);   

    if (jsProcComp(frm.infratel3) == true)
     frmx.infratel3.value  = jsProcInvest(frm.infratel3);   

    if (jsProcComp(frm.infratel4) == true)
     frmx.infratel4.value  = jsProcInvest(frm.infratel4);   

    if (jsProcComp(frm.infratel5) == true)
     frmx.infratel5.value  = jsProcInvest(frm.infratel5);   

    if (jsProcComp(frm.infratel6) == true)
     frmx.infratel6.value  = jsProcInvest(frm.infratel6);   

    if (jsProcComp(frm.infratel7) == true)
     frmx.infratel7.value  = jsProcInvest(frm.infratel7);   

    if (jsProcComp(frm.infradrog1) == true)
     frmx.infradrog1.value  = jsProcInvest(frm.infradrog1);   

    if (jsProcComp(frm.infradrog2) == true)
     frmx.infradrog2.value  = jsProcInvest(frm.infradrog2);   

    if (jsProcComp(frm.infradrog3) == true)
     frmx.infradrog3.value  = jsProcInvest(frm.infradrog3);   

    if (jsProcComp(frm.infradrog4) == true)
     frmx.infradrog4.value  = jsProcInvest(frm.infradrog4);   

    if (jsProcComp(frm.infradrog5) == true)
     frmx.infradrog5.value  = jsProcInvest(frm.infradrog5);   

    if (jsProcComp(frm.infradrog6) == true)
     frmx.infradrog6.value  = jsProcInvest(frm.infradrog6);   

    if (jsProcComp(frm.infradrog7) == true)
     frmx.infradrog7.value  = jsProcInvest(frm.infradrog7);   

    if (jsProcComp(frm.infrakol1) == true)
     frmx.infrakol1.value  = jsProcInvest(frm.infrakol1);   

    if (jsProcComp(frm.infrakol2) == true)
     frmx.infrakol2.value  = jsProcInvest(frm.infrakol2);   

    if (jsProcComp(frm.infrakol3) == true)
     frmx.infrakol3.value  = jsProcInvest(frm.infrakol3);   

    if (jsProcComp(frm.infrakol4) == true)
     frmx.infrakol4.value  = jsProcInvest(frm.infrakol4);   

    if (jsProcComp(frm.infrakol5) == true)
     frmx.infrakol5.value  = jsProcInvest(frm.infrakol5);   

    if (jsProcComp(frm.infrakol6) == true)
     frmx.infrakol6.value  = jsProcInvest(frm.infrakol6);   

    if (jsProcComp(frm.infrakol7) == true)
     frmx.infrakol7.value  = jsProcInvest(frm.infrakol7);   

    if (jsProcComp(frm.sprz1) == true)
     frmx.sprz1.value  = jsProcInvest(frm.sprz1);   

    if (jsProcComp(frm.sprz2) == true)
     frmx.sprz2.value  = jsProcInvest(frm.sprz2);   

    if (jsProcComp(frm.sprz3) == true)
     frmx.sprz3.value  = jsProcInvest(frm.sprz3);   

    if (jsProcComp(frm.sprz4) == true)
     frmx.sprz4.value  = jsProcInvest(frm.sprz4);   

    if (jsProcComp(frm.sprz5) == true)
     frmx.sprz5.value  = jsProcInvest(frm.sprz5);   

    if (jsProcComp(frm.sprz6) == true)
     frmx.sprz6.value  = jsProcInvest(frm.sprz6);   

    if (jsProcComp(frm.sprz7) == true)
     frmx.sprz7.value  = jsProcInvest(frm.sprz7);   

    if (jsProcComp(frm.dzier1) == true)
     frmx.dzier1.value  = jsProcInvest(frm.dzier1);   

    if (jsProcComp(frm.dzier2) == true)
     frmx.dzier2.value  = jsProcInvest(frm.dzier2);   

    if (jsProcComp(frm.dzier3) == true)
     frmx.dzier3.value  = jsProcInvest(frm.dzier3);   

    if (jsProcComp(frm.dzier4) == true)
     frmx.dzier4.value  = jsProcInvest(frm.dzier4);   

    if (jsProcComp(frm.dzier5) == true)
     frmx.dzier5.value  = jsProcInvest(frm.dzier5);   

    if (jsProcComp(frm.dzier6) == true)
     frmx.dzier6.value  = jsProcInvest(frm.dzier6);   

    if (jsProcComp(frm.dzier7) == true)
     frmx.dzier7.value  = jsProcInvest(frm.dzier7);   

    if (jsProcComp(frm.wiecz1) == true)
     frmx.wiecz1.value  = jsProcInvest(frm.wiecz1);   

    if (jsProcComp(frm.wiecz2) == true)
     frmx.wiecz2.value  = jsProcInvest(frm.wiecz2);   

    if (jsProcComp(frm.wiecz3) == true)
     frmx.wiecz3.value  = jsProcInvest(frm.wiecz3);   

    if (jsProcComp(frm.wiecz4) == true)
     frmx.wiecz4.value  = jsProcInvest(frm.wiecz4);   

    if (jsProcComp(frm.wiecz5) == true)
     frmx.wiecz5.value  = jsProcInvest(frm.wiecz5);   

    if (jsProcComp(frm.wiecz6) == true)
     frmx.wiecz6.value  = jsProcInvest(frm.wiecz6);   

    if (jsProcComp(frm.wiecz7) == true)
     frmx.wiecz7.value  = jsProcInvest(frm.wiecz7);   

    if (jsProcComp(frm.aport1) == true)
     frmx.aport1.value  = jsProcInvest(frm.aport1);  

    if (jsProcComp(frm.aport2) == true)
     frmx.aport2.value  = jsProcInvest(frm.aport2);  

    if (jsProcComp(frm.aport3) == true)
     frmx.aport3.value  = jsProcInvest(frm.aport3);  

    if (jsProcComp(frm.aport4) == true)
     frmx.aport4.value  = jsProcInvest(frm.aport4);  

    if (jsProcComp(frm.aport5) == true)
     frmx.aport5.value  = jsProcInvest(frm.aport5);  

    if (jsProcComp(frm.aport6) == true)
     frmx.aport6.value  = jsProcInvest(frm.aport6);  

    if (jsProcComp(frm.aport7) == true)
     frmx.aport7.value  = jsProcInvest(frm.aport7);  

    if (jsProcComp(frm.ksw1) == true)
     frmx.ksw1.value  = jsProcText(frm.ksw1);  

    if (jsProcComp(frm.ksw2) == true)
     frmx.ksw2.value  = jsProcText(frm.ksw2);  

    if (jsProcComp(frm.ksw3) == true)
     frmx.ksw3.value  = jsProcText(frm.ksw3);  

    if (jsProcComp(frm.ksw4) == true)
     frmx.ksw4.value  = jsProcText(frm.ksw4);  

    if (jsProcComp(frm.ksw5) == true)
     frmx.ksw5.value  = jsProcText(frm.ksw5);  

    if (jsProcComp(frm.ksw6) == true)
     frmx.ksw6.value  = jsProcText(frm.ksw6);  

    if (jsProcComp(frm.ksw7) == true)
     frmx.ksw7.value  = jsProcText(frm.ksw7);  

    if (jsProcComp(frm.uksw1) == true)
     frmx.uksw1.value  = jsProcText(frm.uksw1);  
 
    if (jsProcComp(frm.uksw2) == true)
     frmx.uksw2.value  = jsProcText(frm.uksw2);  

    if (jsProcComp(frm.uksw3) == true)
     frmx.uksw3.value  = jsProcText(frm.uksw3);  

    if (jsProcComp(frm.uksw4) == true)
     frmx.uksw4.value  = jsProcText(frm.uksw4);  

    if (jsProcComp(frm.uksw5) == true)
     frmx.uksw5.value  = jsProcText(frm.uksw5);  

    if (jsProcComp(frm.uksw6) == true)
     frmx.uksw6.value  = jsProcText(frm.uksw6);  

    if (jsProcComp(frm.uksw7) == true)
     frmx.uksw7.value  = jsProcText(frm.uksw7);  

    if (jsProcComp(frm.cenaof1) == true)
     frmx.cenaof1.value  = jsProcText(frm.cenaof1);  

    if (jsProcComp(frm.cenaof2) == true)
     frmx.cenaof2.value  = jsProcText(frm.cenaof2);  

    if (jsProcComp(frm.cenaof3) == true)
     frmx.cenaof3.value  = jsProcText(frm.cenaof3);  

    if (jsProcComp(frm.cenaof4) == true)
     frmx.cenaof4.value  = jsProcText(frm.cenaof4);  

    if (jsProcComp(frm.cenaof5) == true)
     frmx.cenaof5.value  = jsProcText(frm.cenaof5);  

    if (jsProcComp(frm.cenaof6) == true)
     frmx.cenaof6.value  = jsProcText(frm.cenaof6);  

    if (jsProcComp(frm.cenaof7) == true)
     frmx.cenaof7.value  = jsProcText(frm.cenaof7);  

    if (jsProcComp(frm.oppic11) == true)
     frmx.oppic11.value  = jsProcText(frm.oppic11);  

    if (jsProcComp(frm.oppic12) == true)
     frmx.oppic12.value  = jsProcText(frm.oppic12);  

    if (jsProcComp(frm.oppic13) == true)
     frmx.oppic13.value  = jsProcText(frm.oppic13);  

    if (jsProcComp(frm.oppic14) == true)
     frmx.oppic14.value  = jsProcText(frm.oppic14);  

    if (jsProcComp(frm.oppic15) == true)
     frmx.oppic15.value  = jsProcText(frm.oppic15);  

    if (jsProcComp(frm.oppic16) == true)
     frmx.oppic16.value  = jsProcText(frm.oppic16);  

    if (jsProcComp(frm.oppic17) == true)
     frmx.oppic17.value  = jsProcText(frm.oppic17);  

    if (jsProcComp(frm.oppic21) == true)
     frmx.oppic21.value  = jsProcText(frm.oppic21); 

    if (jsProcComp(frm.oppic22) == true)
     frmx.oppic22.value  = jsProcText(frm.oppic22); 

    if (jsProcComp(frm.oppic23) == true)
     frmx.oppic23.value  = jsProcText(frm.oppic23); 

    if (jsProcComp(frm.oppic24) == true)
     frmx.oppic24.value  = jsProcText(frm.oppic24); 

    if (jsProcComp(frm.oppic25) == true)
     frmx.oppic25.value  = jsProcText(frm.oppic25); 

    if (jsProcComp(frm.oppic26) == true)
     frmx.oppic26.value  = jsProcText(frm.oppic26); 

    if (jsProcComp(frm.oppic27) == true)
     frmx.oppic27.value  = jsProcText(frm.oppic27); 



    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.third) == true)
     frmx.third.value  = jsProcText(frm.third); 

    if (jsProcComp(frm.telthird) == true)
     frmx.telthird.value  = jsProcText(frm.telthird); 

    if (jsProcComp(frm.emailthird) == true)
     frmx.emailthird.value  = jsProcText(frm.emailthird); 

    if (jsProcComp(frm.fourth) == true)
     frmx.fourth.value  = jsProcText(frm.fourth); 

    if (jsProcComp(frm.telfourth) == true)
     frmx.telfourth.value  = jsProcText(frm.telfourth); 

    if (jsProcComp(frm.emailfourth) == true)
     frmx.emailfourth.value  = jsProcText(frm.emailfourth); 



    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)
    {
      if (jsProcNoEmpty(frm.namepodpis) == true) 
       frmx.namepodpis.value = jsProcText(frm.namepodpis); 
       else err = 5;
    }

    if (jsProcComp(frm.mailpodpis) == true)
    {
      if (jsProcNoEmpty(frm.mailpodpis) == true) 
    {
      if (jsProcEMail(frm.mailpodpis) == true) 
       frmx.mailpodpis.value = jsProcText(frm.mailpodpis);
       else err = 7;
    }
      else { err = 5; }
    }   

    if (jsProcComp(frm.telpodpis) == true)
    {
      if (jsProcNoEmpty(frm.telpodpis) == true) 
       frmx.telpodpis.value = jsProcText(frm.telpodpis);
       else err = 5;
    }

    if (jsProcComp(frm.faxpodpis) == true)
    {
      if (jsProcNoEmpty(frm.faxpodpis) == true) 
       frmx.faxpodpis.value = jsProcText(frm.faxpodpis);
       else err = 5;
    }


    if (jsProcComp(frm.drogi) == true)
     frmx.drogi.value  = jsProcText(frm.drogi); 

    if (jsProcComp(frm.kolej) == true)
     frmx.kolej.value  = jsProcText(frm.kolej); 

    if (jsProcComp(frm.lotniskomiedzynar) == true)
     frmx.lotniskomiedzynar.value  = jsProcText(frm.lotniskomiedzynar); 

    if (jsProcComp(frm.lotniskomiejsc) == true)
     frmx.lotniskomiejsc.value  = jsProcText(frm.lotniskomiejsc); 



    if (jsProcComp(frm.kierunki1) == true)
     frmx.kierunki1.value = jsProcInvest(frm.kierunki1);

    if (jsProcComp(frm.kierunki2) == true)
     frmx.kierunki2.value = jsProcInvest(frm.kierunki2);

    if (jsProcComp(frm.kierunki3) == true)
     frmx.kierunki3.value = jsProcInvest(frm.kierunki3);

    if (jsProcComp(frm.kierunki4) == true)
     frmx.kierunki4.value = jsProcInvest(frm.kierunki4);

    if (jsProcComp(frm.kierunki5) == true)
     frmx.kierunki5.value = jsProcInvest(frm.kierunki5);

    if (jsProcComp(frm.kierunki6) == true)
     frmx.kierunki6.value = jsProcInvest(frm.kierunki6);

    if (jsProcComp(frm.kierunki7) == true)
     frmx.kierunki7.value = jsProcInvest(frm.kierunki7);

    if (jsProcComp(frm.kierunki8) == true)
     frmx.kierunki8.value = jsProcInvest(frm.kierunki8);

    if (jsProcComp(frm.kierunki9) == true)
     frmx.kierunki9.value = jsProcInvest(frm.kierunki9);

    if (jsProcComp(frm.kierunki10) == true)
     frmx.kierunki10.value = jsProcInvest(frm.kierunki10);

    if (jsProcComp(frm.kierunki11) == true)
     frmx.kierunki11.value = jsProcInvest(frm.kierunki11);

    if (jsProcComp(frm.kierunki12) == true)
     frmx.kierunki12.value = jsProcInvest(frm.kierunki12);

    if (jsProcComp(frm.kierunki13) == true)
     frmx.kierunki13.value = jsProcInvest(frm.kierunki13);

    if (jsProcComp(frm.kierunki14) == true)
     frmx.kierunki14.value = jsProcInvest(frm.kierunki14);

    if (jsProcComp(frm.kierunki15) == true)
     frmx.kierunki15.value = jsProcInvest(frm.kierunki15);

    if (jsProcComp(frm.kierunki16) == true)
     frmx.kierunki16.value = jsProcInvest(frm.kierunki16);

    if (jsProcComp(frm.kierunki17) == true)
     frmx.kierunki17.value = jsProcInvest(frm.kierunki17);

    if (jsProcComp(frm.kierunki18) == true)
     frmx.kierunki18.value = jsProcInvest(frm.kierunki18);

    if (jsProcComp(frm.kierunki19) == true)
     frmx.kierunki19.value = jsProcInvest(frm.kierunki19);

    if (jsProcComp(frm.kierunki20) == true)
     frmx.kierunki20.value = jsProcInvest(frm.kierunki20);

    if (jsProcComp(frm.kierunki21) == true)
     frmx.kierunki21.value = jsProcInvest(frm.kierunki21);

    if (jsProcComp(frm.kierunki22) == true)
     frmx.kierunki22.value = jsProcInvest(frm.kierunki22);

    if (jsProcComp(frm.kierunki23) == true)
     frmx.kierunki23.value = jsProcInvest(frm.kierunki23);

    if (jsProcComp(frm.kierunki24) == true)
     frmx.kierunki24.value = jsProcInvest(frm.kierunki24);

    if (jsProcComp(frm.kierunki25) == true)
     frmx.kierunki25.value = jsProcInvest(frm.kierunki25);

    if (jsProcComp(frm.kierunki26) == true)
     frmx.kierunki26.value = jsProcInvest(frm.kierunki26);

    if (jsProcComp(frm.kierunki27) == true)
     frmx.kierunki27.value = jsProcInvest(frm.kierunki27);

    if (jsProcComp(frm.kierunki28) == true)
     frmx.kierunki28.value = jsProcInvest(frm.kierunki28);

    if (jsProcComp(frm.kierunki29) == true)
     frmx.kierunki29.value = jsProcInvest(frm.kierunki29);

    if (jsProcComp(frm.kierunki30) == true)
     frmx.kierunki30.value = jsProcInvest(frm.kierunki30);

    if (jsProcComp(frm.kierunki31) == true)
     frmx.kierunki31.value = jsProcInvest(frm.kierunki31);

    if (jsProcComp(frm.kierunki32) == true)
     frmx.kierunki32.value = jsProcInvest(frm.kierunki32);

    if (jsProcComp(frm.kierunki34) == true)
     frmx.kierunki34.value = jsProcInvest(frm.kierunki34);

    if (jsProcComp(frm.kierunki34) == true)
     frmx.kierunki34.value = jsProcInvest(frm.kierunki34);





    if (jsProcComp(frm.ulgi1) == true)
     frmx.ulgi1.value = jsProcInvest(frm.ulgi1);

    if (jsProcComp(frm.ulgi2) == true)
     frmx.ulgi2.value = jsProcInvest(frm.ulgi2);

    if (jsProcComp(frm.ulgi3) == true)
     frmx.ulgi3.value = jsProcInvest(frm.ulgi3);

    if (jsProcComp(frm.ulgi4) == true)
     frmx.ulgi4.value = jsProcInvest(frm.ulgi4);

    if (jsProcComp(frm.ulgi5) == true)
     frmx.ulgi5.value = jsProcInvest(frm.ulgi5);

    if (jsProcComp(frm.ulgi6) == true)
     frmx.ulgi6.value = jsProcInvest(frm.ulgi6);

    if (jsProcComp(frm.ulgi7) == true)
     frmx.ulgi7.value = jsProcInvest(frm.ulgi7);

    if (jsProcComp(frm.ulgi8) == true)
     frmx.ulgi8.value = jsProcInvest(frm.ulgi8);

    if (jsProcComp(frm.ulgi9) == true)
     frmx.ulgi9.value = jsProcInvest(frm.ulgi9);

    if (jsProcComp(frm.ulgi10) == true)
     frmx.ulgi10.value = jsProcInvest(frm.ulgi10);

    if (jsProcComp(frm.ulgi11) == true)
     frmx.ulgi11.value = jsProcInvest(frm.ulgi11);

    if (jsProcComp(frm.ulgi12) == true)
     frmx.ulgi12.value = jsProcInvest(frm.ulgi12);

    if (jsProcComp(frm.ulgi13) == true)
     frmx.ulgi13.value = jsProcInvest(frm.ulgi13);

    if (jsProcComp(frm.ulgi14) == true)
     frmx.ulgi14.value = jsProcInvest(frm.ulgi14);

    if (jsProcComp(frm.ulgi15) == true)
     frmx.ulgi15.value = jsProcInvest(frm.ulgi15);




    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)
}



