Advertisement
Guest User

intercity pkp code

a guest
Oct 25th, 2017
4,131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // JavaScript Document
  2.  
  3. function escape_frame()
  4.          {
  5.          if (window != top)
  6.             {
  7.             alert(location.href);
  8.             top.location.href = location.href+'?checkJS=true';
  9.             }
  10.          }
  11.  
  12. function show_hide_element(id)
  13.          {
  14.          var styl=this.document.getElementById(id).style.display;
  15.          if (styl=="none")
  16.             {
  17.             this.document.getElementById(id).style.display="block";
  18.             }
  19.          else
  20.             {
  21.             this.document.getElementById(id).style.display="none";
  22.             }
  23.          }
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. var tab_znakow = new Array("Ą","ą", "Ę","ę", "Ł", "ł", "Ź", "ź", "Ż", "ż", "Ć", "ć", "Ś", "ś", "Ń", "ń", "Ó", "ó");
  32. var pol = new Array("261","263","281","322","324","243","347","378","380","260","262","280","321","323","211","346","377","379");
  33. var pol_2 = new Array("185","230","234","179","241","243","156","159","191","165","198","202","163","209","211","140","143","175");
  34. var bez = new Array("97","99","101","108","110","111","115","122","122","65","67","69","76","78","79","83","90","90");
  35. var miesiace = ["1","3","5","7","8","10","12"];
  36.  
  37.  
  38.  
  39.  
  40.  
  41. function nrnip() {
  42. var NO = 0;
  43. var OK = 1;
  44. var suma = 0;
  45. var nip = 0;
  46.  
  47.     if(document.daneFirmy.nip.value.length == 0)
  48.         return OK;
  49.  
  50.     nip = document.daneFirmy.nip.value.replace(/[^0-9]/g,"");  
  51.     if(nip == 0)    
  52.         return NO;
  53.  
  54.     wagi = new Array(6,5,7,2,3,4,5,6,7);
  55.    
  56.     for (i = 0; i < 9; i++)
  57.         suma += nip.charAt(i)*wagi[i];
  58.  
  59.     if ((suma%11) != nip.charAt(9))
  60.         return NO;
  61.  
  62.     return OK;
  63. }
  64.  
  65. function tylko_cyfra(cyfra){
  66. var NO = 0;
  67. var OK = 1;
  68.  
  69.     if ( isNaN(cyfra) == 0 )
  70.         return OK;
  71.        
  72.     return NO;
  73. }
  74.  
  75. function telfax_OK(telfax) {
  76. var OK = 1;
  77. var NO = 0;
  78. var dlugosc = 0;
  79. var koniec = true;
  80.  
  81.     dlugosc = telfax.length;
  82.  
  83.     if (dlugosc == 0 )
  84.             return OK;
  85.  
  86.     for ( i  =  0;  i < dlugosc;  i++) {
  87.             if( telfax.charAt(i) == "(" || (isNaN(telfax.charAt(i)) == 0) || telfax.charAt(i) == ")" || telfax.charAt(i) == "-" || telfax.charAt(i) == " " || telfax.charAt(i) == "+")
  88.                     koniec = true;
  89.             else{
  90.                     koniec = false;
  91.                     return NO;
  92.             }
  93.     }
  94.  
  95.     return OK;
  96. }
  97.  
  98. function nipFirmyDaneKlienta_OK(nipfirmy) {
  99. var OK = 1;
  100. var NO = 0;
  101. var dlugosc = 0;
  102. var koniec = true;
  103.  
  104.     dlugosc = nipfirmy.length;
  105.  
  106.     if (dlugosc == 0 )
  107.             return OK;
  108.  
  109.     for ( i  =  0;  i < dlugosc;  i++) {
  110.             if( nipfirmy.charAt(i) == "(" || (isNaN(nipfirmy.charAt(i)) == 0) || nipfirmy.charAt(i) == ")" || nipfirmy.charAt(i) == "-" || nipfirmy.charAt(i) == " ")
  111.                     koniec = true;
  112.             else{
  113.                     koniec = false;
  114.                     return NO;
  115.             }
  116.     }
  117.  
  118.     return OK;
  119. }
  120.  
  121. function  kodpocz_OK(kod) {
  122. var OK = 1;
  123. var NO = 0;
  124. var error = 0;
  125.     var dlugosc = kod.length;
  126.     if(kod.charAt(2) =="-")
  127.     {
  128.         for(i = 0;  i < dlugosc;  i++){
  129.             if (i==0 || i==1 || i==3 || i==4){
  130.                 if((kod.charAt(i) >="A" && kod.charAt(i) <="Z") || (kod.charAt(i) >="a" && kod.charAt(i) <="z") || (kod.charAt(i) >="0" && kod.charAt(i) <="9")){
  131.                 }
  132.                 else{
  133.                     error = error+1;
  134.                 }
  135.             }
  136.             if (i==2){
  137.                 if((kod.charAt(i) >="A" && kod.charAt(i) <="Z") || (kod.charAt(i) >="a" && kod.charAt(i) <="z") || (kod.charAt(i) >="0" && kod.charAt(i) <="9") || (kod.charAt(i) =="-") || (kod.charAt(i) ==" ")){
  138.                 }
  139.                 else{
  140.                     error = error+1;
  141.                 }
  142.             }
  143.             if (i==5){
  144.                 if((kod.charAt(i) >="A" && kod.charAt(i) <="Z") || (kod.charAt(i) >="a" && kod.charAt(i) <="z") || (kod.charAt(i) >="0" && kod.charAt(i) <="9") || (kod.charAt(i) ==" ")){
  145.                 }
  146.                 else{
  147.                     error = error+1;
  148.                 }
  149.             }
  150.         }
  151.     }
  152.     else
  153.     {
  154.         for(i = 0;  i < dlugosc;  i++)
  155.         {
  156.             if((kod.charAt(i) >="A" && kod.charAt(i) <="Z") || (kod.charAt(i) >="a" && kod.charAt(i) <="z") || (kod.charAt(i) >="0" && kod.charAt(i) <="9") || (kod.charAt(i) =="-") || (kod.charAt(i) ==" "))
  157.             {}
  158.             else
  159.             {
  160.                 error = error+1;
  161.             }
  162.         }
  163.     }
  164.     if (error>0)
  165.         return NO;
  166.     else
  167.         return OK;
  168. }
  169. function  kodpocz_OK_pl(kod) {
  170. var OK = 1;
  171. var NO = 0;
  172. var error = 0;
  173.     var dlugosc = kod.length;
  174.     if (dlugosc !=6)
  175.          error = error+1;
  176.          for(i = 0;  i < dlugosc;  i++){
  177.             if (i==0 || i==1 || i==3 || i==4){
  178.                 if((kod.charAt(i) >="0" && kod.charAt(i) <="9")){
  179.                 }
  180.                 else{
  181.                     error = error+1;
  182.                 }
  183.             }
  184.             if (i==2){
  185.                 if((kod.charAt(i) =="-") || (kod.charAt(i) ==" ")){
  186.                 }
  187.                 else{
  188.                     error = error+1;
  189.                 }
  190.             }
  191.             if (i==5){
  192.                 if((kod.charAt(i) >="0" && kod.charAt(i) <="9") || (kod.charAt(i) ==" ")){
  193.                 }
  194.                 else{
  195.                     error = error+1;
  196.                 }
  197.             }
  198.         }
  199.  
  200.     if (error>0)
  201.         return NO;
  202.     else
  203.         return OK;
  204. }
  205.  
  206. function poprawny_email(email) {
  207.    
  208.     var flag = false;
  209.    
  210.     var patternEmail=/^[^@][^\s]+@([a-z0-9\-]+\.)+[a-z]{2,8}$/i;
  211.    
  212.     if (patternEmail.test(email)) {      
  213.         flag = true;
  214.     }
  215.    
  216.     return flag;
  217.        
  218. }
  219.  
  220. function poprawna_domena(inf) {
  221.    var OK = 1;
  222. var NO = 0;
  223. var dlugosc = 0;
  224.    
  225.     var patternDomena=/@([a-z0-9\-]+\.)+[a-z]{2,8}$/i;
  226.  
  227.     dlugosc = document.daneKlienta.domena.value.length;
  228.  
  229.     if(dlugosc == 0)
  230.             return OK;
  231.  
  232.     if(patternDomena.test(document.daneKlienta.domena.value)){
  233.            
  234.     }else{
  235.      alert(inf);
  236.             document.daneKlienta.domena.focus();
  237.             return NO;  
  238.     }
  239.    
  240.     return OK;
  241.    
  242. }
  243.  
  244. function polskie_znaki_valid(inf) {
  245.            
  246.     var flag = true,
  247.         email = document.daneKlienta.email.value.toUpperCase(),
  248.         dlugosc = email.length;
  249.    
  250.     if(dlugosc > 0) {
  251.         for(var i = 0;  i < dlugosc;  i++){                        
  252.             if(polska_litera(email.charAt(i) ) == 1 ) {
  253.                 flag = false;                                
  254.                 break;
  255.             }
  256.         }
  257.         /*
  258.         if(!flag) {
  259.             alert(inf);            
  260.         }
  261.         */
  262.     }
  263.    
  264.     return flag;
  265. }
  266.  
  267. function dlugosc_pol(dlug) {
  268. var minimalna = 6
  269. var maksymalna = 30
  270. var NO = 0
  271. var OK = 1
  272.  
  273.     if(dlug < minimalna || dlug > maksymalna)  
  274.     return NO
  275.     else
  276.     return OK
  277. }
  278. function dlugosc_pol_haslo(dlug) {
  279. var minimalna = 8
  280. var maksymalna = 15
  281. var NO = 0
  282. var OK = 1
  283.  
  284.     if(dlug < minimalna || dlug > maksymalna)  
  285.     return NO
  286.     else
  287.     return OK
  288. }
  289.  
  290. function polska_litera(litera) {
  291. var NO = 0;
  292. var OK = 1;
  293.  
  294.     var tab_dl = tab_znakow.length;
  295.  
  296.     for(j = 0; j <= tab_dl; j++) {
  297.             if(litera == tab_znakow[j] ) {
  298.                 return OK;
  299.             }
  300.     }
  301.  
  302.     return NO;
  303. }
  304.  
  305. function tylko_litery(wyraz) {
  306. var OK = 1
  307. var NO = 0
  308.  
  309.     wyraz = wyraz.toUpperCase();
  310.  
  311.     var dlugosc = wyraz.length;
  312.  
  313.     for(i = 0;  i < dlugosc;  i++){
  314.             if(wyraz.charAt(i) <"A" && wyraz.charAt(i) != "-" && wyraz.charAt(i)  != " " && wyraz.charAt(i) != "." && wyraz.charAt(i) != "&" && wyraz.charAt(i) != "_" ) {
  315.                 if(polska_litera(wyraz.charAt(i) ) == 0 )
  316.                             return NO;
  317.             }
  318.             if(wyraz.charAt(i) >"Z" && wyraz.charAt(i) != "-" && wyraz.charAt(i)  != " " && wyraz.charAt(i) != "." && wyraz.charAt(i) != "&" && wyraz.charAt(i) != "_") {  
  319.  
  320.                 if(wyraz.charCodeAt(i) >188)
  321.                     continue;
  322.                 else
  323.                 {
  324.                  if(polska_litera(wyraz.charAt(i) ) == 0 )
  325.                         return NO;
  326.                 else
  327.                    continue;
  328.                 }
  329.             }
  330.     }
  331.     var licznik = 0;
  332.     for(i = 0;  i < dlugosc;  i++){
  333.             if(wyraz.charAt(i) == "-" || wyraz.charAt(i)  == " " || wyraz.charAt(i) == "." || wyraz.charAt(i) == "&" || wyraz.charAt(i) == "_") {
  334.                 licznik++;
  335.             }
  336.     }
  337.     if (dlugosc > 0)
  338.     if (licznik==dlugosc)
  339.     {
  340.         return NO;
  341.     }
  342.     return OK;
  343. }
  344.  
  345. function tylko_litery_i_cyfry(wyraz)
  346. {
  347.     var OK = 1
  348.     var NO = 0
  349.  
  350.     wyraz = wyraz.toUpperCase();
  351.  
  352.     var dlugosc = wyraz.length;
  353.  
  354.     for (i = 0; i < dlugosc; i++)
  355.     {
  356.         if (wyraz.charAt(i) < "A" && wyraz.charAt(i) != "-" && wyraz.charAt(i) != " " && wyraz.charAt(i) != "." && wyraz.charAt(i) != "&" && wyraz.charAt(i) != "_" && wyraz.charAt(i) != "0" && wyraz.charAt(i) != "1" && wyraz.charAt(i) != "2" && wyraz.charAt(i) != "3"  && wyraz.charAt(i) != "4" && wyraz.charAt(i) != "4" && wyraz.charAt(i) != "5" && wyraz.charAt(i) != "7" && wyraz.charAt(i) != "8" && wyraz.charAt(i) != "9")
  357.         {
  358.             if (polska_litera(wyraz.charAt(i)) == 0)
  359.                 return NO;
  360.         }
  361.         if (wyraz.charAt(i) > "Z" && wyraz.charAt(i) != "-" && wyraz.charAt(i) != " " && wyraz.charAt(i) != "." && wyraz.charAt(i) != "&" && wyraz.charAt(i) != "_" && wyraz.charAt(i) != "0" && wyraz.charAt(i) != "1" && wyraz.charAt(i) != "2" && wyraz.charAt(i) != "3"  && wyraz.charAt(i) != "4" && wyraz.charAt(i) != "4" && wyraz.charAt(i) != "5" && wyraz.charAt(i) != "7" && wyraz.charAt(i) != "8" && wyraz.charAt(i) != "9")
  362.         {
  363.  
  364.             if (wyraz.charCodeAt(i) > 188)
  365.                 continue;
  366.             else
  367.             {
  368.                 if (polska_litera(wyraz.charAt(i)) == 0)
  369.                     return NO;
  370.                 else
  371.                     continue;
  372.             }
  373.         }
  374.     }
  375.     var licznik = 0;
  376.     for (i = 0; i < dlugosc; i++)
  377.     {
  378.         if (wyraz.charAt(i) == "-" || wyraz.charAt(i) == " " || wyraz.charAt(i) == "." || wyraz.charAt(i) == "&" || wyraz.charAt(i) == "_") {
  379.             licznik++;
  380.         }
  381.     }
  382.     if (dlugosc > 0)
  383.         if (licznik == dlugosc)
  384.         {
  385.             return NO;
  386.         }
  387.     return OK;
  388. }
  389.  
  390. function nie_tylko_litery(wyraz) {
  391.    
  392.     var OK = 1
  393.     var NO = 0
  394.  
  395.    
  396.     wyraz = wyraz.toUpperCase();
  397.  
  398.     var dlugosc = wyraz.length;
  399.  
  400.     for(i = 0;  i < dlugosc;  i++){        
  401.            
  402.             if(wyraz.charAt(i) <"A"
  403.                     && wyraz.charAt(i) != "-"
  404.                         && wyraz.charAt(i)  != " "
  405.                             && wyraz.charAt(i) != "."
  406.                                 && wyraz.charAt(i) != "&"
  407.                                     && wyraz.charAt(i) != "_"
  408.                                         && wyraz.charAt(i) != "\""
  409.                                             && wyraz.charAt(i) != "'"
  410.                            
  411.             ) {                
  412.                 if(polska_litera(wyraz.charAt(i) ) == 0 )
  413.                             return NO;
  414.             }
  415.             if(wyraz.charAt(i) >"Z"
  416.                        && wyraz.charAt(i) != "-"
  417.                             && wyraz.charAt(i)  != " "
  418.                                 && wyraz.charAt(i) != "."
  419.                                     && wyraz.charAt(i) != "&"
  420.                                         && wyraz.charAt(i) != "_"
  421.                                             && wyraz.charAt(i) != "\""
  422.                                                 && wyraz.charAt(i) != "'"
  423.             ) {  
  424.  
  425.                 if(wyraz.charCodeAt(i) >188)
  426.                     continue;
  427.                 else
  428.                 {
  429.                  if(polska_litera(wyraz.charAt(i) ) == 0 )
  430.                         return NO;
  431.                 else
  432.                    continue;
  433.                 }
  434.             }
  435.     }
  436.     var licznik = 0;
  437.     for(i = 0;  i < dlugosc;  i++){
  438.             if(wyraz.charAt(i) == "-"
  439.                         || wyraz.charAt(i)  == " "
  440.                             || wyraz.charAt(i) == "."
  441.                                 || wyraz.charAt(i) == "&"
  442.                                     || wyraz.charAt(i) == "_"
  443.                                         || wyraz.charAt(i) == "\""
  444.                                             || wyraz.charAt(i) == "'"
  445.              ) {
  446.                 licznik++;
  447.             }
  448.     }
  449.     if (dlugosc > 0)
  450.     if (licznik==dlugosc)
  451.     {
  452.         return NO;
  453.     }
  454.     return OK;
  455. }
  456.  
  457. function rok_przestepny(rok) {
  458. var OK = true;
  459. var NO = false;
  460. var  podziel_4 = 0;
  461. var podziel_100 = 0;
  462. var podziel_400 = 0;
  463.  
  464.     podziel_4 = rok % 4;
  465.  
  466.     if( podziel_4 == 0 ) {
  467.             podziel_100 = rok % 100;
  468.             podziel_400 = rok% 400;
  469.  
  470.             if(podziel_100 != 0 || podziel_400 == 0) {
  471.                             return OK;
  472.                     }
  473.     }
  474.  
  475.     return NO;
  476. }
  477.  
  478.  
  479.  
  480. function poprawna_podphasla(inf) {
  481. var OK = 1;
  482. var NO = 0;
  483. var dobryEmail=/^[^@]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/i;
  484.  
  485. if ((dobryEmail.test(document.podpHasla.email.value)) && (document.podpHasla.login.value.length>5)){
  486.     document.podpHasla.submit();
  487.     }
  488. else {
  489.     alert (inf);
  490.     }
  491. }
  492.  
  493.  
  494.  
  495.  
  496. function jest_ok(info)
  497. {
  498. var OK = 1;
  499. var NO = 0;
  500.  
  501.     if(document.logowanie.login.value=="" || document.logowanie.haslo.value==""){
  502.         alert(info);
  503.  
  504.         if(document.logowanie.haslo.value=="")
  505.             document.logowanie.haslo.focus();
  506.  
  507.         if(document.logowanie.login.value=="")
  508.             document.logowanie.login.focus();
  509.  
  510.         return NO;      
  511.     }
  512.     document.logowanie.submit();
  513.    
  514.     return OK;
  515. }
  516.  
  517.  
  518. function login_Klienta(){
  519.  
  520.     if (navigator.appVersion.indexOf("MSIE")>0)
  521.         pol ;
  522.     else
  523.         pol_2;
  524.    
  525.     bez;
  526.  
  527.     tekst = document.logowanie.login.value;
  528.  
  529.     for (var i=0; i < pol.length; i++) {
  530.         regexp = eval("/"+String.fromCharCode(pol[i])+"/g");
  531.         tekst=tekst.replace(regexp,String.fromCharCode(bez[i]));
  532.     }
  533.     document.logowanie.login.value = tekst;
  534. }
  535.  
  536. function login_Klienta3(){
  537.  
  538.     if (navigator.appVersion.indexOf("MSIE")>0)
  539.         pol ;
  540.     else
  541.         pol_2;
  542.    
  543.     bez;
  544.  
  545.     tekst = document.podpHasla.login.value;
  546.  
  547.     for (var i=0; i < pol.length; i++) {
  548.         regexp = eval("/"+String.fromCharCode(pol[i])+"/g");
  549.         tekst=tekst.replace(regexp,String.fromCharCode(bez[i]));
  550.     }
  551.     document.podpHasla.login.value = tekst;
  552. }
  553.  
  554.  
  555.  
  556.  
  557. function drugie_haslo(logowanie_admin, tekst)
  558. {
  559.     if(document.logowanie_admin.haslo2.value==""){
  560.     alert(tekst)
  561.  
  562.         if(document.logowanie_admin.haslo2.value=="")
  563.             document.logowanie_admin.haslo2.focus()
  564.     }
  565.     else
  566.         document.logowanie_admin.submit();
  567. }
  568.  
  569. function litery_liczby(wyraz) {
  570. var OK = 1
  571. var NO = 0
  572.  
  573.    
  574.     reg2 = /[0-9]{1,15}/;
  575.     wyn2 = wyraz.match(reg2);
  576.     reg3 = /[a-zA-Z]{1,15}/;
  577.     wyn3 = wyraz.match(reg3);
  578.  
  579.     if ( wyn2 && wyn3)
  580.         return OK;
  581.  
  582.     return NO;  
  583. }
  584.  
  585. function litery_liczby_login(wyraz) {
  586. var OK = 1
  587. var NO = 0
  588.  
  589.     reg = /^[0-9a-zA-Z\.\_\\\s\\\-\\\&@!]{1,30}$/i;
  590.     wyn = wyraz.match(reg);
  591.    
  592.     if (wyn)
  593.         return OK;
  594.  
  595.     return NO;  
  596. }
  597.  
  598. function litery_liczby_spacja(wyraz) {
  599. var OK = 1
  600. var NO = 0
  601.  
  602.     reg = /^[0-9a-zA-Z\.\_\\\s\\\-\\\&]{1,50}$/;
  603.     reg2 = /[^\\\"\\\']{1,50}$/;
  604.     wyn = wyraz.match(reg);
  605.     wyn2 = wyraz.match(reg2);
  606.  
  607.     if(!wyn || !wyn2){
  608.         return NO;
  609.     }
  610.     return OK;
  611. }
  612.  
  613.  
  614. function nrdok_Klient(inf){
  615. var OK = 1;
  616. var NO = 0;
  617. var dlugosc = 0;
  618.  
  619.     document.daneKlienta.nrdok.value = document.daneKlienta.nrdok.value.toUpperCase();
  620.  
  621.     dlugosc = document.daneKlienta.nrdok.value.length;
  622.     if(dlugosc == 0)
  623.             return OK;
  624.    
  625.     reg = /^[A-Z0-9\-\\\s\\\\\/]{1,30}$/;
  626.  
  627.     wyn = daneKlienta.nrdok.value.match(reg);
  628.  
  629.     if(!wyn){
  630.         alert(inf);
  631.         document.daneKlienta.nrdok.focus();
  632.         return NO;
  633.     }
  634.  
  635.     return OK;
  636. }    
  637.  
  638. function adresIP_User(inf){
  639. var OK = 1;
  640. var NO = 0;
  641. var dlugosc = 0;
  642.  
  643.     dlugosc = document.daneKlienta.adminip.length;
  644.     if(dlugosc == 0)
  645.             return OK;
  646.  
  647.     reg = /^[0-9\*\:\.\;\\\s]{1,500}$/;
  648.     regC = /^[0-9]{1,500}$/;
  649.     regK = /[.]{1,500}$/;
  650.     regS = /[;]{1,500}$/;
  651.     regD = /[:]{1,500}$/;
  652.  
  653.     wyn = daneKlienta.adminip.value.match(reg);
  654.     wynC = daneKlienta.adminip.value.match(regC);
  655.     wynK = daneKlienta.adminip.value.match(regK);
  656.     wynS = daneKlienta.adminip.value.match(regS);
  657.  
  658.     if(!wyn || wynC || wynK || wynS){
  659.         alert(inf);
  660.        
  661.         document.daneKlienta.adminip.focus();
  662.         return NO;
  663.     }
  664.  
  665.     return OK;
  666. }
  667. function pociagi_User(inf){
  668. var OK = 1;
  669. var NO = 0;
  670. var dlugosc = 0;
  671.  
  672.     dlugosc = document.daneKlienta.pociagiKolejObca.length;
  673.     if(dlugosc == 0)
  674.             return OK;
  675.  
  676.     reg = /^[0-9\;]{1,500}$/;
  677.     regC = /^[0-9]{1,500}$/;
  678.     regS = /[;]{1,500}$/;
  679.  
  680.     wyn = daneKlienta.pociagiKolejObca.value.match(reg);
  681.     wynC = daneKlienta.pociagiKolejObca.value.match(regC);
  682.     wynS = daneKlienta.pociagiKolejObca.value.match(regS);
  683.  
  684.     if(!wyn || wynC || wynS){
  685.         alert(inf);
  686.        
  687.         document.daneKlienta.pociagiKolejObca.focus();
  688.         return NO;
  689.     }
  690.  
  691.     return OK;
  692. }
  693.  
  694. function login_Klienta2(inf){
  695. var NO = 0;
  696. var OK = 1;
  697.  
  698.     if(document.daneKlienta.login.value.length == 0)
  699.         return OK;
  700.  
  701.     if (navigator.appVersion.indexOf("MSIE")>0)
  702.         pol ;
  703.     else
  704.         pol_2;
  705.    
  706.     bez;
  707.  
  708.     if(dlugosc_pol(document.daneKlienta.login.value.length) == 0 || litery_liczby_login(document.daneKlienta.login.value) == 0){
  709.         alert(inf);
  710.         document.daneKlienta.login.focus();
  711.         return NO;
  712.     }
  713.     return OK;
  714. }
  715.  
  716. function login_USERA(inf){
  717. var NO = 0;
  718. var OK = 1;
  719.  
  720.     if(document.daneKlienta.login.value.length == 0)
  721.         return OK;
  722.  
  723.     if (navigator.appVersion.indexOf("MSIE")>0)
  724.         pol ;
  725.     else
  726.         pol_2;
  727.    
  728.     bez;
  729.  
  730.     tekst = document.daneKlienta.login.value;
  731.  
  732.     for (var i=0; i < pol.length; i++) {
  733.         regexp = eval("/"+String.fromCharCode(pol[i])+"/g");
  734.         tekst=tekst.replace(regexp,String.fromCharCode(bez[i]));
  735.     }
  736.     document.daneKlienta.login.value = tekst;
  737.  
  738.     if(dlugosc_pol(document.daneKlienta.login.value.length) == 0 || litery_liczby_spacja(document.daneKlienta.login.value) == 0){
  739.         alert(inf);
  740.         document.daneKlienta.login.focus();
  741.         return NO;
  742.     }
  743.     return OK;
  744. }
  745.  
  746. function nowehaslo_Klienta(inf){
  747. var OK = 1;
  748. var NO = 0;
  749.  
  750.     if(document.daneKlienta.haslo.value.length == 0)
  751.         return OK;
  752.  
  753.     if(dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 ){
  754.         alert(inf);
  755.         document.daneKlienta.haslo.value = "";
  756.         document.daneKlienta.haslo.focus();
  757.         return NO;
  758.     }
  759.    
  760.     return OK;
  761. }
  762.  
  763. function dodhaslo_Usera(inf){
  764. var OK = 1;
  765. var NO = 0;
  766.  
  767.     if(document.daneKlienta.haslo2.value.length == 0)
  768.         return OK;
  769.  
  770.     if(dlugosc_pol(document.daneKlienta.haslo2.value.length) == 0 || litery_liczby(document.daneKlienta.haslo2.value) == 0){
  771.         alert(inf);
  772.         document.daneKlienta.haslo2.value = "";
  773.         document.daneKlienta.haslo2.focus();
  774.         return NO;
  775.     }
  776.    
  777.     return OK;
  778. }
  779.  
  780. function powthasla_Klienta(inf){
  781. var OK = 1;
  782. var NO = 0;
  783.  
  784.     if(document.daneKlienta.powt_hasla.value == 0)
  785.         return OK;
  786.  
  787.     if(document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  788.         alert(inf);
  789.         document.daneKlienta.powt_hasla.focus();
  790.         return NO;
  791.     }
  792.  
  793.  return OK;
  794. }
  795.  
  796. function email_Klienta(inf){
  797. var OK = 1;
  798. var NO = 0;
  799. var dlugosc = 0;
  800.  
  801.     dlugosc = document.daneKlienta.email.value.length;
  802.  
  803.     if(dlugosc == 0)
  804.             return OK;
  805.  
  806.     if(poprawny_email(document.daneKlienta.email.value)== 0){
  807.             alert(inf);
  808.             document.daneKlienta.email.focus();
  809.             return NO;
  810.     }
  811.    
  812.     return OK;
  813. }
  814.  
  815. function poprawna_nazwa(nazwa) {
  816. var OK = 1;
  817. var NO = 0;
  818. var i=0;
  819.  
  820. var str = nazwa.split(/\s/g);
  821.  
  822.  
  823.  
  824. while(str[i]!=undefined){
  825.    
  826.     if (str[i].length<1){        
  827.         return NO;
  828.     }
  829.     i=i+1;
  830. }
  831. if (i==1){    
  832.     return NO;
  833. }
  834. return OK;
  835.  
  836. }
  837.  
  838. function validateImieNazwisko(inf){
  839. var OK = 1;
  840. var NO = 0;
  841.  
  842. var pattern = /^([a-zA-Z]{1,40}\s*){2,}$/;
  843.  
  844.     //if(poprawna_nazwa(document.daneKlienta.nazwa.value)== 0){
  845.     if(!pattern.test(document.daneKlienta.nazwa.value)) {
  846.             alert(inf);
  847.             document.daneKlienta.nazwa.focus();
  848.             return NO;
  849.     }
  850.    
  851.     return OK;
  852. }
  853.  
  854.  
  855.  
  856.  
  857. function nazwa_daneKlienta(inf){
  858. var OK = 1;
  859. var NO = 0;
  860.  
  861. var pattern = /^([a-zA-Z]{2,40}\s*){2,}$/;
  862.  
  863.     if(poprawna_nazwa(document.daneKlienta.nazwa.value)== 0){
  864.     //if(!pattern.test(document.daneKlienta.nazwa.value)) {
  865.             alert(inf);
  866.             document.daneKlienta.nazwa.focus();
  867.             return NO;
  868.     }
  869.     return OK;
  870. }
  871.  
  872. function nazwa_daneKlientaForm(inf){
  873. var OK = 1;
  874. var NO = 0;
  875.  
  876.     if(poprawna_nazwa(document.listaUzytkFormNazwa.nazwaUzytkownika.value)== 0){
  877.             alert(inf);
  878.             document.listaUzytkFormNazwa.nazwaUzytkownika.focus();
  879.             return NO;
  880.     }
  881.     else{
  882.         document.listaUzytkFormNazwa.submit();
  883.         }
  884. }
  885.  
  886. function nazwa_daneKlienta_rezH(inf){
  887. var OK = 1;
  888. var NO = 0;
  889.  
  890.     if(poprawna_nazwa(document.rkh.dla.value)== 0){
  891.             alert(inf);
  892.             document.rkh.dla.focus();
  893.             return NO;
  894.     }
  895.     return OK;
  896. }
  897. function jakiwyjazd(){
  898.     if(document.rkh.wyjazdsluzbowy.checked ==  false) {
  899.             alert ("Wyjazd prywatny")
  900.             document.daneKlienta.zgoda.focus();
  901.  
  902.     }
  903. else
  904. {           alert ("Wyjazd prywatny")
  905.             document.daneKlienta.zgoda.focus();
  906. }
  907. }
  908. function  kod_Klienta_pl(inf, kraj) {
  909. var NO = 0;
  910. var OK = 1;
  911. var dlugosc = 0;
  912.  
  913.     dlugosc = document.daneKlienta.kodpocztowy.value.length;
  914.  
  915.     if(dlugosc == 0)
  916.             return OK;
  917. if (kraj>0)
  918.     if (kodpocz_OK(document.daneKlienta.kodpocztowy.value) == 0){
  919.             alert(inf);
  920.             document.daneKlienta.kodpocztowy.focus();
  921.             return NO;
  922.     }
  923. if (kraj==0)
  924.     if (kodpocz_OK_pl(document.daneKlienta.kodpocztowy.value) == 0){
  925.             alert(inf);
  926.             document.daneKlienta.kodpocztowy.focus();
  927.             return NO;
  928.     }
  929.  
  930.     return OK;
  931. }
  932.  
  933. function  kod_Klienta(inf) {
  934. var NO = 0;
  935. var OK = 1;
  936. var dlugosc = 0;
  937.  
  938.     dlugosc = document.daneKlienta.kodpocztowy.value.length;
  939.  
  940.     if(dlugosc == 0)
  941.             return OK;
  942.  
  943.     if (kodpocz_OK(document.daneKlienta.kodpocztowy.value) == 0){
  944.             alert(inf);
  945.             document.daneKlienta.kodpocztowy.focus();
  946.             return NO;
  947.     }
  948.  
  949.     return OK;
  950. }
  951.  
  952. function nazwa_miasta(inf) {
  953. var NO = 0;
  954. var OK = 1;
  955. var dlugosc = 0;
  956.  
  957.  
  958.     dlugosc = document.daneKlienta.miasto.length;
  959.  
  960.     if(dlugosc == 0)
  961.             return OK;
  962.     else
  963.     if( nie_tylko_litery(document.daneKlienta.miasto.value) == 0) {
  964.             alert(inf);
  965.             document.daneKlienta.miasto.focus();
  966.             return NO;
  967.     }
  968.  
  969.     return OK;
  970. }
  971.  
  972. function telefon_Klienta(inf) {
  973. var OK = 1;
  974. var NO = 0;
  975. var dlugosc = 0;
  976.  
  977.     dlugosc = document.daneKlienta.tel.length;
  978.  
  979.     if(dlugosc == 0)
  980.             return OK;
  981.  
  982.     if (telfax_OK(document.daneKlienta.tel.value) == 0){
  983.             alert(inf);
  984.             document.daneKlienta.tel.focus();
  985.             return NO;
  986.     }
  987.     return OK;
  988. }
  989.  
  990. function fax_Klienta(inf) {
  991. var OK = 1;
  992. var NO = 0;
  993. var dlugosc = 0;
  994.  
  995.     dlugosc = document.daneKlienta.fax.length;
  996.  
  997.     if(dlugosc == 0)
  998.             return OK;
  999.  
  1000.     if (telfax_OK(document.daneKlienta.fax.value) == 0){
  1001.             alert(inf);
  1002.             document.daneKlienta.fax.focus();
  1003.             return NO;
  1004.     }
  1005.     return OK;
  1006. }
  1007. function nazwaUzytkownikaFirmy(inf){
  1008. var OK = 1;
  1009. var NO = 0;
  1010.    
  1011.     if(tylko_litery(document.daneKlienta.nazwafirmy.value)==0){
  1012.         alert(inf);
  1013.         document.daneKlienta.nazwafirmy.focus();
  1014.         return NO;
  1015.     }
  1016.     return OK;
  1017. }
  1018.  
  1019. function  kod_Firmy(inf) {
  1020. var NO = 0;
  1021. var OK = 1;
  1022. var dlugosc = 0;
  1023.  
  1024.     dlugosc = document.daneKlienta.kodpocztowyfirmy.value.length;
  1025.  
  1026.     if(dlugosc == 0)
  1027.             return OK;
  1028.  
  1029.     if (kodpocz_OK(document.daneKlienta.kodpocztowyfirmy.value) == 0){
  1030.             alert(inf);
  1031.             document.daneKlienta.kodpocztowyfirmy.focus();
  1032.             return NO;
  1033.     }
  1034.  
  1035.     return OK;
  1036. }
  1037.  
  1038. function nazwa_miastafirmy(inf) {
  1039. var NO = 0;
  1040. var OK = 1;
  1041. var dlugosc = 0;
  1042.  
  1043.     dlugosc = document.daneKlienta.miastofirmy.length;
  1044.  
  1045.     if(dlugosc == 0)
  1046.             return OK;
  1047.  
  1048.  if(dlugosc > 0)  
  1049. if( tylko_litery(document.daneKlienta.miastofirmy.value) == 0) {
  1050.             alert(inf);
  1051.             document.daneKlienta.miastofirmy.focus();
  1052.             return NO;
  1053.     }
  1054.  
  1055.     return OK;
  1056. }
  1057.  
  1058. function kompletnosc_danychUsera(pracSprzed, idUsera, idAjent, ifPracSprzed, login, email, haslo, powthasla, rodzdoktoz, nrdoktoz, firma, rodzuzytk, imienazwisko, infnrdok, adres, kodpoczt, infkod, miasto, infmiasto, poprpola, inf1, inf2, kodpocztfirmy, infkodpocztfirmy, miastofirmy, infmiastofirmy, polafirmy){
  1059. var pola = "";
  1060. var koniec = false;
  1061.  
  1062. //    if(document.daneKlienta.uzytktypkod.value==pracSprzed && document.daneKlienta.adminip.value.length ==0){
  1063. //        alert(ifPracSprzed);
  1064. //        koniec=true;
  1065. //    }
  1066.  
  1067.     if(document.daneKlienta.login.value=="" || dlugosc_pol(document.daneKlienta.login.value.length) == 0){
  1068.     pola+=" - " + login + "\n";
  1069.     koniec=true;
  1070.     }
  1071.    
  1072.     if(document.daneKlienta.email.value=="" || poprawny_email(document.daneKlienta.email.value) == 0 ){
  1073.     pola+=" - " + email + "\n";
  1074.     koniec=true;
  1075.     }
  1076.  
  1077.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 || litery_liczby(document.daneKlienta.haslo.value) == 0){
  1078.     pola+=" - " +  haslo + "\n";
  1079.     koniec=true;
  1080.     }
  1081.  
  1082.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  1083.     pola+=" - " + powthasla + "\n";
  1084.     koniec=true;
  1085.     }
  1086.  
  1087.     if(document.daneKlienta.typdok.value==""){
  1088.     pola+=" - " + rodzdoktoz + "\n";
  1089.     koniec=true;
  1090.     }
  1091.  
  1092.     if(document.daneKlienta.nrdok.value=="" || nrdok_Klient(infnrdok) == 0){
  1093.     pola+=" - " + nrdoktoz + "\n";
  1094.     koniec=true;
  1095.     }
  1096.  
  1097.     if(document.daneKlienta.firmaid.value==""){
  1098.     pola+=" - " + firma + "\n";
  1099.     koniec=true;
  1100.     }
  1101.  
  1102. //    if(document.daneKlienta.uzytktypkod.value==""){
  1103. //  pola+=" - " + rodzuzytk + "\n";
  1104. //  koniec=true;
  1105. //   }
  1106.  
  1107.     if(document.daneKlienta.nazwa.value=="" || tylko_litery(document.daneKlienta.nazwa.value) == 0){
  1108.     pola+=" - " +  imienazwisko + "\n";
  1109.     koniec=true;
  1110.     }
  1111.  
  1112.    if(document.daneKlienta.ulica.value==""){
  1113.     pola+=" - " + adres + "\n";
  1114.     koniec=true;
  1115.     }
  1116.  
  1117.     if(document.daneKlienta.kodpocztowy.value=="" || kod_Klienta(infkod) == 0){
  1118.     pola+=" - " + kodpoczt + "\n";
  1119.     koniec=true;
  1120.     }
  1121.  
  1122.     if(document.daneKlienta.miasto.value=="" || nazwa_miasta(infmiasto) == 0){
  1123.     pola+=" - " + miasto + "\n";
  1124.     koniec=true;
  1125.     }
  1126.  
  1127. //    if(indywidualny(idUsera, idAjent) == 0){
  1128. //        koniec=true;
  1129. //    }
  1130.  
  1131.     if (daneKlienta.uzytktypkod.value==990) {
  1132.  
  1133.     if(document.daneKlienta.kodpocztowyfirmy.value=="" || kod_Firmy(infkodpocztfirmy) == 0){
  1134.     pola+=" - " + kodpocztfirmy + "\n";
  1135.     koniec=true;
  1136.     }
  1137.    
  1138.     if(document.daneKlienta.miastofirmy.value=="" || nazwa_miastafirmy(infmiastofirmy) == 0){
  1139.     pola+=" - " + miastofirmy + "\n";
  1140.     koniec=true;
  1141.     }
  1142.  
  1143.     var nip = 0;
  1144.     var nazwa = "";
  1145.     var adres = "";
  1146.     var kod = "";
  1147.     var miasto = "";
  1148.  
  1149.     nazwa = document.daneKlienta.nazwafirmy.value;
  1150.     nip = document.daneKlienta.nipfirmy.value.length;
  1151.     adres = document.daneKlienta.ulicafirmy.value;
  1152.     kod = document.daneKlienta.kodpocztowyfirmy.value;
  1153.     miasto = document.daneKlienta.miastofirmy.value;
  1154.     if (nazwa != "" && (nip == 0 || adres == "" || kod == "" || miasto == "")){
  1155.         pola+=" - " + polafirmy + "\n";
  1156.         koniec=true;
  1157.     }
  1158.     else {
  1159.         if (nip != 0 && (nazwa == "" || adres == "" || kod == "" || miasto == "")){
  1160.         pola+=" - " + polafirmy + "\n";
  1161.         koniec=true;
  1162.         }
  1163.         else {
  1164.             if (adres != "" && (nip == 0 || nazwa == "" || kod == "" || miasto == "")){
  1165.             pola+=" - " + polafirmy + "\n";
  1166.             koniec=true;
  1167.             }
  1168.             else {
  1169.                 if (kod != "" && (nip == 0 || adres == "" || nazwa == "" || miasto == "")){
  1170.                 pola+=" - " + polafirmy + "\n";
  1171.                 koniec=true;
  1172.                 }
  1173.                 else {
  1174.                     if (miasto != "" && (nip == 0 || adres == "" || kod == "" || nazwa == "")){
  1175.                     pola+=" - " + polafirmy + "\n";
  1176.                     koniec=true;
  1177.                     }
  1178.                 }
  1179.             }
  1180.         }
  1181.     }
  1182. }
  1183.     if(!koniec){
  1184.         document.daneKlienta.submit();
  1185.     }
  1186.     else {
  1187.         if(pola != ""){
  1188.             alert(poprpola + ":\n" + pola);
  1189.     }
  1190.     }
  1191. }
  1192.  
  1193. function kompletnosc_danych(kraj, login, imienazwisko, nowehaslo, powthasla, email, adres, kodpoczt, infkod, miasto, infmiasto, rodzdoktoz, nrdoktoz, wyrzgody, infnrdok, poprpola, kodpocztfirmy, infkodpocztfirmy, miastofirmy, infmiastofirmy, polafirmy, polawysylka){
  1194. var pola = "";
  1195. var koniec = false;
  1196. var bladWysylka = false;
  1197.  
  1198.     if(document.daneKlienta.login.value=="" || dlugosc_pol(document.daneKlienta.login.value.length) == 0){
  1199.     pola+=" - " + login + "\n";
  1200.     koniec=true;
  1201.     }
  1202.  
  1203.     if(document.daneKlienta.nazwa.value=="" || tylko_litery(document.daneKlienta.nazwa.value) == 0 ){
  1204.     pola+=" - " +  imienazwisko + "\n";
  1205.     koniec=true;
  1206.     }
  1207.  
  1208.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 || litery_liczby(document.daneKlienta.haslo.value) == 0){
  1209.     pola+=" - " +  nowehaslo + "\n";
  1210.     koniec=true;
  1211.     }
  1212.  
  1213.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  1214.     pola+=" - " + powthasla + "\n";
  1215.     koniec=true;
  1216.     }
  1217.  
  1218.     if(document.daneKlienta.email.value=="" || (poprawny_email(document.daneKlienta.email.value) == 0) ){
  1219.     pola+=" - " + email + "\n";
  1220.     koniec=true;
  1221.     }
  1222.    
  1223.     if(document.daneKlienta.jesliFirma.checked == false){
  1224.    if(document.daneKlienta.ulica.value==""){
  1225.     pola+=" - " + adres + "\n";
  1226.     koniec=true;
  1227.     }
  1228.  
  1229.     if(document.daneKlienta.kodpocztowy.value=="" || kod_Klienta_pl(infkod, kraj) == 0){
  1230.     pola+=" - " + kodpoczt + "\n";
  1231.     koniec=true;
  1232.     }
  1233.  
  1234.     if(document.daneKlienta.miasto.value=="" || nazwa_miasta(infmiasto) == 0){
  1235.     pola+=" - " + miasto + "\n";
  1236.     koniec=true;
  1237.     }
  1238.     }
  1239.  
  1240.  
  1241. /*
  1242.    if(document.daneKlienta.jesliAdresWysylka.checked == true){
  1243.     var adresW = "";
  1244.     var kodW = "";
  1245.     var miastoW = "";
  1246.  
  1247.  
  1248.      adresW = document.daneKlienta.ulicaWysylka.value;
  1249.     kodW = document.daneKlienta.kodpocztowyWysylka.value;
  1250.     miastoW = document.daneKlienta.miastoWysylka.value;
  1251.  
  1252.        if(document.daneKlienta.ulicaWysylka.value==""){
  1253.             bladWysylka=true;
  1254.         }
  1255.  
  1256.         if(document.daneKlienta.kodpocztowyWysylka.value=="" || kod_Klienta_pl(kodW,kraj) == 0){
  1257.           bladWysylka=true;
  1258.         }
  1259.  
  1260.         if(document.daneKlienta.miastoWysylka.value=="" || nazwa_miasta(miastoW) == 0){
  1261.           bladWysylka=true;
  1262.         }
  1263.         if (bladWysylka==true)
  1264.         {
  1265.             pola+=" - " + polawysylka + "\n";
  1266.             koniec=true;
  1267.  
  1268.         }
  1269.     }
  1270.     */
  1271.  
  1272.  
  1273.     var nip = 0;
  1274.     var nazwa = "";
  1275.     var adres = "";
  1276.     var kod = "";
  1277.     var miasto = "";
  1278.  
  1279.     nazwa = document.daneKlienta.nazwafirmy.value;
  1280.     nip = document.daneKlienta.nipfirmy.value.length;
  1281.     adres = document.daneKlienta.ulicafirmy.value;
  1282.     kod = document.daneKlienta.kodpocztowyfirmy.value;
  1283.     miasto = document.daneKlienta.miastofirmy.value;
  1284.     if(document.daneKlienta.jesliFirma.checked == true){
  1285.         if (nazwa == "" && nip == 0 && adres == "" && kod == "" && miasto == ""){
  1286.         pola+= polafirmy + "\n";
  1287.         koniec=true;
  1288.     }    
  1289.     }
  1290.     if (nazwa != "" && (nip == 0 || adres == "" || kod == "" || miasto == "")){
  1291.         pola+=polafirmy + "\n";
  1292.         koniec=true;
  1293.     }
  1294.     else {
  1295.         if (nip != 0 && (nazwa == "" || adres == "" || kod == "" || miasto == "")){
  1296.         pola+= polafirmy + "\n";
  1297.         koniec=true;
  1298.         }
  1299.         else {
  1300.             if (adres != "" && (nip == 0 || nazwa == "" || kod == "" || miasto == "")){
  1301.             pola+= polafirmy + "\n";
  1302.             koniec=true;
  1303.             }
  1304.             else {
  1305.                 if (kod != "" && (nip == 0 || adres == "" || nazwa == "" || miasto == "")){
  1306.                 pola+= polafirmy + "\n";
  1307.                 koniec=true;
  1308.                 }
  1309.                 else {
  1310.                     if (miasto != "" && (nip == 0 || adres == "" || kod == "" || nazwa == "")){
  1311.                     pola+= polafirmy + "\n";
  1312.                     koniec=true;
  1313.                     }
  1314.                 }
  1315.             }
  1316.         }
  1317.     }
  1318.   if(document.daneKlienta.akceptacja.checked == false){
  1319.  
  1320.     koniec=true;
  1321.     }
  1322.  
  1323.     if(!koniec){
  1324.    
  1325.             document.daneKlienta.submit();
  1326.    
  1327.     }
  1328.     else {
  1329.     if(pola != "")
  1330.             alert(poprpola + ":\n" + pola);
  1331.      else
  1332.          alert(wyrzgody);
  1333.  
  1334.     }
  1335.  
  1336. }
  1337.  
  1338. function kompletnosc_danych2(login, imienazwisko, nowehaslo, powthasla, email, adres, kodpoczt, infkod, miasto, infmiasto, rodzdoktoz, nrdoktoz, wyrzgody, infnrdok, poprpola, kodpocztfirmy, infkodpocztfirmy, miastofirmy, infmiastofirmy, polafirmy){
  1339. var pola = "";
  1340. var koniec = false;
  1341.  
  1342.     if(document.daneKlienta.login.value=="" || dlugosc_pol(document.daneKlienta.login.value.length) == 0){
  1343.     pola+=" - " + login + "\n";
  1344.     koniec=true;
  1345.     }
  1346.  
  1347.     if(document.daneKlienta.nazwa.value=="" || tylko_litery(document.daneKlienta.nazwa.value) == 0 || poprawna_nazwa(document.daneKlienta.nazwa.value) == 0){
  1348.     pola+=" - " +  imienazwisko + "\n";
  1349.     koniec=true;
  1350.     }
  1351.  
  1352.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 ){
  1353.     pola+=" - " +  nowehaslo + "\n";
  1354.     koniec=true;
  1355.     }
  1356.  
  1357.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  1358.     pola+=" - " + powthasla + "\n";
  1359.     koniec=true;
  1360.     }
  1361.  
  1362.     if(document.daneKlienta.email.value=="" || (poprawny_email(document.daneKlienta.email.value) == 0) ){
  1363.     pola+=" - " + email + "\n";
  1364.     koniec=true;
  1365.     }
  1366.    if(daneKlienta.uzytktypkod.value!=990){
  1367.    if(document.daneKlienta.ulica.value==""){
  1368.     pola+=" - " + adres + "\n";
  1369.     koniec=true;
  1370.     }
  1371.  
  1372.     if(document.daneKlienta.kodpocztowy.value=="" || kod_Klienta(infkod) == 0){
  1373.     pola+=" - " + kodpoczt + "\n";
  1374.     koniec=true;
  1375.     }
  1376.  
  1377.     if(document.daneKlienta.miasto.value=="" || nazwa_miasta(infmiasto) == 0){
  1378.     pola+=" - " + miasto + "\n";
  1379.     koniec=true;
  1380.     }
  1381.     }
  1382.  
  1383.     if (daneKlienta.uzytktypkod.value==990 && daneKlienta.firmaid.value==1) {
  1384.  
  1385.     var nip = 0;
  1386.     var nazwa = "";
  1387.     var adres = "";
  1388.     var kod = "";
  1389.     var miasto = "";
  1390.  
  1391.     nazwa = document.daneKlienta.nazwafirmy.value;
  1392.     nip = document.daneKlienta.nipfirmy.value.length;
  1393.     adres = document.daneKlienta.ulicafirmy.value;
  1394.     kod = document.daneKlienta.kodpocztowyfirmy.value;
  1395.     miasto = document.daneKlienta.miastofirmy.value;
  1396.     if (nazwa != "" && (nip == 0 || adres == "" || kod == "" || miasto == "")){
  1397.         pola+=" - " + polafirmy + "\n";
  1398.         koniec=true;
  1399.     }
  1400.     else {
  1401.         if (nip != 0 && (nazwa == "" || adres == "" || kod == "" || miasto == "")){
  1402.         pola+=" - " + polafirmy + "\n";
  1403.         koniec=true;
  1404.         }
  1405.         else {
  1406.             if (adres != "" && (nip == 0 || nazwa == "" || kod == "" || miasto == "")){
  1407.             pola+=" - " + polafirmy + "\n";
  1408.             koniec=true;
  1409.             }
  1410.             else {
  1411.                 if (kod != "" && (nip == 0 || adres == "" || nazwa == "" || miasto == "")){
  1412.                 pola+=" - " + polafirmy + "\n";
  1413.                 koniec=true;
  1414.                 }
  1415.                 else {
  1416.                     if (miasto != "" && (nip == 0 || adres == "" || kod == "" || nazwa == "")){
  1417.                     pola+=" - " + polafirmy + "\n";
  1418.                     koniec=true;
  1419.                     }
  1420.                 }
  1421.             }
  1422.         }
  1423.     }
  1424. }
  1425.  
  1426.     if(!koniec){
  1427.     document.daneKlienta.submit();
  1428.     }
  1429.     else {
  1430.     if(pola != "")
  1431.             alert(poprpola + ":\n" + pola);
  1432.     }
  1433.  
  1434. }
  1435.  
  1436. function kompletnosc_danych3(kraj, login, imienazwisko, nowehaslo, powthasla, email, adres, kodpoczt, infkod, miasto, infmiasto, rodzdoktoz, nrdoktoz, efaktura, wyrzgody, infnrdok, poprpola, polafirmy, polawysylka, powtemail, infemail, infopolskieznaki){
  1437. var pola = "";
  1438. var koniec = false;
  1439. var bladWysylka = false;
  1440. var bladEFaktura = false;
  1441.  
  1442.     if(document.daneKlienta.login.value=="" || dlugosc_pol(document.daneKlienta.login.value.length) == 0){
  1443.     pola+=" - " + login + "\n";
  1444.     koniec=true;
  1445.     }
  1446.  
  1447.     if(document.daneKlienta.nazwa.value=="" || nie_tylko_litery(document.daneKlienta.nazwa.value) == 0 ){        
  1448.     pola+=" - " +  imienazwisko + "\n";
  1449.     koniec=true;
  1450.     } else {
  1451.         var imnaz = document.daneKlienta.nazwa.value.trim();
  1452.         if (!(imnaz.length > 0 && imnaz.indexOf(" ") > 0 && imnaz.indexOf(" ") < (imnaz.length - 1))) {
  1453.             pola+=" - " +  imienazwisko + "\n";
  1454.             koniec=true;
  1455.         }
  1456.     }
  1457.  
  1458.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 ){
  1459.     pola+=" - " +  nowehaslo + "\n";
  1460.     koniec=true;
  1461.     }
  1462.  
  1463.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  1464.     pola+=" - " + powthasla + "\n";
  1465.     koniec=true;
  1466.     }
  1467.  
  1468.     if(document.daneKlienta.email.value=="" || (poprawny_email(document.daneKlienta.email.value) == 0) ){
  1469.     pola+=" - " + email + "\n";
  1470.     koniec=true;
  1471.     }
  1472.    
  1473.  
  1474.     var nip = 0;
  1475.     var nazwa = "";
  1476.     var adres = "";
  1477.     var kod = "";
  1478.     var miasto = "";
  1479.  
  1480.     nazwa = document.daneKlienta.nazwafirmy.value;
  1481.     nip = document.daneKlienta.nipfirmy.value.length;
  1482.     adres = document.daneKlienta.ulica.value;
  1483.     kod = document.daneKlienta.kodpocztowy.value;
  1484.     miasto = document.daneKlienta.miasto.value;
  1485.     if (nazwa != "" && (nip == 0 || adres == "" || kod == "" || miasto == "")) {
  1486.         pola += polafirmy + "\n";
  1487.         koniec = true;
  1488.     }
  1489.     else {
  1490.         if (nip != 0 && (nazwa == "" || adres == "" || kod == "" || miasto == "")) {
  1491.             pola += polafirmy + "\n";
  1492.             koniec = true;
  1493.         }
  1494.  
  1495.     }
  1496.    
  1497.     if (document.daneKlienta.nazwafirmy.value.length > 0 || document.daneKlienta.nipfirmy.value.length > 0 || document.daneKlienta.ulica.value.length > 0 ||
  1498.             document.daneKlienta.kodpocztowy.value.length > 0 || document.daneKlienta.miasto.value.length > 0) {
  1499.         if (document.daneKlienta.zgodafakturaelektoniczna.checked == false) {
  1500.             koniec = true;
  1501.             bladEFaktura = true;
  1502.         }
  1503.     }
  1504.  
  1505.     if (document.daneKlienta.akceptacja.checked == false) {
  1506.         koniec = true;
  1507.     }
  1508.        
  1509.     if(!polskie_znaki_valid(infopolskieznaki)) {
  1510.         pola +=email + "\n";
  1511.         pola += " - " + infopolskieznaki + "\n";
  1512.         koniec = true;        
  1513.     }    
  1514.    
  1515.  
  1516.     if (!koniec) {
  1517.         document.daneKlienta.submit();
  1518.     }
  1519.     else {
  1520.         if (pola != "") {
  1521.             alert(poprpola + ":\n" + pola);
  1522.         }
  1523.         else {
  1524.             if (bladEFaktura) {
  1525.                 alert(efaktura);
  1526.             } else {
  1527.                 alert(wyrzgody);
  1528.             }
  1529.         }
  1530.     }
  1531.  
  1532. }
  1533.  
  1534. function kompletnosc_danych4(login, firma, nowehaslo, nip, powthasla, regon, osoba, adres, email, kodpoczt, infkod, miasto, infmiasto, telefon, typ_konta_egds_tmp, domena){
  1535. var pola = "";
  1536. var poprpola = "Proszę poprawić pola";
  1537. var koniec = false;
  1538.  
  1539.     if(document.daneKlienta.login.value=="" || dlugosc_pol(document.daneKlienta.login.value.length) == 0){
  1540.     pola+=" - " + login + "\n";
  1541.     koniec=true;
  1542.     }
  1543.  
  1544.     if(document.daneKlienta.nazwa_firmy.value=="" || tylko_litery_i_cyfry(document.daneKlienta.nazwa_firmy.value) == 0){
  1545.     pola+=" - " +  firma + "\n";
  1546.     koniec=true;
  1547.     }
  1548.  
  1549.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 ){
  1550.     pola+=" - " +  nowehaslo + "\n";
  1551.     koniec=true;
  1552.     }
  1553.  
  1554.     if(document.daneKlienta.nip_firmy.value=="" || sprNip('nip_firmy_id') == 0 ){
  1555.     pola+=" - " +  nip + "\n";
  1556.     koniec=true;
  1557.     }
  1558.  
  1559.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  1560.     pola+=" - " + powthasla + "\n";
  1561.     koniec=true;
  1562.     }
  1563.  
  1564.  
  1565.     if(document.daneKlienta.regon_firmy.value=="" || dlugosc_pol(document.daneKlienta.regon_firmy.value.length) == 0){
  1566.     pola+=" - " + regon + "\n";
  1567.     koniec=true;
  1568.     }
  1569.    
  1570.     if(document.daneKlienta.osoba_kontakt.value=="" || tylko_litery(document.daneKlienta.osoba_kontakt.value) == 0 || poprawna_nazwa(document.daneKlienta.osoba_kontakt.value) == 0){
  1571.     pola+=" - " +  osoba + "\n";
  1572.     koniec=true;
  1573.     }
  1574.    
  1575.     if(document.daneKlienta.ulica.value==""){
  1576.     pola+=" - " + adres + "\n";
  1577.     koniec=true;
  1578.     }
  1579.  
  1580.     if(document.daneKlienta.email.value=="" || (poprawny_email(document.daneKlienta.email.value) == 0) ){
  1581.     pola+=" - " + email + "\n";
  1582.     koniec=true;
  1583.     }
  1584.  
  1585.     if(document.daneKlienta.kodpocztowy.value=="" || kod_Klienta(infkod) == 0){
  1586.     pola+=" - " + kodpoczt + "\n";
  1587.     koniec=true;
  1588.     }
  1589.  
  1590.     if(document.daneKlienta.miasto.value=="" || nazwa_miasta(infmiasto) == 0){
  1591.     pola+=" - " + miasto + "\n";
  1592.     koniec=true;
  1593.     }
  1594.  
  1595.     if(document.daneKlienta.tel.value=="" || dlugosc_pol(document.daneKlienta.tel.value.length) == 0){
  1596.     pola+=" - " + telefon + "\n";
  1597.     koniec=true;
  1598.     }
  1599.     if(typ_konta_egds_tmp === 1)
  1600.     {
  1601.      
  1602.        if(document.daneKlienta.domena.value=="" ){
  1603.            if(document.daneKlienta.typkonta_egds.value == 1)
  1604.             {
  1605.                 pola+=" - " + domena + "\n";
  1606.                 koniec=true;
  1607.             }
  1608.         }else{
  1609.             var patternDomena=/@([a-z0-9\-]+\.)+[a-z]{2,8}$/i;
  1610.  
  1611.             if(!patternDomena.test(document.daneKlienta.domena.value)){
  1612.                pola+=" - " + domena + "\n";
  1613.                koniec=true;    
  1614.            }
  1615.         }
  1616.     }
  1617.    
  1618.     try {
  1619.         if (!(Number(document.daneKlienta.jedn_sluzb.value) > 0 && Number(document.daneKlienta.nr_kasy.value) > 0 && Number(document.daneKlienta.k_nr.value) > 0)) {
  1620.             pola+=" - " + "Jednostka służbowa, Nr kasy, K-nr" + "\n";
  1621.             koniec=true;
  1622.         }
  1623.     }
  1624.     catch (err)
  1625.     {
  1626.         pola+=" - " + "Jednostka służbowa, Nr kasy, K-nr" + "\n";
  1627.         koniec=true;
  1628.     }
  1629.     if(!koniec){
  1630.     document.daneKlienta.submit();
  1631.     }
  1632.     else {
  1633.     if(pola != "")
  1634.             alert(poprpola + ":\n" + pola);
  1635.     }
  1636.  
  1637. }
  1638.  
  1639. function kompletnosc_danych5(osoba, adres, email, kodpoczt, infkod, miasto, infmiasto, telefon, domena){
  1640. var pola = "";
  1641. var poprpola = "Proszę poprawić pola";
  1642. var koniec = false;
  1643.  
  1644.     if(document.daneKlienta.osobakontaktowa.value=="" || tylko_litery(document.daneKlienta.osobakontaktowa.value) == 0 || poprawna_nazwa(document.daneKlienta.osobakontaktowa.value) == 0){
  1645.     pola+=" - " +  osoba + "\n";
  1646.     koniec=true;
  1647.     }
  1648.    
  1649.     if(document.daneKlienta.ulica.value==""){
  1650.     pola+=" - " + adres + "\n";
  1651.     koniec=true;
  1652.     }
  1653.  
  1654.     if(document.daneKlienta.email.value=="" || (poprawny_email(document.daneKlienta.email.value) == 0) ){
  1655.     pola+=" - " + email + "\n";
  1656.     koniec=true;
  1657.     } else {
  1658.         if (document.daneKlienta.email.value.indexOf(domena, document.daneKlienta.email.value.length - domena.length) == -1) {
  1659.             pola+=" - email (wymagana domena: " + domena + ")\n";
  1660.             koniec=true;
  1661.         }
  1662.     }
  1663.    
  1664.  
  1665.     if(document.daneKlienta.kodpocztowy.value=="" || kod_Klienta(infkod) == 0){
  1666.     pola+=" - " + kodpoczt + "\n";
  1667.     koniec=true;
  1668.     }
  1669.  
  1670.     if(document.daneKlienta.miasto.value=="" || nazwa_miasta(infmiasto) == 0){
  1671.     pola+=" - " + miasto + "\n";
  1672.     koniec=true;
  1673.     }
  1674.  
  1675.     if(document.daneKlienta.tel.value=="" || dlugosc_pol(document.daneKlienta.tel.value.length) == 0){
  1676.     pola+=" - " + telefon + "\n";
  1677.     koniec=true;
  1678.     }
  1679.    
  1680.     if(!koniec){
  1681.     document.daneKlienta.submit();
  1682.     }
  1683.     else {
  1684.     if(pola != "")
  1685.             alert(poprpola + ":\n" + pola);
  1686.     }
  1687.  
  1688. }
  1689.  
  1690. function sprawdz_numery(){
  1691.     var pola = "";
  1692.     var poprpola = "Proszę poprawić pola";
  1693.     var koniec = false;
  1694.    
  1695.     if (isNaN(document.daneKlienta.jedn_sluzb.value) || Number(document.daneKlienta.jedn_sluzb.value) <= 0) {
  1696.         pola += " - Jednostka służbowa\n";
  1697.         koniec = true;
  1698.     }
  1699.  
  1700.     if (isNaN(document.daneKlienta.nr_kasy.value) || Number(document.daneKlienta.nr_kasy.value) <= 0) {
  1701.         pola += " - Nr kasy\n";
  1702.         koniec = true;
  1703.     }
  1704.  
  1705.     if (isNaN(document.daneKlienta.k_nr.value) || Number(document.daneKlienta.k_nr.value) <= 0) {
  1706.         pola += " - K-nr\n";
  1707.         koniec = true;
  1708.     }
  1709.    
  1710.     if(!koniec){
  1711.         document.body.style.cursor = "wait";    
  1712.         var xhr = new XMLHttpRequest();
  1713.         xhr.onreadystatechange = function() {
  1714.             if (xhr.readyState === 4) {
  1715.                 var data = xhr.responseText;
  1716.                 document.body.style.cursor = "default";
  1717.                 alert(data);
  1718.             }
  1719.         }
  1720.         xhr.open('GET', '/CheckNumbers?jedn_sluzb='+document.daneKlienta.jedn_sluzb.value+'&nr_kasy='+document.daneKlienta.nr_kasy.value+'&k_nr='+document.daneKlienta.k_nr.value, true);
  1721.         xhr.send(null);
  1722.     }
  1723.     else {
  1724.         if(pola != "")
  1725.             alert(poprpola + ":\n" + pola);
  1726.     }
  1727.    
  1728. }
  1729.  
  1730. function kompletnosc_danych_kontogosc(imienazwisko, email, powt_email, poprpola, efaktura, wyrzgody, nazwafirmy, nip, ulica, kodpocztowy, miasto, infopolskieznaki){
  1731.  
  1732.     var pola = "";
  1733.     var koniec = false;
  1734.     var bladEFaktura = false;
  1735.     var powt_email_str = document.daneKlienta.powt_email.value.toLowerCase();
  1736.     var email_str = document.daneKlienta.email.value.toLowerCase();
  1737.  
  1738.     if(sprImieNazwisko(document.daneKlienta.imie.value, "", 1, 2) == 0 || sprImieNazwisko(document.daneKlienta.nazwisko.value, "", 1, 2) == 0){
  1739.     pola+=" - " + imienazwisko + "\n";
  1740.     koniec=true;
  1741.     }
  1742.  
  1743.     if(email_str=="" || (poprawny_email(email_str) == 0) ){
  1744.     pola+=" - " + email + "\n";
  1745.     koniec=true;
  1746.     }
  1747.  
  1748.     if(powt_email_str=="" || (poprawny_email(powt_email_str) == 0) || powt_email_str!=email_str ){
  1749.     pola+=" - " +  powt_email + "\n";
  1750.     koniec=true;
  1751.     }
  1752.    
  1753.     if(document.getElementById('fakturavat').checked){
  1754.         if (document.daneKlienta.zgodafakturaelektoniczna.checked == false) {
  1755.             koniec = true;
  1756.             bladEFaktura = true;
  1757.         }
  1758.        
  1759.         /*
  1760.         if (sprNipValue('nipfirmy') === 0) {
  1761.             koniec = true;
  1762.             pola += " - " + nip + "\n";
  1763.         }
  1764.         */
  1765.        
  1766.         if (document.daneKlienta.nazwafirmy.value.length < 2) {
  1767.             koniec = true;
  1768.             pola += " - " + nazwafirmy + "\n";
  1769.         }
  1770.         if (document.daneKlienta.ulica.value.length < 2) {
  1771.             koniec = true;
  1772.             pola += " - " + ulica + "\n";
  1773.         }
  1774.         if (document.daneKlienta.kodpocztowy.value.length < 2) {
  1775.             koniec = true;
  1776.             pola += " - " + kodpocztowy + "\n";
  1777.         }
  1778.         if (document.daneKlienta.miasto.value.length < 2) {
  1779.             koniec = true;
  1780.             pola += " - " + miasto + "\n";
  1781.         }
  1782.  
  1783.     }    
  1784.  
  1785.     if(!polskie_znaki_valid(infopolskieznaki)) {
  1786.         koniec = true;        
  1787.         pola+= email + "\n";
  1788.         pola += " - " + infopolskieznaki + "\n";        
  1789.     }
  1790.  
  1791.     if(document.daneKlienta.akceptacja.checked === false){
  1792.     koniec=true;
  1793.     }
  1794.  
  1795.     if (!koniec) {
  1796.         document.daneKlienta.submit();
  1797.     }
  1798.     else {
  1799.         if (pola !== "") {
  1800.             alert(poprpola + ":\n" + pola);
  1801.         }
  1802.         else {
  1803.             if (bladEFaktura) {
  1804.                 alert(efaktura);
  1805.             } else {
  1806.                 alert(wyrzgody);
  1807.             }
  1808.         }
  1809.     }
  1810. }
  1811.  
  1812. function danych_bezhasla(imienazwisko, email, adres, kodpoczt, infkod, miasto, infmiasto, nrdoktoz, infnrdok, poprpola, kodpocztfirmy, infkodpocztfirmy, miastofirmy, infmiastofirmy, polafirmy1, polawysylka){
  1813. var pola = "";
  1814. var koniec = false;
  1815. var bladWysylka = false;
  1816.     if(document.daneKlienta.nazwa.value=="" || tylko_litery(document.daneKlienta.nazwa.value) == 0 || poprawna_nazwa(document.daneKlienta.nazwa.value) == 0){
  1817.     pola+=" - " +  imienazwisko + "\n";
  1818.     koniec=true;
  1819.     }
  1820.        
  1821.     if(document.daneKlienta.email.value=="" || poprawny_email(document.daneKlienta.email.value) == 0){
  1822.     pola+=" - " + email + "\n";
  1823.     koniec=true;
  1824.     }
  1825.     if(document.daneKlienta.typUsera.value!=990){
  1826.    if(document.daneKlienta.ulica.value==""){
  1827.     pola+=" - " + adres + "\n";
  1828.     koniec=true;
  1829.     }
  1830.  
  1831.     if(document.daneKlienta.kodpocztowy.value=="" || kod_Klienta(infkod) == 0){
  1832.     pola+=" - " + kodpoczt + "\n";
  1833.     koniec=true;
  1834.     }
  1835.  
  1836.     if(document.daneKlienta.miasto.value=="" || nazwa_miasta(infmiasto) == 0){
  1837.     pola+=" - " + miasto + "\n";
  1838.     koniec=true;
  1839.     }
  1840.     }
  1841.  
  1842.  
  1843.     if( kod_Firmy(infkodpocztfirmy) == 0){
  1844.     pola+=" - " + kodpocztfirmy + "\n";
  1845.     koniec=true;
  1846.     }
  1847.    
  1848.     if(nazwa_miastafirmy(infmiastofirmy) == 0){
  1849.     pola+=" - " + miastofirmy + "\n";
  1850.     koniec=true;
  1851.     }
  1852.    
  1853.     var nip = 0;
  1854.     var nazwa = "";
  1855.     var adres = "";
  1856.     var kod = "";
  1857.     var miasto = "";
  1858.  
  1859.     nazwa = document.daneKlienta.nazwafirmy.value;
  1860.     nip = document.daneKlienta.nipfirmy.value.length;
  1861.     adres = document.daneKlienta.ulicafirmy.value;
  1862.     kod = document.daneKlienta.kodpocztowyfirmy.value;
  1863.     miasto = document.daneKlienta.miastofirmy.value;
  1864.  
  1865.     if(document.daneKlienta.typUsera.value==990){
  1866.         if (nazwa == "" && nip == 0 && adres == "" && kod == "" && miasto == ""){
  1867.             pola+= polafirmy1 + "\n";
  1868.             koniec=true;
  1869.         }
  1870.     }
  1871.     if(document.daneKlienta.typUsera.value>=990){
  1872.     if (nazwa != "" && (nip == 0 || adres == "" || kod == "" || miasto == "")){
  1873.         pola+= polafirmy1 + "\n";
  1874.         koniec=true;
  1875.     }
  1876.     else {
  1877.         if (nip != 0 && (nazwa == "" || adres == "" || kod == "" || miasto == "")){
  1878.         pola+= polafirmy1 + "\n";
  1879.         koniec=true;
  1880.         }
  1881.         else {
  1882.             if (adres != "" && (nip == 0 || nazwa == "" || kod == "" || miasto == "")){
  1883.             pola+= polafirmy1 + "\n";
  1884.             koniec=true;
  1885.             }
  1886.             else {
  1887.                 if (kod != "" && (nip == 0 || adres == "" || nazwa == "" || miasto == "")){
  1888.                 pola+= polafirmy1 + "\n";
  1889.                 koniec=true;
  1890.                 }
  1891.                 else {
  1892.                     if (miasto != "" && (nip == 0 || adres == "" || kod == "" || nazwa == "")){
  1893.                     pola+= + polafirmy1 + "\n";
  1894.                     koniec=true;
  1895.                     }
  1896.                 }
  1897.             }
  1898.         }
  1899.     }
  1900.     }
  1901.     if(!koniec){
  1902.     document.daneKlienta.submit();
  1903.     }
  1904.     else {
  1905.     if(pola != "")
  1906.             alert(poprpola + ":\n" + pola);
  1907.     }
  1908. }
  1909.  
  1910. function kompletnosc_danychF(kraj, login, imienazwisko, nowehaslo, powthasla, email, wyrNPS, wyrzgody, poprpola, polafirmy){
  1911. var pola = "";
  1912. var koniec = false;
  1913. var txtPS = false;
  1914. var bladWysylka = false;
  1915.  
  1916.     if(document.daneKlienta.login.value=="" || dlugosc_pol(document.daneKlienta.login.value.length) == 0){
  1917.     pola+=" - " + login + "\n";
  1918.     koniec=true;
  1919.     }
  1920.  
  1921.     if(document.daneKlienta.nazwa.value=="" || nie_tylko_litery(document.daneKlienta.nazwa.value) == 0 ){        
  1922.     pola+=" - " +  imienazwisko + "\n";
  1923.     koniec=true;
  1924.     }
  1925.  
  1926.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 ){
  1927.     pola+=" - " +  nowehaslo + "\n";
  1928.     koniec=true;
  1929.     }
  1930.  
  1931.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  1932.     pola+=" - " + powthasla + "\n";
  1933.     koniec=true;
  1934.     }
  1935.  
  1936.     if(document.daneKlienta.email.value=="" || (poprawny_email(document.daneKlienta.email.value) == 0) ){
  1937.     pola+=" - " + email + "\n";
  1938.     koniec=true;
  1939.     }
  1940.    
  1941.  
  1942.     var nip = 0;
  1943.     var nazwa = "";
  1944.     var adres = "";
  1945.     var kod = "";
  1946.     var miasto = "";
  1947.  
  1948.     nazwa = document.daneKlienta.nazwafirmy.value;
  1949.     nip = document.daneKlienta.nipfirmy.value.length;
  1950.     adres = document.daneKlienta.ulica.value;
  1951.     kod = document.daneKlienta.kodpocztowy.value;
  1952.     miasto = document.daneKlienta.miasto.value;
  1953.      if (nazwa == "" || nip == 0 || adres == "" || kod == "" || miasto == ""){
  1954.         pola+=polafirmy + "\n";
  1955.         koniec=true;
  1956.     }
  1957.    
  1958.   if(document.daneKlienta.akceptacja.checked == false){
  1959.  
  1960.     koniec=true;
  1961.     }
  1962.  
  1963.  if(document.daneKlienta.nieJestemPS.checked == false){
  1964.  
  1965.     koniec=true;
  1966.         txtPS= true;
  1967.     }
  1968.  
  1969.     if(!koniec){
  1970.    
  1971.             document.daneKlienta.submit();
  1972.  
  1973.     }
  1974.     else {
  1975.     if(pola != "")
  1976.             alert(poprpola + ":\n" + pola);
  1977.      else
  1978.      {
  1979.           if(txtPS)
  1980.           {
  1981.                 alert(wyrNPS);
  1982.             }else
  1983.             {
  1984.                 alert(wyrzgody);
  1985.             }
  1986.      }
  1987.  
  1988.     }
  1989.  
  1990. }
  1991.  
  1992.  
  1993. function tylko_haslo(starehaslo, takiesame, nowehaslo, powthasla, nrdoktoz, infnrdok, poprpola){
  1994. var pola = "";
  1995. var koniec = false;
  1996.        
  1997.     if(document.daneKlienta.stare_haslo.value=="")
  1998.     {
  1999.     pola+=" - " + starehaslo + "\n";
  2000.     koniec=true;
  2001.     }
  2002.        
  2003.     if((document.daneKlienta.stare_haslo.value != 0 || document.daneKlienta.haslo.value != 0) && (document.daneKlienta.haslo.value==document.daneKlienta.stare_haslo.value)){
  2004.         alert(takiesame);
  2005.         koniec=true;
  2006.     }
  2007.        
  2008.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 || litery_liczby(document.daneKlienta.haslo.value) == 0){
  2009.     pola+=" - " + nowehaslo + "\n";
  2010.     koniec=true;
  2011.     }
  2012.        
  2013.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  2014.     pola+=" - " + powthasla + "\n";
  2015.     koniec=true;
  2016.     }
  2017.  
  2018.  
  2019.     if(!koniec){
  2020.         document.daneKlienta.submit();
  2021.     }
  2022.     else {
  2023.         if(pola != "")
  2024.             alert(poprpola + ":\n" + pola);
  2025.     }
  2026. }
  2027.  
  2028. function zmiana_hasla_link(takiesame, nowehaslo, powthasla, poprpola){
  2029. var pola = "";
  2030. var koniec = false;
  2031.                        
  2032.     if(document.daneKlienta.haslo.value=="" || dlugosc_pol_haslo(document.daneKlienta.haslo.value.length) == 0 ){
  2033.     pola+=" - " + nowehaslo + "\n";
  2034.     koniec=true;
  2035.     }
  2036.        
  2037.     if(document.daneKlienta.powt_hasla.value=="" || document.daneKlienta.haslo.value != document.daneKlienta.powt_hasla.value){
  2038.     pola+=" - " + powthasla + "\n";
  2039.     koniec=true;
  2040.     }
  2041.  
  2042.  
  2043.     if(!koniec){
  2044.         document.daneKlienta.submit();
  2045.     }
  2046.     else {
  2047.         if(pola != "")
  2048.             alert(poprpola + ":\n" + pola);
  2049.     }
  2050. }
  2051.  
  2052. //function indywidualny(indywUser, indywAjent ,inf2){
  2053. //var NO = 0;
  2054. //var OK = 1;
  2055.  
  2056.  
  2057. //   document.daneKlienta.adminip.disabled=true;
  2058. //    if (document.daneKlienta.firmaid.value!=1 && document.daneKlienta.uzytktypkod.value == indywUser)
  2059. //    {
  2060. //        alert(inf2);
  2061. //        document.daneKlienta.uzytktypkod.value = indywAjent;
  2062. //        document.daneKlienta.adminip.disabled=true;
  2063. //        return NO;
  2064. //    }
  2065. //    if(document.daneKlienta.uzytktypkod.selectedIndex==3)
  2066. //    {
  2067. //        document.daneKlienta.adminip.disabled=false;
  2068. //    }
  2069. //    if(document.daneKlienta.uzytktypkod.selectedIndex!=3)
  2070. //    {
  2071. //        document.daneKlienta.adminip.disabled=true;
  2072. //    }
  2073. //    return OK;
  2074. //}
  2075.  
  2076. //function indywidualny2(indywUser, indywAjent ,inf1){
  2077. //var NO = 0;
  2078. //var OK = 1;
  2079.  
  2080.  
  2081. //   document.daneKlienta.adminip.disabled=true;
  2082. //   if (document.daneKlienta.firmaid.value==1 && document.daneKlienta.uzytktypkod.value != indywUser)
  2083. //    {
  2084. //        alert(inf1);
  2085. //        document.daneKlienta.uzytktypkod.value = indywUser;
  2086. //        document.daneKlienta.adminip.disabled=true;
  2087. //        return NO;
  2088. //   }
  2089. //    if(document.daneKlienta.uzytktypkod.selectedIndex==3)
  2090. //    {
  2091. //        document.daneKlienta.adminip.disabled=false;
  2092. //    }
  2093. //    if(document.daneKlienta.uzytktypkod.selectedIndex!=3)
  2094. //    {
  2095. //        document.daneKlienta.adminip.disabled=true;
  2096. //    }
  2097. //    return OK;
  2098. //}
  2099.  
  2100.  
  2101.  
  2102. function check_relacja(pole){
  2103. var NO = 0;
  2104. var OK = 1;
  2105.  
  2106.     if (navigator.appVersion.indexOf("MSIE")>0)
  2107.         pol ;
  2108.     else
  2109.         pol_2;
  2110.    
  2111.     bez;
  2112.  
  2113.    tekst = "";
  2114.    
  2115.    if (pole==1)
  2116.        tekst=document.relacja.stodjN.value;
  2117.    else if (pole==2)
  2118.        tekst=document.relacja.stprzN.value;
  2119.    
  2120.  
  2121.     for (var i=0; i < pol.length; i++) {
  2122.         regexp = eval("/"+String.fromCharCode(pol[i])+"/g");
  2123.         tekst=tekst.replace(regexp,String.fromCharCode(bez[i]));
  2124.     }
  2125.  
  2126.     if (pole==1)        
  2127.         document.relacja.stodjN.value = tekst.toUpperCase();
  2128.     else if (pole==2)        
  2129.         document.relacja.stprzN.value = tekst.toUpperCase();
  2130.    
  2131.     return OK;
  2132. }
  2133.  
  2134. function relacja_stodj(inf){
  2135. var NO = 0;
  2136. var OK = 1;
  2137.  
  2138.     if (navigator.appVersion.indexOf("MSIE")>0)
  2139.         pol ;
  2140.     else
  2141.         pol_2;
  2142.    
  2143.     bez;
  2144.  
  2145.    tekst = document.relacja.stodj.value;
  2146.  
  2147.     for (var i=0; i < pol.length; i++) {
  2148.         regexp = eval("/"+String.fromCharCode(pol[i])+"/g");
  2149.         tekst=tekst.replace(regexp,String.fromCharCode(bez[i]));
  2150.     }
  2151.  
  2152.     document.relacja.stodj.value = tekst;
  2153.  
  2154.     if(document.relacja.stodj.value.length < 3){
  2155.         alert(inf);
  2156.         document.relacja.stodj.focus();
  2157.         return NO;
  2158.     }
  2159.  
  2160.     if( tylko_litery(document.relacja.stodj.value) == 0) {
  2161.             alert(inf);
  2162.             document.relacja.stodj.focus();
  2163.             document.relacja.stodj.value="";
  2164.             return NO;
  2165.     }
  2166.    
  2167.     return OK;
  2168. }
  2169.  
  2170. function relacja_stprz(inf){
  2171. var NO = 0;
  2172. var OK = 1;
  2173.  
  2174.     if (navigator.appVersion.indexOf("MSIE")>0)
  2175.         pol ;
  2176.     else
  2177.         pol_2;
  2178.    
  2179.     bez;
  2180.  
  2181.     tekst = document.relacja.stprz.value;
  2182.  
  2183.     for (var i=0; i < pol.length; i++) {
  2184.         regexp = eval("/"+String.fromCharCode(pol[i])+"/g");
  2185.         tekst=tekst.replace(regexp,String.fromCharCode(bez[i]));
  2186.     }
  2187.  
  2188.     document.relacja.stprz.value = tekst;
  2189.  
  2190.     if(document.relacja.stprz.value.length <3){
  2191.         alert(inf);
  2192.         document.relacja.stprz.focus();
  2193.         return NO;
  2194.     }
  2195.  
  2196.     if( tylko_litery(document.relacja.stprz.value) == 0) {
  2197.             alert(inf);
  2198.             document.relacja.stprz.focus();
  2199.             document.relacja.stprz.value="";
  2200.             return NO;
  2201.     }
  2202.  
  2203.     return OK;
  2204. }
  2205.  
  2206. function kompletnosc_pol(stodj, stprz, odjprz, mcwstecz, dzienwstecz, godzwstecz, minwstecz, ildnimc, ildniluty, poprpola) {
  2207. var pola = "";
  2208. var koniec = false;
  2209. var OK = true;
  2210. var NO = false;
  2211.  
  2212.     document.relacja.stodj.value = document.relacja.stodj.value.toUpperCase();
  2213.     document.relacja.stprz.value = document.relacja.stprz.value.toUpperCase();
  2214.  
  2215.     if(document.relacja.stodj.value=="" || document.relacja.stodj.value.length < 3){
  2216.         pola+="-  " + stodj + "\n";
  2217.         koniec=true;
  2218.     }
  2219.  
  2220.     if(document.relacja.stprz.value=="" || document.relacja.stprz.value.length < 3){
  2221.         pola+="-  " + stprz + "\n";
  2222.     koniec=true;
  2223.     }
  2224.  
  2225.     if(!koniec){
  2226.        
  2227.         if(document.relacja.stodj.value == document.relacja.stprz.value) {
  2228.             alert(odjprz);
  2229.             document.relacja.stprz.focus();
  2230.             return NO;
  2231.         }
  2232.  
  2233.         if(!kontrola_danych(mcwstecz, dzienwstecz, godzwstecz, minwstecz, ildnimc, ildniluty)) {
  2234.             return NO;
  2235.         }
  2236.  
  2237.         else {
  2238.             document.relacja.submit()
  2239.         }
  2240.     }
  2241.     else
  2242.         alert(poprpola + ":\n " + pola)
  2243.        
  2244. }
  2245.  
  2246. function kontrola_danych(mcwstecz, dzienwstecz, godzwstecz, minwstecz, ildnimc, ildniluty) {
  2247. var OK = true;
  2248. var NO = false;
  2249.  
  2250.     data  = new Date();
  2251.     data.toLocaleString();
  2252.  
  2253.     if(document.relacja.dzodj.value == "" && document.relacja.mcodj.value == "" && document.relacja.rokodj.value == ""){
  2254.         document.relacja.dzodj.value  =  data.getDate();
  2255.         document.relacja.mcodj.value = data.getMonth() + 1;
  2256.         document.relacja.rokodj.value  =  data.getYear();
  2257.     }
  2258.  
  2259.     if(document.relacja.godzodj.value == "" && document.relacja.minodj.value == ""){
  2260.        document.relacja.godzodj.value =  data.getHours();
  2261.         document.relacja.minodj.value =  data.getMinutes();
  2262.     }
  2263.  
  2264.     if(!czas_wstecz(mcwstecz, dzienwstecz, godzwstecz, minwstecz))
  2265.             return NO;
  2266.  
  2267.     if(!dni_miesiac(ildnimc))
  2268.             return NO;
  2269.  
  2270.     if(!luty_dni(ildniluty))
  2271.             return NO;
  2272.  
  2273.     return OK;
  2274. }
  2275.  
  2276. function data_wstecz(mcwstecz, dzienwstecz) {
  2277. var OK = true;
  2278. var NO = false;
  2279.  
  2280.     if (document.relacja.rokodj.value == data.getFullYear())
  2281. {
  2282.     if(document.relacja.mcodj.value < data.getMonth() + 1) {
  2283.             alert(mcwstecz);
  2284.             document.relacja.mcodj.focus();
  2285.             return NO;     
  2286.     }
  2287. }
  2288.  
  2289.     if(document.relacja.mcodj.value == data.getMonth() + 1) {
  2290.             if(document.relacja.dzodj.value  <  data.getDate()) {
  2291.                     alert(dzienwstecz);
  2292.                     document.relacja.dzodj.focus();
  2293.                     return NO;     
  2294.             }
  2295.     }
  2296.  
  2297.     return OK;
  2298.  }
  2299.  
  2300. function czas_wstecz(mcwstecz, dzienwstecz, godzwstecz, minwstecz) {
  2301. var OK = true;
  2302. var NO = false;
  2303.  
  2304.     if(!data_wstecz(mcwstecz, dzienwstecz))
  2305.             return NO;
  2306.  
  2307.     if(document.relacja.mcodj.value == data.getMonth() + 1 && document.relacja.dzodj.value  == data.getDate()) {
  2308.             if( document.relacja.godzodj.value < data.getHours()) {
  2309.                     alert(godzwstecz);
  2310.                     document.relacja.godzodj.focus();
  2311.                     return NO;         
  2312.             }
  2313.  
  2314.             if( document.relacja.godzodj.value == data.getHours() && document.relacja.minodj.value <  data.getMinutes() ) {
  2315.                     alert(minwstecz);
  2316.                     document.relacja.minodj.focus();
  2317.                     return NO;         
  2318.             }
  2319.     }
  2320.     return OK;
  2321.  }
  2322.  
  2323. function dni_miesiac(ildnimc) {
  2324. var OK = true;
  2325. var NO = false;
  2326. var jest = 0;
  2327.  
  2328.     if(document.relacja.dzodj.value != 31)
  2329.             return OK;
  2330.  
  2331.     if(document.relacja.mcodj.value == 2)
  2332.             return OK;
  2333.  
  2334.     for(i = 0; i < miesiace.length; i++) {
  2335.                     if(document.relacja.mcodj.value == miesiace[i])
  2336.                             jest = 1;
  2337.     }
  2338.  
  2339.     if(jest != 1) {
  2340.                     alert(ildnimc);
  2341.                     document.relacja.dzodj.focus();
  2342.                     return NO;
  2343.     }
  2344.  
  2345.     return OK;
  2346. }
  2347.  
  2348.  
  2349. function luty_dni(ildniluty) {
  2350. var OK = true;
  2351. var NO = false;
  2352.  
  2353.     if(rok_przestepny(document.relacja.rokodj.value)) {
  2354.         if(document.relacja.mcodj.value == 2 ) {
  2355.                 if(document.relacja.dzodj.value <= 29)  {
  2356.                         return OK;
  2357.                 }
  2358.                 else {
  2359.                         alert(ildniluty);
  2360.                         document.relacja.dzodj.focus();
  2361.                         return NO;
  2362.                 }
  2363.          }
  2364.          return OK;
  2365.     }
  2366.     else {
  2367.         if(document.relacja.mcodj.value == 2 ) {
  2368.                 if(document.relacja.dzodj.value <= 28)  {
  2369.                         return OK;
  2370.                 }
  2371.                 else {
  2372.                         alert(ildniluty);
  2373.                         document.relacja.dzodj.focus();
  2374.                         return NO;
  2375.                 }
  2376.          }
  2377.     return OK;
  2378.     }
  2379. }
  2380.  
  2381.  
  2382.  
  2383. function kompletnosc_polCombo(inf) {
  2384.  
  2385.     if(document.relacjaCombo.stodj.value == document.relacjaCombo.stprz.value) {
  2386.         alert(inf);
  2387.         document.relacjaCombo.stprz.focus();
  2388.     }
  2389.     else {
  2390.     document.relacjaCombo.submit()
  2391.     }
  2392. }
  2393.  
  2394.  
  2395.  
  2396. function nrdok_RezH(inf){
  2397. var OK = 1;
  2398. var NO = 0;
  2399. var dlugosc = 0;
  2400.  
  2401.     document.rkh.nrdok.value = document.rkh.nrdok.value.toUpperCase();
  2402.    
  2403.     dlugosc = document.rkh.nrdok.length;
  2404.     if(dlugosc == 0)
  2405.             return OK;
  2406. reg = /^[A-Z0-9\-\\\s\\\\\/]{1,30}$/;
  2407.      wyn = rkh.nrdok.value.match(reg);
  2408.  
  2409.     if(!wyn){
  2410.         alert(inf);
  2411.         document.rkh.nrdok.focus();
  2412.         return NO;
  2413.     }
  2414.  
  2415.     return OK;
  2416. }
  2417.  
  2418. function hasloJ_RezH(inf) {
  2419. var OK = 1
  2420. var NO = 0
  2421.  
  2422.     reg = /^[a-z0-9]{1,8}$/i;
  2423.     wyn = rkh.hasloJ.value.match(reg);
  2424.  
  2425.     if (wyn)
  2426.         return OK;
  2427.  
  2428.     alert(inf);
  2429.     return NO;  
  2430. }
  2431.  
  2432. function hasloJ_Generuj(inf) {
  2433. var OK = 1
  2434. var NO = 0
  2435.  
  2436.     reg = /^[a-z0-9]{1,8}$/i;
  2437.     wyn = generuj.hasloGeneruj.value.match(reg);
  2438.     dl = generuj.hasloGeneruj.value.length;
  2439.  
  2440.     if (wyn && dl==8){
  2441.         document.generuj.submit();
  2442.         return OK;
  2443.        
  2444.     }
  2445.  
  2446.     alert(inf);
  2447.     return NO;  
  2448. }
  2449.  
  2450. function hasloJ_Aktywuj(inf,param) {
  2451. var OK = 1
  2452. var NO = 0
  2453.  
  2454.     reg = /^[a-z0-9]{1,8}$/i;
  2455.     wyn = document.forms[param].hasloAktywuj.value.match(reg);
  2456.     dl = document.forms[param].hasloAktywuj.value.length;
  2457.  
  2458.     if (wyn && dl==8){
  2459.         document.forms[param].submit();
  2460.         return OK;
  2461.     }
  2462.     alert(inf);
  2463.     return NO;  
  2464. }
  2465.  
  2466. function tylko_cyfra1(cyfra){
  2467. var NO = 0;
  2468. var OK = 1;
  2469.  
  2470.     if ( cyfra.length != 0 && tylko_cyfra(cyfra) == 1 )
  2471.         return OK;
  2472.        
  2473.     return NO;
  2474. }
  2475.  
  2476. function kompletnosc_polRezH_KoloroweKarty(kolorowa_karta, kod, kodspolki, nrdokumentu, imienazwisko, zlynrdok, zlehaslo, poprpola, kodUzytk){
  2477. var OK = 1;
  2478. var NO = 0;
  2479. var pola = "";
  2480. var koniec = false;
  2481.  
  2482.  
  2483.     if(kod == 1){
  2484.         if(document.rkh.spolkaPKP.value.length == 0 || tylko_cyfra1(document.rkh.spolkaPKP.value) == 0){
  2485.              pola+="- " + kodspolki + "\n";
  2486.              document.rkh.spolkaPKP.focus();
  2487.              koniec=true;
  2488.         }
  2489.     }
  2490.  
  2491.     if(document.rkh.dla.value.length == 0 ){
  2492.         pola+="-" + imienazwisko + "\n";
  2493.         koniec=true;
  2494.     }
  2495.    
  2496.    
  2497.     if(kodUzytk==1){
  2498.         if(document.rkh.hasloJ.value.length < 8 || document.rkh.hasloJ.value.length > 8 || hasloJ_RezH(zlehaslo) == 0){
  2499.             pola+="- " + zlehaslo + "\n";
  2500.             koniec=true;
  2501.         }
  2502.      }
  2503.  
  2504.  
  2505.  
  2506.     if (kolorowa_karta==1)  
  2507.     {
  2508.         if(!koniec)
  2509.             document.rkh.submit();
  2510.         else
  2511.             alert(poprpola + ":\n "+ pola);
  2512.     }
  2513.    
  2514. }
  2515.  
  2516. function kompletnosc_polRezH(kod, kodspolki, nrdokumentu, imienazwisko, zlynrdok, zlehaslo, poprpola, kodUzytk){
  2517. var OK = 1;
  2518. var NO = 0;
  2519. var pola = "";
  2520. var koniec = false;
  2521.  
  2522.     if(kod == 1){
  2523.         if(document.rkh.spolkaPKP.value.length == 0 || tylko_cyfra1(document.rkh.spolkaPKP.value) == 0){
  2524.              pola+="- " + kodspolki + "\n";
  2525.              document.rkh.spolkaPKP.focus();
  2526.              koniec=true;
  2527.         }
  2528.     }
  2529.  
  2530.     if(document.rkh.dla.value.length == 0  || poprawna_nazwa(document.rkh.dla.value) == 0){
  2531.         pola+="- " + imienazwisko + "\n";
  2532.         koniec=true;
  2533.     }
  2534.    
  2535.     if(kodUzytk==1){
  2536.         if(document.rkh.hasloJ.value.length < 8 || document.rkh.hasloJ.value.length > 8 || hasloJ_RezH(zlehaslo) == 0){
  2537.             pola+="- " + zlehaslo + "\n";
  2538.             koniec=true;
  2539.         }
  2540.      }
  2541.  
  2542.  
  2543.     if(!koniec)
  2544.         document.rkh.submit();
  2545.     else
  2546.         alert(poprpola + ":\n "+ pola);
  2547. }
  2548. function kompletnosc_polKarnet( imienazwisko,nrdokumentu,zlynrdok, poprpola){
  2549. var OK = 1;
  2550. var NO = 0;
  2551. var pola = "";
  2552. var koniec = false;
  2553.  
  2554.  
  2555.     if(document.rkh.dla.value.length == 0  || poprawna_nazwa(document.rkh.dla.value) == 0){
  2556.         pola+="- " + imienazwisko + "\n";
  2557.         koniec=true;
  2558.     }
  2559.    
  2560.     if(document.rkh.nrdok.value=="" ){
  2561.     pola+=" - " + nrdokumentu + "\n";
  2562.     koniec=true;
  2563.     }
  2564.  
  2565.  
  2566.     if(!koniec)
  2567.         document.rkh.submit();
  2568.     else
  2569.         alert(poprpola + ":\n "+ pola);
  2570. }
  2571.  
  2572.  
  2573.  
  2574. function drukOknoPDF(sciezka){    
  2575.     window.location.href=sciezka;
  2576. }
  2577.  
  2578. function drukBilet(sciezka){
  2579.     window2=open("/irez/jsp/" + sciezka + "&checkJS=true&print=1","Drukowanie","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=yes, scrollbars=yes, copyhistory=no, width=625, height=900, top=0, left=0");
  2580.     window2.focus();
  2581. }
  2582.  
  2583. function drukOkno(sciezka){
  2584.     window2=open("/irez/jsp/" + sciezka + "&checkJS=true","Drukowanie","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=yes, scrollbars=yes, copyhistory=no, width=520, height=800, top=0, left=0");
  2585.     window2.focus();
  2586.     setTimeout('window2.print()', 16000);
  2587.     setTimeout('window2.close()',30000);
  2588. }
  2589.  
  2590. function drukOknoWykaz(sciezka){
  2591.     window2=open("/irez/jsp/" + sciezka + "&checkJS=true","Drukowanie","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=yes, copyhistory=no, width=600, height=750, top=0, left=0");
  2592.     window2.focus();
  2593.     setTimeout('window2.print()', 4000);
  2594.     setTimeout('window2.close()',20000);
  2595. }
  2596.  
  2597.  
  2598. function otworzOkno(sciezka){    
  2599.     window2=open("/irez/jsp/" + sciezka  + "&checkJS=true","Informacja","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, copyhistory=no, width=520, height=800, top=0, left=0");
  2600.     window2.focus();
  2601.     return;
  2602. }
  2603.  
  2604. function otworzOkno2(sciezka){
  2605.     window2=open("/irez/jsp/" + sciezka  + "&checkJS=true","Informacja","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, copyhistory=no, width=900, height=550, top=0, left=0");
  2606.     window2.focus();
  2607.     return;
  2608. }
  2609.  
  2610. function otworzOkno3(sciezka, szerokosc, wysokosc){
  2611.     if (parseInt(szerokosc)===0)
  2612.     {
  2613.         szerokosc=700;
  2614.     }
  2615.    
  2616.     if (parseInt(wysokosc)===0)
  2617.     {
  2618.         wysokosc=800;
  2619.     }
  2620.     window2=open("/irez/jsp/" + sciezka  + "&checkJS=true","Informacja","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=yes, copyhistory=no, width="+szerokosc+", height="+wysokosc+", top=0, left=0");
  2621.     window2.focus();
  2622.     return;
  2623. }
  2624.  
  2625. function otworzOkno4(sciezka){
  2626.     window2=open("/irez/jsp/" + sciezka  + "&checkJS=true","Informacja","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, copyhistory=no, width=300, height=400, top=0, left=0");
  2627.     window2.focus();
  2628.     return;
  2629. }
  2630.  
  2631. function drukRpos(sciezka){
  2632.     window2=open("/irez/jsp/" + sciezka + "&checkJS=true","Drukowanie","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, copyhistory=no, width=640, height=900, top=0, left=0");
  2633.     window2.focus();
  2634.     setTimeout('window2.print()', 4000);
  2635.     setTimeout('window2.close()',30000);
  2636. }
  2637.  
  2638.  
  2639. function drukmg21(sciezka){
  2640.     window3=open("/irez/jsp/" + sciezka + "&checkJS=true","Drukowanie","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, copyhistory=no, width=660, height=450, top=0, left=0");
  2641.     window3.focus();
  2642.     setTimeout('window3.print()',10000);
  2643.     setTimeout('window3.close()',30000);
  2644. }
  2645.  
  2646. function drukReg(sciezka){
  2647.     window2=open("/irez/jsp/" + sciezka + "&checkJS=true","Drukowanie","toolbar=no, menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=yes, copyhistory=no, width=600, height=600, top=0, left=0");
  2648.     window2.focus();
  2649.     setTimeout('window2.print()', 4000);
  2650.    
  2651. }
  2652.  
  2653.  
  2654.  
  2655. function sprdata(dzien, miesiac, rok) {
  2656. miesiac--;
  2657.  
  2658. d = new Date(rok,miesiac,dzien, 23, 59, 0);
  2659.  
  2660.     if (dzien==d.getDate() && miesiac==d.getMonth() && rok==d.getFullYear())
  2661.         return true;
  2662.     else
  2663.         return false
  2664. }
  2665.  
  2666. function nazwa_Firmy2(inf)
  2667. {
  2668. var OK = 1;
  2669. var NO = 0;
  2670.    
  2671.     if(tylko_litery_i_cyfry(document.daneKlienta.nazwa_firmy.value)==0)
  2672.     {
  2673.         alert(inf);
  2674.         document.daneKlienta.nazwa_firmy.focus();
  2675.         return NO;
  2676.     }
  2677.     return OK;
  2678. }
  2679.  
  2680. function nazwa_Firmy(inf){
  2681. var OK = 1;
  2682. var NO = 0;
  2683.    
  2684.     if(tylko_litery(document.daneFirmy.nazwa.value)==0){
  2685.         alert(inf);
  2686.         document.daneFirmy.nazwa.focus();
  2687.         return NO;
  2688.     }
  2689.     return OK;
  2690. }
  2691. function nazwa_COK(inf){
  2692. var OK = 1;
  2693. var NO = 0;
  2694.    
  2695.     if(tylko_litery(document.daneCOK.nazwa.value)==0){
  2696.         alert(inf);
  2697.         document.daneCOK.nazwa.focus();
  2698.         return NO;
  2699.     }
  2700.     return OK;
  2701. }
  2702.  
  2703. function nazwa_KFirmy(inf){
  2704. var OK = 1;
  2705. var NO = 0;
  2706.    
  2707.     if(tylko_litery(document.daneFirmy.nazwaKrotka.value)==0){
  2708.         alert(inf);
  2709.         document.daneFirmy.nazwaKrotka.focus();
  2710.         return NO;
  2711.     }
  2712.     return OK;
  2713. }
  2714.  
  2715.  
  2716. function nip_Firmy(inf){
  2717. var NO = 0;
  2718. var OK = 1;
  2719.  
  2720.     if(nrnip() == 0){
  2721.         alert(inf);
  2722.         document.daneFirmy.nip.focus();
  2723.         return NO;
  2724.     }
  2725.  
  2726.     return OK;
  2727. }
  2728.  
  2729. function regon_Firmy(inf){
  2730. var NO = 0;
  2731. var OK = 1;
  2732.  
  2733.     if(tylko_cyfra(document.daneFirmy.regon.value) == 0){
  2734.         alert(inf);
  2735.         document.daneFirmy.regon.focus();
  2736.         return NO;
  2737.     }
  2738.  
  2739.     return OK;
  2740. }
  2741.  
  2742. function  kodpocztowy_Firmy(inf) {
  2743. var OK = 1;
  2744. var NO = 0;
  2745.  
  2746.     if(document.daneFirmy.kodpocztowy.value == 0)
  2747.         return OK;
  2748.  
  2749.     if (kodpocz_OK(document.daneFirmy.kodpocztowy.value) == 0){
  2750.         alert(inf);
  2751.         document.daneFirmy.kodpocztowy.focus();
  2752.         return NO;
  2753.     }
  2754.    
  2755.     return OK;
  2756. }
  2757. function  kodpocztowy_COK(inf) {
  2758. var OK = 1;
  2759. var NO = 0;
  2760.  
  2761.     if(document.daneCOK.kodpocztowy.value == 0)
  2762.         return OK;
  2763.  
  2764.     if (kodpocz_OK(document.daneCOK.kodpocztowy.value) == 0){
  2765.         alert(inf);
  2766.         document.daneCOK.kodpocztowy.focus();
  2767.         return NO;
  2768.     }
  2769.    
  2770.     return OK;
  2771. }
  2772.  
  2773. function  kodpocztowy_FirmyKlient(inf, kraj) {
  2774. var OK = 1;
  2775. var NO = 0;
  2776.  
  2777.     if(document.daneKlienta.kodpocztowyfirmy.value == 0)
  2778.         return OK;
  2779.         if (kraj> 0)
  2780.             {
  2781.     if (kodpocz_OK(document.daneKlienta.kodpocztowyfirmy.value) == 0){
  2782.         alert(inf);
  2783.         document.daneKlienta.kodpocztowyfirmy.focus();
  2784.         return NO;
  2785.     }
  2786.             }
  2787.         else
  2788.             {
  2789.     if (kodpocz_OK_pl(document.daneKlienta.kodpocztowyfirmy.value) == 0){
  2790.         alert(inf);
  2791.         document.daneKlienta.kodpocztowyfirmy.focus();
  2792.         return NO;
  2793.  
  2794.             }
  2795.             }
  2796.     return OK;
  2797. }
  2798.  
  2799. function  miasto_Firmy(inf) {
  2800. var OK = 1;
  2801. var NO = 0;
  2802.  
  2803.     if (tylko_litery(document.daneFirmy.miasto.value)== 0){
  2804.         alert(inf);
  2805.         document.daneFirmy.miasto.focus();
  2806.         return NO;
  2807.     }
  2808.    
  2809.     return OK;
  2810. }
  2811. function  miasto_COK(inf) {
  2812. var OK = 1;
  2813. var NO = 0;
  2814.  
  2815.     if (tylko_litery(document.daneCOK.miasto.value)== 0){
  2816.         alert(inf);
  2817.         document.daneCOK.miasto.focus();
  2818.         return NO;
  2819.     }
  2820.    
  2821.     return OK;
  2822. }
  2823.  
  2824. function  miasto_FirmyKlient(inf) {
  2825. var OK = 1;
  2826. var NO = 0;
  2827.  
  2828.     if (tylko_litery(document.daneKlienta.miastofirmy.value)== 0){
  2829.         alert(inf);
  2830.         document.daneKlienta.miastofirmy.focus();
  2831.         return NO;
  2832.     }
  2833.    
  2834.     return OK;
  2835. }
  2836.  
  2837.  
  2838. function telefon_COK(inf) {
  2839. var OK = 1;
  2840. var NO = 0;
  2841. var dlugosc = 0;
  2842.    
  2843.     dlugosc = document.daneCOK.tel.length;
  2844.    
  2845.     if(dlugosc == 0)
  2846.         return OK;
  2847.  
  2848.     if (telfax_OK(document.daneCOK.tel.value) == 0){
  2849.     alert(inf);
  2850.     document.daneCOK.tel.focus();
  2851.     return NO;
  2852.     }
  2853.    
  2854.     return OK;
  2855. }
  2856. function telefon_Firmy(inf) {
  2857. var OK = 1;
  2858. var NO = 0;
  2859. var dlugosc = 0;
  2860.    
  2861.     dlugosc = document.daneFirmy.tel.length;
  2862.    
  2863.     if(dlugosc == 0)
  2864.         return OK;
  2865.  
  2866.     if (telfax_OK(document.daneFirmy.tel.value) == 0){
  2867.     alert(inf);
  2868.     document.daneFirmy.tel.focus();
  2869.     return NO;
  2870.     }
  2871.    
  2872.     return OK;
  2873. }
  2874.  
  2875. function fax_Firmy(inf) {
  2876. var OK = 1;
  2877. var NO = 0;
  2878. var dlugosc = 0;
  2879.    
  2880.     dlugosc = document.daneFirmy.fax.length;
  2881.  
  2882.     if(dlugosc == 0)
  2883.     return OK;
  2884.  
  2885.     if (telfax_OK(document.daneFirmy.fax.value) == 0){
  2886.     alert(inf);
  2887.     document.daneFirmy.fax.focus();
  2888.     return NO;
  2889.     }
  2890.    
  2891.     return OK;
  2892. }
  2893.  
  2894. function email_Firmy(inf){
  2895. var OK = 1;
  2896. var NO = 0;
  2897. var dlugosc = 0;
  2898.    
  2899.     dlugosc = document.daneFirmy.email.value.length;
  2900.    
  2901.     if(dlugosc == 0)
  2902.     return OK;
  2903.  
  2904.     if(poprawny_email(document.daneFirmy.email.value)== 0){
  2905.     alert(inf);
  2906.     document.daneFirmy.email.focus();
  2907.     return NO;
  2908.     }
  2909.    
  2910.     return OK;
  2911. }
  2912.  
  2913. function daneOK_Firmy(nazwafull, nipf, regf, adresf, kodpocztf, miastof, nazwakrotkaf, nrumowyf, dataodf, datadof, poprpola, inf1, infod, infdo, infLista, infHasla){
  2914. var NO = 0;
  2915. var OK = 1;
  2916. var pola = "";
  2917. var koniec = false;
  2918.  
  2919.     if(document.daneFirmy.nazwa.value == "" || tylko_litery(document.daneFirmy.nazwa.value)==0){
  2920.         pola+=" - " + nazwafull + "\n";
  2921.     koniec=true;
  2922.     }
  2923.  
  2924.     if(document.daneFirmy.nip.value == ""){ // || nrnip() == 0){
  2925.     pola+=" - " + nipf + "\n";
  2926.     koniec=true;
  2927.     }
  2928.  
  2929.     if(document.daneFirmy.regon.value == 0 || tylko_cyfra(document.daneFirmy.regon.value) == 0){
  2930.     pola+=" - " + regf + "\n";
  2931.     koniec=true;
  2932.     }
  2933.  
  2934.     if(document.daneFirmy.ulica.value == ""){
  2935.     pola+=" - " + adresf + "\n";
  2936.     koniec=true;
  2937.     }
  2938.  
  2939.     if(document.daneFirmy.kodpocztowy.value == "" || kodpocz_OK(document.daneFirmy.kodpocztowy.value)== 0){
  2940.     pola+=" - " + kodpocztf + "\n";
  2941.     koniec=true;
  2942.     }
  2943.  
  2944.     if(document.daneFirmy.miasto.value == "" || tylko_litery(document.daneFirmy.miasto.value)== 0){
  2945.     pola+=" - " + miastof + "\n";
  2946.     koniec=true;
  2947.     }
  2948.  
  2949.     if(document.daneFirmy.nazwaKrotka.value == "" || tylko_litery(document.daneFirmy.nazwaKrotka.value)==0 ){
  2950.     pola+=" - " + nazwakrotkaf + "\n";
  2951.     koniec=true;
  2952.     }
  2953.  
  2954.     if(document.daneFirmy.nrumowy.value == ""){
  2955.     pola+=" - " + nrumowyf + "\n";
  2956.     koniec=true;
  2957.     }
  2958.  
  2959.    if(document.daneFirmy.dataod.value == ""){
  2960.     pola+=" - " + dataodf + "\n";
  2961.     koniec=true;
  2962.     }
  2963.     else{
  2964.         if(sprdataod_Firma(inf1, infod) ==false)
  2965.             koniec = true;
  2966.     }
  2967.  
  2968.    if(document.daneFirmy.datado.value == ""){
  2969.         }
  2970.     else{
  2971.         if(sprdatado_Firma(inf1, infdo) ==false)
  2972.             koniec = true;
  2973.     }
  2974.  
  2975.    if(document.daneFirmy.listyHasel.value == "" || document.daneFirmy.listyHasel.value >5){
  2976.     pola+=" - " + infLista + "\n";
  2977.     koniec=true;
  2978.     }
  2979.     else{
  2980.         if(sprListaHasel_Firma(infLista) ==false)
  2981.             koniec = true;
  2982.     }
  2983.  
  2984.    if(document.daneFirmy.hasla.value == "" || document.daneFirmy.hasla.value >50){
  2985.     pola+=" - " + infHasla + "\n";
  2986.     koniec=true;
  2987.     }
  2988.     else{
  2989.         if(sprHasla_Firma(infHasla) ==false)
  2990.             koniec = true;
  2991.     }
  2992.  
  2993.     if(!koniec){
  2994.         document.daneFirmy.submit();
  2995.     }
  2996.     else {
  2997.         if(pola != "")
  2998.             alert(poprpola + ":\n" + pola);
  2999.     }
  3000.    
  3001.     return OK;
  3002. }
  3003.  
  3004.  
  3005.  
  3006. function tylko_cyfra_zwrot(){
  3007. var OK = 1;
  3008. var NO = 0;
  3009. var dlugosc = 0;
  3010. var koniec = false;
  3011.  
  3012. dlugosc = document.zwrotBiletow.nrBiletu.value.length;
  3013.     if ( isNaN(document.zwrotBiletow.nrBiletu.value) != 0 ){
  3014.                 koniec = true;
  3015.         }
  3016.         if (dlugosc == 0 ){
  3017.                 koniec = true;
  3018.         }          
  3019.  if(!koniec){
  3020.         document.zwrotBiletow.submit();
  3021.         return OK;
  3022.         }
  3023.     else {
  3024.         alert("Podaj numer biletu");
  3025.         return NO;
  3026.     }
  3027. }
  3028.  
  3029. function kompletnosc_danych_zwrot(){
  3030. var pola = "";
  3031. var koniec = false;
  3032.  
  3033.     if(dlugosc_pol(document.zwrotBiletow.zwrotBilet.length) == 0 || cena_OK(document.zwrotBiletow.zwrotBilet.value) == 0){
  3034.        
  3035.     pola+=" -  Kwota za bilet \n";
  3036.     koniec=true;
  3037.     }
  3038.  
  3039.     if (document.zwrotBiletow.powodBilet.value == "" || dlugosc_pol(document.zwrotBiletow.powodBilet.length) == 0) {
  3040.         if (document.zwrotBiletow.przyczynaZwrotuBilet.value === '4') {
  3041.             pola += " -  Powód zwrotu biletu\n";
  3042.             koniec = true;
  3043.         }
  3044.     }
  3045.    
  3046.     if(dlugosc_pol(document.zwrotBiletow.zwrotMiejscowka.length) == 0 || cena_OK(document.zwrotBiletow.zwrotMiejscowka.value) == 0){
  3047.         pola+=" -  Kwota za rezerwację\n";
  3048.         koniec=true;
  3049.     }
  3050.  
  3051.     if(document.zwrotBiletow.powodMiejscowka.value=="" || dlugosc_pol(document.zwrotBiletow.powodMiejscowka.length) == 0){
  3052.         if (document.zwrotBiletow.przyczynaZwrotuRez.value === '4') {
  3053.             pola+=" -  Powód zwrotu rezerwacji\n";
  3054.             koniec=true;
  3055.         }
  3056.     }
  3057.  
  3058.     if(dlugosc_pol(document.zwrotBiletow.zwrotBilet.length) > 0 && cena_not_zero(document.zwrotBiletow.zwrotBilet.value) !== 0){
  3059.         if (typeof document.zwrotBiletow.nrReklamacjiBil !== 'undefined'){
  3060.             if (document.zwrotBiletow.nrReklamacjiBil.value === "" || dlugosc_pol(document.zwrotBiletow.nrReklamacjiBil.length) === 0) {
  3061.                 if (document.zwrotBiletow.przyczynaZwrotuBilet.value === '0') {
  3062.                     pola += " -  Numer reklamacji (bilet)\n";
  3063.                     koniec = true;
  3064.                 }
  3065.             }
  3066.         }
  3067.     }
  3068.  
  3069.     if(dlugosc_pol(document.zwrotBiletow.zwrotMiejscowka.length) > 0 && cena_not_zero(document.zwrotBiletow.zwrotMiejscowka.value) !== 0){
  3070.         if (typeof document.zwrotBiletow.nrReklamacjiRez !== 'undefined'){
  3071.             if (document.zwrotBiletow.nrReklamacjiRez.value === "" || dlugosc_pol(document.zwrotBiletow.nrReklamacjiRez.length) === 0) {
  3072.                 if (document.zwrotBiletow.przyczynaZwrotuRez.value === '0') {
  3073.                     pola += " -  Numer reklamacji (rezerwacja)\n";
  3074.                     koniec = true;
  3075.                 }
  3076.             }
  3077.         }
  3078.     }
  3079.  
  3080.     if(!koniec){
  3081.         document.zwrotBiletow.submit();
  3082.     }
  3083.    
  3084.     else {
  3085.     if(pola != "")
  3086.             alert("Popraw lub wypełnij pola:\n" + pola);
  3087.     }
  3088. }
  3089.  
  3090. function kompletnosc_danych_blokada_zwrotu(){
  3091. var pola = "";
  3092. var koniec = false;
  3093.  
  3094.     if(dlugosc_pol(document.blokadaZwrotuBiletow.kwotaZwrotu.length) == 0 || cena_OK(document.blokadaZwrotuBiletow.kwotaZwrotu.value) == 0){
  3095.  
  3096.     pola+=" -  Kwota zwrotu \n";
  3097.     koniec=true;
  3098.     }
  3099.  
  3100.     if(document.blokadaZwrotuBiletow.powodBlokady.value=="" || dlugosc_pol(document.blokadaZwrotuBiletow.powodBlokady.length) == 0){
  3101.     pola+=" -  Przyczyna blokady zwrotu biletu\n";
  3102.     koniec=true;
  3103.     }
  3104.  
  3105.      if(!koniec){
  3106.         document.blokadaZwrotuBiletow.submit();
  3107.     }
  3108.  
  3109.     else {
  3110.     if(pola != "")
  3111.             alert("Popraw lub wypełnij pola:\n" + pola);
  3112.     }
  3113. }
  3114.  
  3115. function  cena_OK(kod) {
  3116. var OK = 1;
  3117. var NO = 0;
  3118.    
  3119.     if (kod.match(/^\d\d,\d\d$/) || kod.match(/^\d,\d\d$/) || kod.match(/^\d\d\d,\d\d$/) || kod.match(/^\d\d\d\d,\d\d$/))
  3120.         return OK;
  3121.  
  3122.    else
  3123.    return NO;
  3124. }
  3125.  
  3126. function  cena_not_zero(kod) {
  3127. var OK = 1;
  3128. var NO = 0;
  3129.    
  3130.     if ((kod.match(/^\d\d,\d\d$/) || kod.match(/^\d,\d\d$/) || kod.match(/^\d\d\d,\d\d$/) || kod.match(/^\d\d\d\d,\d\d$/)) && kod!=='0,00' && kod!=='00,00' && kod!=='000,00' && kod!=='0000,00' )
  3131.         return OK;
  3132.  
  3133.    else
  3134.    return NO;
  3135. }
  3136.  
  3137. function kompletnosc_danych_filtr(tekst){
  3138. var pola = "";
  3139. var koniec = false;
  3140.         if(document.listaBiletowSzczegoly.nrPociagu.value.length != 0){
  3141.             if(tylko_cyfra(document.listaBiletowSzczegoly.nrPociagu.value) == 0){
  3142.                 alert(tekst);
  3143.                 document.listaBiletowSzczegoly.nrPociagu.focus();
  3144.                 koniec = true;
  3145.             }
  3146.         }
  3147.  
  3148.     if(!koniec)
  3149.             document.listaBiletowSzczegoly.submit();
  3150. }
  3151.  
  3152.  
  3153.  
  3154. function nrpoc_OK(inf1, inf2){
  3155. var koniec = true;
  3156.  
  3157.     if(document.data_pociag.nrpoc.value == 0 || document.data_pociag.nrpoc.value == ""){
  3158.         alert(inf1);
  3159.         document.data_pociag.nrpoc.focus();
  3160.         koniec = false;
  3161.     }
  3162.  
  3163.     if(document.data_pociag.nrpoc.length != 0){
  3164.        if(tylko_cyfra(document.data_pociag.nrpoc.value)==0){
  3165.             alert(inf2);
  3166.             document.data_pociag.nrpoc.focus();
  3167.            koniec = false;
  3168.         }
  3169.     }
  3170.  
  3171.     if(koniec)
  3172.         document.data_pociag.submit();
  3173. }
  3174.  
  3175. function nrbil_OK(inf1, inf2){
  3176. var koniec = true;
  3177.  
  3178.     if(document.kontrolaBiletu.idBilet.value == 0 || document.kontrolaBiletu.idBilet.value == ""){
  3179.         alert(inf1);
  3180.         document.kontrolaBiletu.idBilet.focus();
  3181.         koniec = false;
  3182.     }
  3183.  
  3184.     if(document.kontrolaBiletu.idBilet.length != 0){
  3185.        if(tylko_cyfra(document.kontrolaBiletu.idBilet.value)==0){
  3186.             alert(inf2);
  3187.             document.kontrolaBiletu.idBilet.focus();
  3188.            koniec = false;
  3189.         }
  3190.     }
  3191.  
  3192.     if(koniec)
  3193.         document.kontrolaBiletu.submit();
  3194. }
  3195.  
  3196. function sprdatanew(inf) {
  3197. var dzien = document.data_pociag.dzodj.value;
  3198. var miesiac = document.data_pociag.mcodj.value;
  3199. var rok = document.data_pociag.rokodj.value;
  3200. var pierwszy = 1;
  3201. miesiac--;
  3202.  
  3203.     d = new Date(rok,miesiac,dzien, 23, 59, 0);
  3204.    
  3205.     if (dzien==d.getDate() && miesiac==d.getMonth() && rok==d.getFullYear())
  3206.     {
  3207.         return true;
  3208.     }
  3209.     else
  3210.     {
  3211.         alert(inf);
  3212.         document.data_pociag.dzodj.value = pierwszy;
  3213.         return false;
  3214.     }
  3215. }
  3216.  
  3217.  
  3218. function  data_OK(data) {
  3219. var OK = 1;
  3220. var NO = 0;
  3221.    
  3222.     if (!data.match(/^\d\d\d\d-\d\d-\d\d$/))
  3223.         return NO;
  3224.  
  3225.     return OK;
  3226. }
  3227.  
  3228. function sprdataod_Firma(inf1, inf2) {
  3229. var rok = document.daneFirmy.dataod.value.substring(0,4);
  3230. var miesiac = document.daneFirmy.dataod.value.substring(5,7);
  3231. var dzien = document.daneFirmy.dataod.value.substring(8);
  3232. miesiac--;
  3233.  
  3234. if(document.daneFirmy.dataod.value.length == 0)
  3235.     return true;
  3236.  
  3237. if (data_OK(document.daneFirmy.dataod.value) == 0)
  3238.     {
  3239.         alert(inf1);
  3240.         document.daneFirmy.dataod.focus();
  3241.         return false;
  3242.     }
  3243.     d = new Date(rok,miesiac,dzien, 23, 59, 0);
  3244.     if (dzien==d.getDate() && miesiac==d.getMonth() && rok==d.getFullYear())
  3245.     {
  3246.         return true;
  3247.     }
  3248.     else
  3249.     {
  3250.         alert(inf2);
  3251.         document.daneFirmy.dataod.focus();
  3252.          return false;
  3253.     }
  3254. }
  3255. function sprdataod_COK(inf1, inf2) {
  3256. var rok = document.daneCOK.dataod.value.substring(0,4);
  3257. var miesiac = document.daneCOK.dataod.value.substring(5,7);
  3258. var dzien = document.daneCOK.dataod.value.substring(8);
  3259. miesiac--;
  3260.  
  3261. if(document.daneCOK.dataod.value.length == 0)
  3262.     return true;
  3263.  
  3264. if (data_OK(document.daneCOK.dataod.value) == 0)
  3265.     {
  3266.         alert(inf1);
  3267.         document.daneCOK.dataod.focus();
  3268.         return false;
  3269.     }
  3270.     d = new Date(rok,miesiac,dzien, 23, 59, 0);
  3271.     if (dzien==d.getDate() && miesiac==d.getMonth() && rok==d.getFullYear())
  3272.     {
  3273.         return true;
  3274.     }
  3275.     else
  3276.     {
  3277.         alert(inf2);
  3278.         document.daneCOK.dataod.focus();
  3279.          return false;
  3280.     }
  3281. }
  3282.  
  3283. function sprListaHasel_Firma(inf) {
  3284. var OK = 1;
  3285. var NO = 0;
  3286. var dlugosc = 0;
  3287. var koniec = false;
  3288.  
  3289. dlugosc = document.daneFirmy.listyHasel.value.length;
  3290.     if ( isNaN(document.daneFirmy.listyHasel.value) != 0 ){
  3291.                 alert(inf);
  3292.                 koniec = true;
  3293.         }
  3294.         if (dlugosc == 0 ){
  3295.                 koniec = true;
  3296.         }          
  3297.         if(!koniec){
  3298.                 return OK;
  3299.         }
  3300.         else {
  3301.             document.daneFirmy.listyHasel.focus();
  3302.             return NO;
  3303.     }
  3304. }
  3305.  
  3306. function sprHasla_Firma(inf) {
  3307. var OK = 1;
  3308. var NO = 0;
  3309. var dlugosc = 0;
  3310. var koniec = false;
  3311.  
  3312. dlugosc = document.daneFirmy.hasla.value.length;
  3313.     if ( isNaN(document.daneFirmy.hasla.value) != 0 ){
  3314.                 alert(inf);
  3315.                 koniec = true;
  3316.         }
  3317.         if (dlugosc == 0 ){
  3318.                 koniec = true;
  3319.         }          
  3320.         if(!koniec){
  3321.                 return OK;
  3322.         }
  3323.         else {
  3324.             document.daneFirmy.hasla.focus();
  3325.             return NO;
  3326.     }
  3327. }
  3328.  
  3329. function sprdatado_Firma(inf1, inf2) {
  3330. var rok = document.daneFirmy.datado.value.substring(0,4);
  3331. var miesiac = document.daneFirmy.datado.value.substring(5,7);
  3332. var dzien = document.daneFirmy.datado.value.substring(8);
  3333. miesiac--;
  3334.  
  3335. if(document.daneFirmy.datado.value.length == 0)
  3336.     return true;
  3337.  
  3338. if (data_OK(document.daneFirmy.datado.value) == 0)
  3339.     {
  3340.        alert(inf1);
  3341.         document.daneFirmy.datado.focus();
  3342.         return false;
  3343.  
  3344. }
  3345.     d = new Date(rok,miesiac,dzien, 23, 59, 0);
  3346.    
  3347.     if (dzien==d.getDate() && miesiac==d.getMonth() && rok==d.getFullYear())
  3348.     {
  3349.         return true;
  3350.     }
  3351.     else
  3352.     {
  3353.         alert(inf2);
  3354.         document.daneFirmy.datado.focus();
  3355.         return false;
  3356.     }
  3357. }
  3358.  
  3359.  
  3360.  
  3361.  
  3362. function kompletnosc_danych_wykaz(){
  3363. var pola = "";
  3364. var koniec = false;
  3365. var koniec2 = false;
  3366. var error = "";
  3367. error = "Popraw pola:\n";
  3368.        
  3369.         if(document.wykazPrzesylek.nrOd.value.length > 0){
  3370.             if(tylko_cyfra(document.wykazPrzesylek.nrOd.value) == 0){
  3371.                 pola +=" - nr faktury od\n";
  3372.                 document.wykazPrzesylek.nrOd.focus();
  3373.                 koniec = true;
  3374.             }
  3375.         }
  3376.  
  3377.         if(document.wykazPrzesylek.nrOd.value.length == 0){
  3378.                 pola +=" - nr faktury od\n";
  3379.                 document.wykazPrzesylek.nrOd.focus();
  3380.                 koniec = true;
  3381.         }
  3382.        if(document.wykazPrzesylek.rok.value.length == 0){
  3383.                 pola +=" - rok\n";
  3384.                 document.wykazPrzesylek.rok.focus();
  3385.                 koniec = true;
  3386.         }
  3387.  
  3388.  
  3389.         if(document.wykazPrzesylek.nrDo.value.length > 0){
  3390.             if(tylko_cyfra(document.wykazPrzesylek.nrDo.value) == 0){
  3391.                 pola +=" - nr faktury do\n";
  3392.                 document.wykazPrzesylek.nrDo.focus();
  3393.                 koniec = true;
  3394.             }
  3395.         }
  3396.        if(document.wykazPrzesylek.rok.value.length > 0){
  3397.             if(tylko_cyfra(document.wykazPrzesylek.rok.value) == 0){
  3398.                 pola +=" - rok\n";
  3399.                 document.wykazPrzesylek.rok.focus();
  3400.                 koniec = true;
  3401.             }
  3402.         }
  3403.  
  3404.         if(document.wykazPrzesylek.nrDo.value.length == 0){
  3405.                 pola +=" - nr faktury do\n";
  3406.                 document.wykazPrzesylek.nrDo.focus();
  3407.                 koniec = true;
  3408.         }
  3409.  
  3410.     if(!koniec)
  3411.         document.wykazPrzesylek.submit();
  3412.     else
  3413.         alert(error + pola);
  3414. }
  3415.  
  3416.  
  3417. function kompletnosc_danych_faktura(){
  3418. var pola = "";
  3419. var koniec = false;
  3420. var koniec2 = false;
  3421. var error = "";
  3422. error = "Popraw pola:\n";
  3423.         if(document.faktury.rok.value.length != 0){
  3424.             if(tylko_cyfra(document.faktury.rok.value) == 0){
  3425.                 pola= " -rok \n";
  3426.                 document.faktury.rok.focus();
  3427.                 koniec = true;
  3428.             }
  3429.             else if (document.faktury.rok.value < 2005){
  3430.                 pola= " - rok \n";
  3431.                 document.faktury.rok.focus();
  3432.                 koniec = true;
  3433.             }      
  3434.         }
  3435.         else{
  3436.             pola= " - rok \n";
  3437.             document.faktury.rok.focus();
  3438.             koniec = true;
  3439.         }
  3440.  
  3441.         if(document.faktury.nrOd.value.length > 0){
  3442.             if(tylko_cyfra(document.faktury.nrOd.value) == 0){
  3443.                 pola +=" - nr faktury od\n";
  3444.                 document.faktury.nrOd.focus();
  3445.                 koniec = true;
  3446.             }
  3447.         }
  3448.  
  3449.    
  3450.         if(document.faktury.nrDo.value.length > 0){
  3451.             if(tylko_cyfra(document.faktury.nrDo.value) == 0){
  3452.                 pola +=" - nr faktury do\n";
  3453.                 document.faktury.nrDo.focus();
  3454.                 koniec = true;
  3455.             }
  3456.         }
  3457.  
  3458.         if(document.faktury.nrBil.value.length > 0){
  3459.             if(tylko_cyfra(document.faktury.nrBil.value) == 0){
  3460.                 pola +=" - nr transakcji\n";
  3461.                 document.faktury.nrBil.focus();
  3462.                 koniec = true;
  3463.             }
  3464.         }
  3465.  
  3466.         if((document.faktury.nrDo.value.length > 0 || document.faktury.nrOd.value.length > 0) && document.faktury.nrBil.value.length > 0){
  3467.             document.faktury.nrOd.focus();
  3468.             koniec2 = true;
  3469.         }
  3470.         if(document.faktury.nrDo.value.length == 0 && document.faktury.nrOd.value.length == 0 && document.faktury.nrBil.value.length == 0){
  3471.             pola +=" - nr faktury od\n - nr faktury do\n - nr transakcji\n";
  3472.             document.faktury.nrOd.focus();
  3473.             koniec = true;
  3474.         }
  3475.        
  3476.         if((document.faktury.nrDo.value.length == 0 && document.faktury.nrOd.value.length > 0) || (document.faktury.nrDo.value.length > 0 && document.faktury.nrOd.value.length == 0)){
  3477.             pola +=" - nr faktury \n";
  3478.             koniec = true;
  3479.         }
  3480.  
  3481.  
  3482.     if(!koniec && !koniec2)
  3483.         document.faktury.submit();
  3484.     else if (koniec && !koniec2)
  3485.         alert(error + pola);
  3486.     else if (!koniec && koniec2)
  3487.         alert("Podaj numery faktur albo numer transakcji\n");
  3488.     else if (koniec && koniec2)
  3489.         alert("Podaj numery faktur albo numer transakcji\n");
  3490. }
  3491.  
  3492.  
  3493. function setAnotherDay(newAnotherDay) {
  3494.     var aDay = newAnotherDay;
  3495.     document.anotherDayForm.anotherday.value = aDay;
  3496.     document.anotherDayForm.submit();
  3497. }
  3498.  
  3499.  
  3500.  
  3501. function redirect(x,dowolny,okno,srodek,korytarz,palacy,niepalacy){
  3502.     var group=new Array(5);
  3503.     for (i=0; i<5; i++){
  3504.         group[i]=new Array();
  3505.     }
  3506.  
  3507.     group[0][0]=new Option(dowolny,"0");
  3508.     group[0][1]=new Option(okno,"1");
  3509.     group[0][2]=new Option(srodek,"2");
  3510.     group[0][3]=new Option(korytarz,"3");
  3511.  
  3512.     group[1][0]=new Option(dowolny,"0");
  3513.     group[1][1]=new Option(okno,"1");
  3514.     group[1][2]=new Option(srodek,"2");
  3515.     group[1][3]=new Option(korytarz,"3");
  3516.  
  3517.     group[2][0]=new Option(dowolny,"0");
  3518.     group[2][1]=new Option(okno,"1");
  3519.     group[2][2]=new Option(srodek,"2");
  3520.  
  3521.     group[3][0]=new Option(dowolny,"0");
  3522.     group[3][1]=new Option(okno,"1");
  3523.     group[3][2]=new Option(srodek,"2");
  3524.  
  3525.     group[4][0]=new Option(dowolny,"0");
  3526.  
  3527.  
  3528.     var temp=document.rkf.usytuowanie;
  3529.  
  3530.     for (m=temp.options.length-1;m>0;m--){
  3531.         temp.options[m]=null;
  3532.     }
  3533.  
  3534.     if (x==5)
  3535.         x=3;
  3536.     if (x==6)
  3537.         x=4;
  3538.  
  3539.     for (i=0;i<group[x].length;i++){
  3540.         temp.options[i]=new Option(group[x][i].text,group[x][i].value);
  3541.     }
  3542.     temp.options[0].selected=true;
  3543. }
  3544.  
  3545.  
  3546. function redirect2(x,caly,meski,damski,dowolne,gora,srodek,dol){
  3547.  
  3548.     var group=new Array(3)
  3549.     var groupUsyt=new Array(3)
  3550.     for (i=0; i<3; i++){
  3551.         group[i]=new Array()
  3552.         groupUsyt[i]=new Array()
  3553.     }
  3554. var wagonde = document.getElementById('wagondelux');
  3555.     group[0][0]=new Option(caly,"0")
  3556.  
  3557.     group[1][0]=new Option(caly,"0")
  3558.     group[1][1]=new Option(meski,"1")
  3559.     group[1][2]=new Option(damski,"2")
  3560.  
  3561.     group[2][0]=new Option(caly,"0")
  3562.     group[2][1]=new Option(meski,"1")
  3563.     group[2][2]=new Option(damski,"2")
  3564.  
  3565.      groupUsyt[0][0]=new Option(dowolne,"0")
  3566.  
  3567.     groupUsyt[1][0]=new Option(dowolne,"0")
  3568.     groupUsyt[1][1]=new Option(gora,"1")
  3569.     groupUsyt[1][2]=new Option(dol,"3")
  3570.  
  3571.     groupUsyt[2][0]=new Option(dowolne,"0")
  3572.     groupUsyt[2][1]=new Option(gora,"1")
  3573.     groupUsyt[2][2]=new Option(srodek,"2")
  3574.     groupUsyt[2][3]=new Option(dol,"3")
  3575.  
  3576.     var temp=document.rkf.plec
  3577.     var tempUsyt=document.rkf.usytuowanie
  3578.  
  3579.     for (m=temp.options.length-1;m>0;m--){
  3580.         temp.options[m]=null
  3581.     }
  3582.     for (m=tempUsyt.options.length-1;m>0;m--){
  3583.         tempUsyt.options[m]=null
  3584.     }
  3585.  
  3586.     for (i=0;i<group[x].length;i++){
  3587.         temp.options[i]=new Option(group[x][i].text,group[x][i].value)    
  3588.     }
  3589.     for (i=0;i<groupUsyt[x].length;i++){
  3590.         tempUsyt.options[i]=new Option(groupUsyt[x][i].text,groupUsyt[x][i].value)
  3591.     }
  3592.     temp.options[0].selected=true
  3593.     tempUsyt.options[0].selected=true
  3594. }
  3595.  
  3596.  
  3597. function redirect3(x,dowolne,gora,srodek,dol){
  3598.  
  3599.     var groups=document.rkf.klasa.options.length
  3600.     var group=new Array(groups)
  3601.     for (i=0; i<groups; i++)
  3602.         group[i]=new Array()
  3603.  
  3604.     group[0][0]=new Option(dowolne,"0")
  3605.     group[0][1]=new Option(gora,"1")
  3606.     group[0][2]=new Option(dol,"3")
  3607.  
  3608.     group[1][0]=new Option(dowolne,"0")
  3609.     group[1][1]=new Option(gora,"1")
  3610.     group[1][2]=new Option(srodek,"2")
  3611.     group[1][3]=new Option(dol,"3")
  3612.  
  3613.     group[2][0]=new Option(dowolne,"0")
  3614.     group[2][1]=new Option(gora,"1")
  3615.     group[2][2]=new Option(srodek,"2")
  3616.     group[2][3]=new Option(dol,"3")
  3617.  
  3618.     group[3][0]=new Option(dowolne,"0")
  3619.     group[3][1]=new Option(gora,"1")
  3620.     group[3][2]=new Option(srodek,"2")
  3621.     group[3][3]=new Option(dol,"3")
  3622.  
  3623.     var temp=document.rkf.usytuowanie
  3624.     for (m=temp.options.length-1;m>0;m--)
  3625.         temp.options[m]=null
  3626.     for (i=0;i<group[x].length;i++){
  3627.         temp.options[i]=new Option(group[x][i].text,group[x][i].value)
  3628.     }
  3629.     temp.options[0].selected=true
  3630. }
  3631.  
  3632. function wyborRodzajuUsera(uInd,labuInd,uIndFirma,labuIndFirma,icDysp,labicDysp,icPracSprzed,labicPracSprzed,icPracBKD1,labicPracBKD1,icPracBKD2,labicPracBKD2,icPracBRZ,labicPracBRZ,icHelpdesk,labicHelpdesk, icCOK, labicCOK, icCallCenter,labicCallCenter, icPracMarketing,labicPracmarketing,icPracKoloroweKarty,labIcPracKoloroweKarty,ajentAdmin,labAjentFirmy,ajentPracow,labAjentPracFirmy,pracowKoleiOb,labPracKoleiOb,AdminIC,AdminLok){
  3633.     document.all.firma.style.display=(false)?"block":"none";
  3634.     if (document.daneKlienta.firmaid.value==1 && AdminIC==100){
  3635.         var pozycja;
  3636.         var x, q;
  3637.         for (q = document.daneKlienta.uzytktypkod.options.length; q>=0; q--)
  3638.             document.daneKlienta.uzytktypkod.options[q]=null;
  3639.         pozycja = document.createElement("option");
  3640.         pozycja.setAttribute('value',uInd);
  3641.         var txt = document.createTextNode(labuInd);
  3642.         pozycja.appendChild(txt)
  3643.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3644.         pozycja = document.createElement("option");
  3645.         pozycja.setAttribute('value',uIndFirma);
  3646.         txt = document.createTextNode(labuIndFirma);
  3647.         pozycja.appendChild(txt)
  3648.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3649.     }
  3650.     if (document.daneKlienta.firmaid.value==2 && AdminIC==100){
  3651.         var pozycja;
  3652.         var x, q;
  3653.         for (q = document.daneKlienta.uzytktypkod.options.length; q>=0; q--)
  3654.             document.daneKlienta.uzytktypkod.options[q]=null;
  3655.         pozycja = document.createElement("option");
  3656.         pozycja.setAttribute('value',icDysp);
  3657.         var txt = document.createTextNode(labicDysp);
  3658.         pozycja.appendChild(txt)
  3659.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3660.         pozycja = document.createElement("option");
  3661.         pozycja.setAttribute('value',icPracSprzed);
  3662.         txt = document.createTextNode(labicPracSprzed);
  3663.        pozycja.appendChild(txt)
  3664.       daneKlienta.uzytktypkod.appendChild(pozycja);
  3665.         pozycja = document.createElement("option");
  3666.         pozycja.setAttribute('value',icPracBKD1);
  3667.         txt = document.createTextNode(labicPracBKD1);
  3668.        pozycja.appendChild(txt)
  3669.       daneKlienta.uzytktypkod.appendChild(pozycja);
  3670.         pozycja = document.createElement("option");
  3671.         pozycja.setAttribute('value',icPracBKD2);
  3672.         txt = document.createTextNode(labicPracBKD2);
  3673.        pozycja.appendChild(txt)
  3674.       daneKlienta.uzytktypkod.appendChild(pozycja);
  3675.         pozycja = document.createElement("option");
  3676.         pozycja.setAttribute('value',icPracBRZ);
  3677.         txt = document.createTextNode(labicPracBRZ);
  3678.        pozycja.appendChild(txt)
  3679.        daneKlienta.uzytktypkod.appendChild(pozycja);
  3680.           pozycja = document.createElement("option");
  3681.         pozycja.setAttribute('value',icHelpdesk);
  3682.         txt = document.createTextNode(labicHelpdesk);
  3683.         pozycja.appendChild(txt)
  3684.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3685.         pozycja = document.createElement("option");
  3686.         pozycja.setAttribute('value',icCOK);
  3687.         txt = document.createTextNode(labicCOK);
  3688.         pozycja.appendChild(txt)
  3689.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3690.         pozycja = document.createElement("option");
  3691.         pozycja.setAttribute('value',icCallCenter);
  3692.         txt = document.createTextNode(labicCallCenter);
  3693.         pozycja.appendChild(txt)
  3694.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3695.         pozycja = document.createElement("option");
  3696.         pozycja.setAttribute('value',icPracMarketing);
  3697.         txt = document.createTextNode(labicPracmarketing);
  3698.         pozycja.appendChild(txt)
  3699.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3700.         pozycja = document.createElement("option");
  3701.         pozycja.setAttribute('value',icPracKoloroweKarty);
  3702.         txt = document.createTextNode(labIcPracKoloroweKarty);
  3703.         pozycja.appendChild(txt)
  3704.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3705.         pozycja = document.createElement("option");
  3706.         pozycja.setAttribute('value',pracowKoleiOb);
  3707.         txt = document.createTextNode(labPracKoleiOb);
  3708.         pozycja.appendChild(txt)
  3709.         daneKlienta.uzytktypkod.appendChild(pozycja);
  3710.     }
  3711.     if (daneKlienta.firmaid.value>2){
  3712.        var pozycja;
  3713.        var x, q;
  3714.        for (q = document.daneKlienta.uzytktypkod.options.length; q>=0; q--)
  3715.             document.daneKlienta.uzytktypkod.options[q]=null;
  3716.         if(AdminIC==100){
  3717.             pozycja = document.createElement("option");
  3718.             pozycja.setAttribute('value',ajentAdmin);
  3719.             var txt = document.createTextNode(labAjentFirmy);
  3720.             pozycja.appendChild(txt)
  3721.             daneKlienta.uzytktypkod.appendChild(pozycja);
  3722.         }
  3723.         if(AdminLok==ajentAdmin){
  3724.             pozycja = document.createElement("option");
  3725.             pozycja.setAttribute('value',ajentPracow);
  3726.             var txt = document.createTextNode(labAjentPracFirmy);
  3727.             pozycja.appendChild(txt)
  3728.             daneKlienta.uzytktypkod.appendChild(pozycja);
  3729.         }
  3730.     }
  3731.         if ((document.daneKlienta.uzytktypkod.value>=130 && document.daneKlienta.uzytktypkod.value<200) || document.daneKlienta.uzytktypkod.value==250){
  3732.         document.daneKlienta.adminip.disabled=false;
  3733.           if (document.daneKlienta.uzytktypkod.value==160 ){
  3734.               document.all.DaneCOK.style.display="block";
  3735.               document.all.DanePociagiKolejObca.style.display=(false)?"block":"none";
  3736.         }else if (document.daneKlienta.uzytktypkod.value==250 ){
  3737.               document.all.DanePociagiKolejObca.style.display="block";
  3738.               document.all.DaneCOK.style.display=(false)?"block":"none";
  3739.         }else
  3740.             {
  3741.            document.all.DaneCOK.style.display=(false)?"block":"none";
  3742.             }
  3743.        }
  3744.         else{
  3745.         document.daneKlienta.adminip.value="";
  3746.         document.daneKlienta.adminip.disabled=true;        
  3747.         document.all.DaneCOK.style.display=(false)?"block":"none";
  3748.         document.all.DanePociagiKolejObca.style.display=(false)?"block":"none";
  3749.         }
  3750. }
  3751.  
  3752. function wyborIndFirmaStart(ulica, kod, miasto) {
  3753.     document.all.firma.style.display=(false)?"block":"none";
  3754.     document.all.DaneCOK.style.display="none";
  3755.     document.all.DanePociagiKolejObca.style.display="none";
  3756.     document.daneKlienta.ulica.disabled = false;
  3757.     document.daneKlienta.kodpocztowy.disabled = false;
  3758.     document.daneKlienta.miasto.disabled = false;
  3759.     document.all.Napisy.innerHTML = "<font color=\"red\">*</font>"+ulica+":";
  3760.     document.all.Napisy1.innerHTML = "<font color=\"red\">*</font>"+kod+"/ "+miasto+":";
  3761. }
  3762.  
  3763. function wyborIndFirma(ulica, kod, miasto) {
  3764.     if (daneKlienta.uzytktypkod.value==990) {
  3765.         document.all.firma.style.display=(true)?"block":"none";
  3766.         document.all.DaneCOK.style.display="none";
  3767.         document.all.DanePociagiKolejObca.style.display="none";
  3768.         document.daneKlienta.ulica.disabled = true;
  3769.         document.daneKlienta.kodpocztowy.disabled = true;
  3770.         document.daneKlienta.miasto.disabled = true;
  3771.         document.daneKlienta.ulica.value="";
  3772.         document.daneKlienta.kodpocztowy.value="";
  3773.         document.daneKlienta.miasto.value="";
  3774.         document.all.Napisy.innerHTML = "<font color=\"gray\">"+ulica+":</font>";
  3775.         document.all.Napisy1.innerHTML = "<font color=\"gray\">"+kod+"/ "+miasto+":</font>";
  3776.     }
  3777.     else {
  3778.         document.all.firma.style.display=(false)?"block":"none";
  3779.         document.daneKlienta.ulica.disabled = false;
  3780.         document.daneKlienta.kodpocztowy.disabled = false;
  3781.         document.daneKlienta.miasto.disabled = false;
  3782.         document.all.Napisy.innerHTML = "<font color=\"red\">*</font>"+ulica+":";
  3783.         document.all.Napisy1.innerHTML = "<font color=\"red\">*</font>"+kod+"/ "+miasto+":";
  3784.         if ((document.daneKlienta.uzytktypkod.value>=130 && document.daneKlienta.uzytktypkod.value<200) || document.daneKlienta.uzytktypkod.value==250){            
  3785.         document.daneKlienta.adminip.disabled=false;
  3786.         if (document.daneKlienta.uzytktypkod.value==160 ){
  3787.               document.all.DaneCOK.style.display="block";
  3788.               document.all.DanePociagiKolejObca.style.display="none";
  3789.         }else if (document.daneKlienta.uzytktypkod.value==250 ){
  3790.               document.all.DanePociagiKolejObca.style.display="block";
  3791.               document.all.DaneCOK.style.display="none";
  3792.         }else
  3793.         {
  3794.          document.all.DaneCOK.style.display="none";
  3795.          document.all.DanePociagiKolejObca.style.display="none";
  3796.         }
  3797.          }
  3798.         else{
  3799.         document.daneKlienta.adminip.value="";
  3800.         document.daneKlienta.adminip.disabled=true;        
  3801.         document.all.DaneCOK.style.display="none";
  3802.         document.all.DanePociagiKolejObca.style.display="none";
  3803.         }
  3804.     }
  3805. }
  3806. function jesliToFirmaStart(ulica, kod, miasto) {
  3807.     document.all.DaneFirma.disabled= true;
  3808.     document.all.UWAGA.style.display=(false)?"block":"none";
  3809.         /*
  3810.        if(document.daneKlienta.jesliAdresWysylka.checked == true) {
  3811.          document.all.DaneKorespondencyjneFirmy.disabled=false;
  3812.          document.daneKlienta.firmaWysylka.disabled = false;
  3813.         }
  3814.         */
  3815.     document.all.Napisy.innerHTML = "<font color=\"red\">*</font>"+ulica+":";
  3816.     document.all.Napisy1.innerHTML = "<font color=\"red\">*</font>"+kod+"/ "+miasto+":";
  3817.     document.all.Napisy2.innerHTML = "<font color=\"gray\">"+ulica+":</font>";
  3818.     document.all.Napisy3.innerHTML = "<font color=\"gray\">"+kod+"/ "+miasto+":</font>";
  3819.     if (document.daneKlienta.nazwafirmy.value.length>0)
  3820.     {
  3821.     document.daneKlienta.jesliFirma.checked = true;
  3822.  
  3823.     }
  3824.     jesliToFirma(ulica, kod, miasto);
  3825. }
  3826.  
  3827. function jesliToFirma(ulica, kod, miasto) {
  3828.     if(document.daneKlienta.jesliFirma.checked == true) {
  3829.         document.daneKlienta.ulica.disabled = true;
  3830.         document.daneKlienta.kodpocztowy.disabled = true;
  3831.         document.daneKlienta.miasto.disabled = true;
  3832.         document.daneKlienta.ulica.value="";
  3833.         document.daneKlienta.kodpocztowy.value="";
  3834.         document.daneKlienta.miasto.value="";
  3835.         document.all.Napisy.innerHTML = "<font color=\"gray\">"+ulica+":</font>";
  3836.         document.all.Napisy1.innerHTML = "<font color=\"gray\">"+kod+"/ "+miasto+":</font>";
  3837.         document.all.Napisy2.innerHTML = "<font color=\"red\">*</font>"+ulica+":";
  3838.         document.all.Napisy3.innerHTML = "<font color=\"red\">*</font>"+kod+"/ "+miasto+":";
  3839.         document.all.DaneFirma.disabled=false;
  3840.         document.all.UWAGA.style.display=(true)?"block":"none";
  3841.         document.daneKlienta.nazwafirmy.disabled = false;
  3842.         document.daneKlienta.ulicafirmy.disabled = false;
  3843.         document.daneKlienta.nipfirmy.disabled = false;
  3844.         document.daneKlienta.kodpocztowyfirmy.disabled = false;
  3845.         document.daneKlienta.miastofirmy.disabled = false;
  3846.         /*
  3847.         if(document.daneKlienta.jesliAdresWysylka.checked == true) {
  3848.                 document.all.DaneKorespondencyjneFirmy.disabled=false;
  3849.                 document.daneKlienta.firmaWysylka.disabled = false;
  3850.         }
  3851.         */
  3852.     }
  3853.     else {
  3854.         document.daneKlienta.ulica.disabled = false;
  3855.         document.daneKlienta.kodpocztowy.disabled = false;
  3856.         document.daneKlienta.miasto.disabled = false;
  3857.          document.all.UWAGA.style.display=(false)?"block":"none";
  3858.       document.daneKlienta.nazwafirmy.disabled = true;
  3859.         document.daneKlienta.ulicafirmy.disabled = true;
  3860.         document.daneKlienta.nipfirmy.disabled = true;
  3861.         document.daneKlienta.kodpocztowyfirmy.disabled = true;
  3862.         document.daneKlienta.miastofirmy.disabled = true;
  3863.  
  3864.         document.all.Napisy.innerHTML = "<font color=\"red\">*</font>"+ulica+":";
  3865.         document.all.Napisy1.innerHTML = "<font color=\"red\">*</font>"+kod+"/ "+miasto+":";
  3866.      document.all.Napisy2.innerHTML = "<font color=\"gray\">"+ulica+":</font>";
  3867.     document.all.Napisy3.innerHTML = "<font color=\"gray\">"+kod+"/ "+miasto+":</font>";
  3868.     document.all.DaneFirma.disabled=true;
  3869.     document.daneKlienta.firmaWysylka.disabled = true;
  3870.      document.all.DaneKorespondencyjneFirmy.disabled=true;
  3871.  
  3872.         /*
  3873.      if(document.daneKlienta.jesliAdresWysylka.checked == true) {
  3874.        document.daneKlienta.ulicaWysylka.disabled = false;
  3875.         document.daneKlienta.kodpocztowyWysylka.disabled = false;
  3876.         document.daneKlienta.miastoWysylka.disabled = false;
  3877.  
  3878.       }
  3879.       */
  3880.     }
  3881. }
  3882. function jesliFirmaWyczysc(){
  3883.     if(document.daneKlienta.jesliFirma.checked == false){
  3884.         document.daneKlienta.nazwafirmy.value="";
  3885.         document.daneKlienta.ulicafirmy.value="";
  3886.         document.daneKlienta.nipfirmy.value="";
  3887.         document.daneKlienta.kodpocztowyfirmy.value="";
  3888.         document.daneKlienta.miastofirmy.value="";
  3889.         document.daneKlienta.firmaWysylka.value="";
  3890.        document.daneKlienta.nazwafirmy.disabled = true;
  3891.         document.daneKlienta.ulicafirmy.disabled = true;
  3892.         document.daneKlienta.nipfirmy.disabled = true;
  3893.         document.daneKlienta.kodpocztowyfirmy.disabled = true;
  3894.         document.daneKlienta.miastofirmy.disabled = true;
  3895.         document.daneKlienta.firmaWysylka.disabled = true;
  3896.     }  
  3897. }
  3898.  
  3899. function jesliAdresWysylkaStart(ulica, kod, miasto) {
  3900.     document.all.DaneKorespondencyjneFirmy.disabled=false;
  3901.       document.daneKlienta.firmaWysylka.disabled = false;
  3902.     document.all.DaneKorespondencyjne.disabled=false;
  3903.    if (document.daneKlienta.ulicaWysylka.value.length>0)
  3904.     {
  3905.     //document.daneKlienta.jesliAdresWysylka.checked = true;
  3906.      }
  3907.       jesliAresdoWysylki(ulica, kod, miasto);
  3908. }
  3909.  
  3910. function jesliAresdoWysylki(ulica, kod, miasto) {
  3911. if(document.daneKlienta.disabledData.value==0){  
  3912.    
  3913.     if(document.daneKlienta.jesliAdresWysylka.checked == true) {
  3914.     document.all.DaneKorespondencyjne.disabled=false;
  3915.     document.daneKlienta.ulicaWysylka.disabled = false;
  3916.     document.daneKlienta.kodpocztowyWysylka.disabled = false;
  3917.     document.daneKlienta.miastoWysylka.disabled = false;
  3918.  
  3919.     if(document.daneKlienta.nazwafirmy.disabled == true){
  3920.     document.daneKlienta.firmaWysylka.value="";
  3921.     document.daneKlienta.firmaWysylka.disabled=true;
  3922.    document.all.DaneKorespondencyjneFirmy.disabled=true;
  3923.             }
  3924.         else
  3925.         {
  3926.         document.all.DaneKorespondencyjneFirmy.disabled=false;
  3927.          document.daneKlienta.firmaWysylka.disabled=false;
  3928.         }
  3929.      }
  3930.     else {
  3931.        document.daneKlienta.ulicaWysylka.value="";
  3932.         document.daneKlienta.kodpocztowyWysylka.value="";
  3933.         document.daneKlienta.miastoWysylka.value="";
  3934.   document.daneKlienta.ulicaWysylka.disabled = true;
  3935.     document.daneKlienta.kodpocztowyWysylka.disabled = true;
  3936.     document.daneKlienta.miastoWysylka.disabled = true;
  3937.  
  3938.   document.daneKlienta.firmaWysylka.value="";
  3939.     document.all.DaneKorespondencyjne.disabled=true;
  3940.         document.daneKlienta.firmaWysylka.disabled=true;
  3941.   document.all.DaneKorespondencyjneFirmy.disabled=true;
  3942.       }
  3943. }
  3944. }
  3945.  
  3946.  
  3947. function jesliAdresWysylkaWyczysc(){
  3948.     /*
  3949.     if(document.daneKlienta.jesliAdresWysylka.checked == false){
  3950.         document.daneKlienta.ulicaWysylka.value="";
  3951.         document.daneKlienta.kodpocztowyWysylka.value="";
  3952.         document.daneKlienta.miastoWysylka.value="";
  3953.         document.daneKlienta.ulicaWysylka.disabled = true;
  3954.         document.daneKlienta.kodpocztowyWysylka.disabled = true;
  3955.         document.daneKlienta.miastoWysylka.disabled = true;
  3956.  
  3957.     }
  3958.     */
  3959. }
  3960.  
  3961. function jesliMiejsceSasiadujaceStart() {
  3962.     if(document.rkf.isMiejsceSasiadujace.checked == true) {
  3963.     document.all.MiejsceSasiadujace.style.display=(true)?"block":"none";
  3964.     }
  3965.     else {
  3966.     document.all.MiejsceSasiadujace.style.display=(false)?"block":"none";
  3967.     }
  3968.  }
  3969.  
  3970. function jesliMiejsceSasiadujace() {
  3971.     if(document.rkf.isMiejsceSasiadujace.checked == true) {
  3972.     document.all.MiejsceSasiadujace.style.display=(true)?"block":"none";
  3973.     }
  3974.     else {
  3975.     document.all.MiejsceSasiadujace.style.display=(false)?"block":"none";
  3976.     }
  3977. }
  3978.  
  3979. function jesliMiejsceSasiadujaceWyczysc(){
  3980.     if(document.rkf.isMiejsceSasiadujace.checked == false){
  3981.         document.rkf.nrWagonu.value="";
  3982.         document.rkf.nrMiejsca.value="";
  3983.     }  
  3984. }
  3985.  
  3986.  function jesliFaktura() {
  3987.     if(document.rkh.faktura.checked == true) {
  3988.     document.all.TxtFaktura.style.display=(true)?"block":"none";
  3989.     }
  3990.     else {
  3991.     document.all.TxtFaktura.style.display=(false)?"block":"none";
  3992.     }
  3993. }
  3994.  
  3995.  function jesliKolorowaKarta() {
  3996.     if(document.rkh.platnosc_kolorowa_karta.checked == true) {
  3997.         document.all.kolorowa_karta.style.display=(true)?"block":"none";
  3998.         document.all.dla.readOnly=false;
  3999.  
  4000.         document.all.dla.value=document.all.dla_org.value;
  4001.          }
  4002.     else {
  4003.         document.all.kolorowa_karta.style.display=(false)?"block":"none";
  4004.         document.all.dla.readOnly=false;
  4005.         document.all.numer_kolorowej_karty.value="";
  4006.     }
  4007. }
  4008.  
  4009. function edycjaDanych(ulica, kod, miasto){
  4010.    if(document.daneKlienta.typUsera.value==990){
  4011.         document.daneKlienta.ulica.disabled = true;
  4012.         document.daneKlienta.kodpocztowy.disabled = true;
  4013.         document.daneKlienta.miasto.disabled = true;
  4014.         document.all.Napisy.innerHTML = "<font color=\"gray\">"+ulica+":</font>";
  4015.         document.all.Napisy1.innerHTML = "<font color=\"gray\">"+kod+"/ "+miasto+":</font>";
  4016.     document.all.DaneFirma.style.display=(true)?"block":"none";
  4017.   }
  4018.     else{
  4019.         if(document.daneKlienta.disabledData.value==1){
  4020.             document.daneKlienta.ulica.disabled = true;
  4021.             document.daneKlienta.kodpocztowy.disabled = true;
  4022.             document.daneKlienta.miasto.disabled = true;
  4023.             document.all.Napisy.innerHTML = "<font color=\"gray\">*"+ulica+":</font>";
  4024.             document.all.Napisy1.innerHTML = "<font color=\"gray\">*"+kod+"/ "+miasto+":</font>";
  4025.             document.all.DaneFirma.style.display=(false)?"block":"none";    
  4026.              }
  4027.         else{
  4028.             document.daneKlienta.ulica.disabled = false;
  4029.             document.daneKlienta.kodpocztowy.disabled = false;
  4030.             document.daneKlienta.miasto.disabled = false;
  4031.             document.all.Napisy.innerHTML = "<font color=\"red\">*</font>"+ulica+":";
  4032.             document.all.Napisy1.innerHTML = "<font color=\"red\">*</font>"+kod+"/"+miasto+":";
  4033.             document.all.DaneFirma.style.display=(false)?"block":"none";        
  4034.         }
  4035.     }    
  4036. }
  4037. function PokazAktualnosciStart()
  4038. {
  4039. document.all.PoleAktualnosci.style.display=(false)?"block":"none";
  4040. document.all.PoleAktualnosci1.style.display=(false)?"block":"none";
  4041. document.all.PoleAktualnosci2.style.display=(false)?"block":"none";
  4042. document.all.PoleAktualnosci3.style.display=(false)?"block":"none";
  4043. }
  4044.  
  4045. function PokazAktualnosci()
  4046. {
  4047. document.all.p1.style.color="#FF8000";
  4048. document.all.p1.style.font=12+"px;";
  4049. document.all.p2.style.color="#103293";
  4050. document.all.p2.style.font=11+"px;";
  4051. document.all.p3.style.color="#103293";
  4052. document.all.p3.style.font=11+"px;";
  4053. document.all.p4.style.color="#103293";
  4054. document.all.p4.style.font=11+"px;";
  4055. document.all.PoleAktualnosci.style.display=(true)?"block":"none";
  4056. document.all.PoleAktualnosci1.style.display=(false)?"block":"none";
  4057. document.all.PoleAktualnosci2.style.display=(false)?"block":"none";
  4058. document.all.PoleAktualnosci3.style.display=(false)?"block":"none";
  4059. }
  4060.  
  4061. function PokazAktualnosci1()
  4062. {
  4063. document.all.p1.style.color="#103293";
  4064. document.all.p1.style.font=11+"px;";
  4065. document.all.p2.style.color="#FF8000";
  4066. document.all.p2.style.font=12+"px;";
  4067. document.all.p3.style.color="#103293";
  4068. document.all.p3.style.font=11+"px;";
  4069. document.all.p4.style.color="#103293";
  4070. document.all.p4.style.font=11+"px;";
  4071. document.all.PoleAktualnosci1.style.display=(true)?"block":"none";
  4072. document.all.PoleAktualnosci.style.display=(false)?"block":"none";
  4073. document.all.PoleAktualnosci2.style.display=(false)?"block":"none";
  4074. document.all.PoleAktualnosci3.style.display=(false)?"block":"none";
  4075. }
  4076.  
  4077. function PokazAktualnosci2()
  4078. {
  4079. document.all.p1.style.color="#103293";
  4080. document.all.p1.style.font=11+"px;";
  4081. document.all.p2.style.color="#103293";
  4082. document.all.p2.style.font=11+"px;";
  4083. document.all.p3.style.color="#FF8000";
  4084. document.all.p3.style.font=12+"px;";
  4085. document.all.p4.style.color="#103293";
  4086. document.all.p4.style.font=11+"px;";
  4087. document.all.PoleAktualnosci2.style.display=(true)?"block":"none";
  4088. document.all.PoleAktualnosci1.style.display=(false)?"block":"none";
  4089. document.all.PoleAktualnosci.style.display=(false)?"block":"none";
  4090. document.all.PoleAktualnosci3.style.display=(false)?"block":"none";
  4091. }
  4092.  
  4093. function PokazAktualnosci3()
  4094. {
  4095. document.all.p1.style.color="#103293";
  4096. document.all.p1.style.font=11+"px;";
  4097. document.all.p2.style.color="#103293";
  4098. document.all.p2.style.font=11+"px;";
  4099. document.all.p3.style.color="#103293";
  4100. document.all.p3.style.font=11+"px;";
  4101. document.all.p4.style.color="#FF8000";
  4102. document.all.p4.style.font=12+"px;";
  4103. document.all.PoleAktualnosci3.style.display=(true)?"block":"none";
  4104. document.all.PoleAktualnosci1.style.display=(false)?"block":"none";
  4105. document.all.PoleAktualnosci2.style.display=(false)?"block":"none";
  4106. document.all.PoleAktualnosci.style.display=(false)?"block":"none";
  4107. }
  4108.  
  4109. function zmien1()
  4110. {
  4111.     var temp='';
  4112.     temp=document.aktualnosci_zap.aktualnosci.value;
  4113.     document.aktualnosci_zap.aktualnosci.value=document.aktualnosci_zap.aktualnosci1.value;
  4114.     document.aktualnosci_zap.aktualnosci1.value=temp;
  4115.     var temp1='';
  4116.     temp1=document.aktualnosci_zap.news_tyt.value;
  4117.     document.aktualnosci_zap.news_tyt.value=document.aktualnosci_zap.news_tyt1.value;
  4118.     document.aktualnosci_zap.news_tyt1.value=temp1;
  4119.  
  4120.     var tempa='';
  4121.     tempa=document.aktualnosci_zap.aktualnoscia.value;
  4122.     document.aktualnosci_zap.aktualnoscia.value=document.aktualnosci_zap.aktualnosci1a.value;
  4123.     document.aktualnosci_zap.aktualnosci1a.value=tempa;
  4124.     var temp1a='';
  4125.     temp1a=document.aktualnosci_zap.news_tyta.value;
  4126.     document.aktualnosci_zap.news_tyta.value=document.aktualnosci_zap.news_tyt1a.value;
  4127.     document.aktualnosci_zap.news_tyt1a.value=temp1a;
  4128.  
  4129.     if(document.aktualnosci_zap.news.checked==true)
  4130.         var temp2a=1;
  4131.     else
  4132.         var temp2a=0;
  4133.     if(document.aktualnosci_zap.news1.checked==true)
  4134.         document.aktualnosci_zap.news.checked=true;
  4135.     else
  4136.         document.aktualnosci_zap.news.checked=false;
  4137.     if(temp2a==1)
  4138.         document.aktualnosci_zap.news1.checked=true;
  4139.     else
  4140.         document.aktualnosci_zap.news1.checked=false;
  4141. }
  4142.  
  4143. function zmien2()
  4144. {
  4145.     var temp='';
  4146.     temp=document.aktualnosci_zap.aktualnosci1.value;
  4147.     document.aktualnosci_zap.aktualnosci1.value=document.aktualnosci_zap.aktualnosci2.value;
  4148.     document.aktualnosci_zap.aktualnosci2.value=temp;
  4149.     var temp1='';
  4150.     temp1=document.aktualnosci_zap.news_tyt1.value;
  4151.     document.aktualnosci_zap.news_tyt1.value=document.aktualnosci_zap.news_tyt2.value;
  4152.     document.aktualnosci_zap.news_tyt2.value=temp1;
  4153.  
  4154.     var tempa='';
  4155.     tempa=document.aktualnosci_zap.aktualnosci1a.value;
  4156.     document.aktualnosci_zap.aktualnosci1a.value=document.aktualnosci_zap.aktualnosci2a.value;
  4157.     document.aktualnosci_zap.aktualnosci2a.value=tempa;
  4158.     var temp1a='';
  4159.     temp1a=document.aktualnosci_zap.news_tyt1a.value;
  4160.     document.aktualnosci_zap.news_tyt1a.value=document.aktualnosci_zap.news_tyt2a.value;
  4161.     document.aktualnosci_zap.news_tyt2a.value=temp1a;
  4162.  
  4163.     if(document.aktualnosci_zap.news1.checked==true)
  4164.         var temp2a=1;
  4165.     else
  4166.         var temp2a=0;
  4167.     if(document.aktualnosci_zap.news2.checked==true)
  4168.         document.aktualnosci_zap.news1.checked=true;
  4169.     else
  4170.         document.aktualnosci_zap.news1.checked=false;
  4171.     if(temp2a==1)
  4172.         document.aktualnosci_zap.news2.checked=true;
  4173.     else
  4174.         document.aktualnosci_zap.news2.checked=false;
  4175. }
  4176.  
  4177. function zmien3()
  4178. {
  4179.     var temp='';
  4180.     temp=document.aktualnosci_zap.aktualnosci2.value;
  4181.     document.aktualnosci_zap.aktualnosci2.value=document.aktualnosci_zap.aktualnosci3.value;
  4182.     document.aktualnosci_zap.aktualnosci3.value=temp;
  4183.     var temp1='';
  4184.     temp1=document.aktualnosci_zap.news_tyt2.value;
  4185.     document.aktualnosci_zap.news_tyt2.value=document.aktualnosci_zap.news_tyt3.value;
  4186.     document.aktualnosci_zap.news_tyt3.value=temp1;
  4187.  
  4188.     var tempa='';
  4189.     tempa=document.aktualnosci_zap.aktualnosci2a.value;
  4190.     document.aktualnosci_zap.aktualnosci2a.value=document.aktualnosci_zap.aktualnosci3a.value;
  4191.     document.aktualnosci_zap.aktualnosci3a.value=tempa;
  4192.     var temp1a='';
  4193.     temp1a=document.aktualnosci_zap.news_tyt2a.value;
  4194.     document.aktualnosci_zap.news_tyt2a.value=document.aktualnosci_zap.news_tyt3a.value;
  4195.     document.aktualnosci_zap.news_tyt3a.value=temp1a;
  4196.  
  4197.     if(document.aktualnosci_zap.news2.checked==true)
  4198.         var temp2a=1;
  4199.     else
  4200.         var temp2a=0;
  4201.     if(document.aktualnosci_zap.news3.checked==true)
  4202.         document.aktualnosci_zap.news2.checked=true;
  4203.     else
  4204.         document.aktualnosci_zap.news2.checked=false;
  4205.     if(temp2a==1)
  4206.         document.aktualnosci_zap.news3.checked=true;
  4207.     else
  4208.         document.aktualnosci_zap.news3.checked=false;
  4209. }
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216. function setCookie(c_name,value,expiredays)
  4217.             {
  4218.                 var exdate=new Date();
  4219.                 exdate.setDate(expiredays)
  4220.                 document.cookie=c_name+ "=" +escape(value)+
  4221.                 ((expiredays==null) ? "" : ";expires="+exdate)                
  4222.             }
  4223.  
  4224.             function getCookie(c_name)
  4225.             {
  4226.                 if (document.cookie.length>0)
  4227.                 {
  4228.                     c_start=document.cookie.indexOf(c_name + "=")
  4229.                     if (c_start!=-1)
  4230.                     {
  4231.                         c_start=c_start + c_name.length+1
  4232.                         c_end=document.cookie.indexOf(";",c_start)
  4233.                         if (c_end==-1) c_end=document.cookie.length
  4234.                         return unescape(document.cookie.substring(c_start,c_end))
  4235.                     }
  4236.                 }
  4237.                 return null
  4238.             }
  4239.  
  4240. function kontrola(pole, maxlimit)
  4241. {
  4242. if (pole.value.length > maxlimit)
  4243.     pole.value = pole.value.substring(0, maxlimit);
  4244. }
  4245.  
  4246. function eCardTransakcje_Kontrola()
  4247. {
  4248.     if(document.Szukaj.nazwa_szukaj.value.length>1 || document.Szukaj.loginMail_szukaj.value.length>5 || document.Szukaj.pesel_szukaj.value.length>8){
  4249.         if(document.Szukaj.nazwa_szukaj.value.length>1 && document.Szukaj.loginMail_szukaj.value.length<6 && document.Szukaj.loginMail_szukaj.value.length>0)
  4250.         {
  4251.         if (document.Szukaj.pesel_szukaj.value.length>0 && document.Szukaj.pesel_szukaj.value.length<8)
  4252.         {
  4253.                 alert("Login lub e-mail minimalnie 6 znaków \n(w adresie e-mail musi wystąpić @)\nPesel minimalnie 9 znaków.");
  4254.         }else{
  4255.              alert("Login lub e-mail minimalnie 6 znaków \n(w adresie e-mail musi wystąpić @).");
  4256.         }
  4257.         }else{
  4258.             document.Szukaj.submit();
  4259.         }
  4260.     } else {
  4261.         if (document.Szukaj.pesel_szukaj.value.length>0 && document.Szukaj.pesel_szukaj.value.length<8)
  4262.         {
  4263.             alert("Imię i/lub Nazwisko minimalnie 2 znaki \nLogin lub e-mail minimalnie 6 znaków \n(w adresie e-mail musi wystąpić @)\nPesel minimalnie 9 znaków.");
  4264.         }
  4265.         else{
  4266.             alert("Imię i/lub Nazwisko minimalnie 2 znaki \nLogin lub e-mail minimalnie 6 znaków \n(w adresie e-mail musi wystąpić @).");
  4267.         }
  4268.     }
  4269. }
  4270.  
  4271. function formatCeny(wartosc)
  4272. {
  4273. var cena= ""+wartosc;
  4274. var kwota = wartosc;
  4275. var jestKropa=0;
  4276. var txt="";
  4277. cenaTXT="";
  4278. groszeTXT="";
  4279. groszeTXT = ""+wartosc%100;
  4280. groszeTXT= groszeTXT.substring(0,groszeTXT.indexOf('.'));
  4281. jestKropa=cena.indexOf('.');
  4282. if (jestKropa>=0)
  4283. {
  4284. cenaTXT = cena.substring(0,jestKropa);
  4285.     if (cena.length > 2)
  4286.     {
  4287.     if ((wartosc%100) <10)
  4288.         txt =""+cenaTXT.substring(0,cenaTXT.length-2)+",0"+groszeTXT;
  4289.     else
  4290.         txt =""+cenaTXT.substring(0,cenaTXT.length-2)+","+groszeTXT;
  4291.     }
  4292.     else
  4293.     {
  4294.     if ((wartosc%100) <10)
  4295.         txt ="0,0"+groszeTXT;
  4296.     else
  4297.         txt ="0,"+groszeTXT;
  4298.     }
  4299. }
  4300. else
  4301. {
  4302.     if (cena.length > 2)
  4303.     {
  4304.     if ((wartosc%100) <10)
  4305.         txt =""+cena.substring(0,cena.length-2)+",0"+(wartosc%100);
  4306.     else
  4307.         txt =""+cena.substring(0,cena.length-2)+","+(wartosc%100);
  4308.     }
  4309.     else
  4310.     {
  4311.     if ((wartosc%100) <10)
  4312.         txt ="0,0"+(wartosc%100);
  4313.     else
  4314.         txt ="0,"+(wartosc%100);
  4315.     }
  4316.  
  4317. }
  4318.  
  4319.       return txt;
  4320. }
  4321.  
  4322. function obliczBilet(wartosc)
  4323. {
  4324. var cena= 0;
  4325. var procent = document.zwrotBiletow.procBilet.value;
  4326. var txt="";
  4327.    cena = Math.round((wartosc*procent)/100);
  4328.    txt=formatCeny(cena);
  4329.     document.zwrotBiletow.zwrotBilet.value=txt;
  4330.  
  4331. }
  4332. function obliczMiejscowke(wartosc)
  4333. {
  4334. var cena= 0;
  4335. var procent = document.zwrotBiletow.procRez.value;
  4336. var txt="";
  4337.    cena = Math.round((wartosc*procent)/100);
  4338.    txt=formatCeny(cena);
  4339.     document.zwrotBiletow.zwrotMiejscowka.value=txt;
  4340.  
  4341. }
  4342.  
  4343.  
  4344.  
  4345. function kompletnosc_subkontyngent(){
  4346. var pola = "";
  4347. var koniec = false;
  4348.  
  4349.     if(dlugosc_pol(document.zwrotBiletow.zwrotBilet.length) == 0 || cena_OK(document.zwrotBiletow.zwrotBilet.value) == 0){
  4350.        
  4351.     pola+=" -  Kwota za bilet \n";
  4352.     koniec=true;
  4353.     }
  4354.  
  4355.     if(document.zwrotBiletow.powodBilet.value=="" || dlugosc_pol(document.zwrotBiletow.powodBilet.length) == 0){
  4356.     pola+=" -  Powód zwrotu biletu\n";
  4357.     koniec=true;
  4358.     }
  4359.        
  4360.     if(dlugosc_pol(document.zwrotBiletow.zwrotMiejscowka.length) == 0 || cena_OK(document.zwrotBiletow.zwrotMiejscowka.value) == 0){
  4361.     pola+=" -  Kwota za rezerwację\n";
  4362.     koniec=true;
  4363.     }
  4364.  
  4365.     if(document.zwrotBiletow.powodMiejscowka.value=="" || dlugosc_pol(document.zwrotBiletow.powodMiejscowka.length) == 0){
  4366.     pola+=" -  Powód zwrotu rezerwacji\n";
  4367.     koniec=true;
  4368.     }
  4369.  
  4370.     if(!koniec){
  4371.         document.zwrotBiletow.submit();
  4372.     }
  4373.    
  4374.     else {
  4375.     if(pola != "")
  4376.             alert("Popraw lub wypełnij pola:\n" + pola);
  4377.     }
  4378. }
  4379.  
  4380.  
  4381. function zmianaDanychBilet1(imienazwisko, poprpola){
  4382. var pola = "";
  4383. var koniec = false;
  4384.  
  4385.     if(document.fzmien1.podrozny.value=="" || tylko_litery(document.fzmien1.podrozny.value) == 0 || poprawna_nazwa(document.fzmien1.podrozny.value) == 0){
  4386.     pola+=" - " +  imienazwisko + "\n";
  4387.     koniec=true;
  4388.     }
  4389.  
  4390.     if(!koniec){
  4391.     document.fzmien1.submit();
  4392.     }
  4393.     else {
  4394.     if(pola != "")
  4395.             alert(poprpola + ":\n" + pola);
  4396.     }
  4397. }
  4398.  
  4399.  
  4400.  
  4401. function telefon_MMS(inf) {
  4402. var OK = 1;
  4403. var NO = 0;
  4404. var dlugosc = 0;
  4405. var nrTel48= document.wysylkaMMS.tel.value.substring(0,3);
  4406.  
  4407.     dlugosc = document.wysylkaMMS.tel.length;
  4408.  
  4409.     if(dlugosc == 0)
  4410.             return NO;
  4411.  
  4412.     if (tylko_cyfra1(document.wysylkaMMS.tel.value) == 0){
  4413.             alert(inf);
  4414.             document.wysylkaMMS.tel.focus();
  4415.             return NO;
  4416.     }
  4417.  
  4418.             if (nrTel48<480 || nrTel48>489)
  4419.             {
  4420.              alert(inf);
  4421.              document.wysylkaMMS.tel.focus();
  4422.              return NO;
  4423.              }
  4424.  
  4425.     return OK;
  4426. }
  4427.  
  4428. function sprTelMMS(telefon, inf, poprpola){
  4429. var pola = "";
  4430. var koniec = false;
  4431.  
  4432.  
  4433.     if(document.wysylkaMMS.tel.value =="" || telefon_MMS(inf) == 0){
  4434.     pola+=" - " + telefon + "\n";
  4435.     koniec=true;
  4436.     }
  4437.  
  4438.     if(!koniec){
  4439.         document.wysylkaMMS.submit();
  4440.     }
  4441.     else {
  4442.         if(pola != "")
  4443.             alert(poprpola );
  4444.     }
  4445. }
  4446.  
  4447. function getStationNameByIbnr(ibnrField, outFieldId) {
  4448.     var ibnr = document.getElementById(ibnrField).value;
  4449.     if (ibnr === "") {
  4450.         document.getElementById(outFieldId).innerHTML = "nie wybrano";
  4451.     } else if (isNaN(ibnr)) {
  4452.         document.getElementById(outFieldId).innerHTML = "<font color=red>! błędny IBNR</font>";
  4453.     } else if (ibnr <= 0) {
  4454.         document.getElementById(outFieldId).innerHTML = "<font color=red>! IBNR <= 0</font>";
  4455.     } else {
  4456.         var xhr = new XMLHttpRequest();
  4457.         xhr.onreadystatechange = function() {
  4458.             if (xhr.readyState === 4) {
  4459.                 var data = xhr.responseText;
  4460.                 document.getElementById(outFieldId).innerHTML = data;
  4461.             }
  4462.         }
  4463.         xhr.open('GET', '/Utils?funkcja=NAZWA_STACJI_PO_IBNR&ibnr='+ibnr, true);
  4464.         xhr.send(null);
  4465.     }
  4466. }
  4467.  
  4468. function delTanszaOferta(owr_id){
  4469.     var xhr = new XMLHttpRequest();
  4470.     xhr.onreadystatechange = function() {
  4471.         if (xhr.readyState === 4) {
  4472.             var data = xhr.responseText;
  4473.             if (data.indexOf("OK") > -1) {
  4474.                 for (var i = 1; i < 9; i++) {
  4475.                     document.getElementById(i + 'C' + owr_id).innerHTML = '<strike>' + document.getElementById(i + 'C' + owr_id).innerHTML + '<strike>';
  4476.                 }
  4477.                 document.getElementById('1B' + owr_id).setAttribute('disabled', 'disabled');
  4478.             } else {
  4479.                 alert(data);
  4480.             }
  4481.         }
  4482.     }
  4483.     xhr.open('GET', '/Utils?funkcja=USUN_TANSZA_OFERTE&owr_id=' + owr_id, true);
  4484.     xhr.send(null);
  4485. }
  4486.  
  4487. function validateTanszaOferta(){
  4488.     var isOk = 1;
  4489.     var text = "";
  4490.     if(document.getElementById("st_od_output").innerHTML==="nie wybrano" || document.getElementById("st_od_output").innerHTML.indexOf('!')>-1){
  4491.         isOk = 0;
  4492.         text = "Proszę uzupełnić/poprawić stację od.";
  4493.     } else if(document.getElementById("st_do_output").innerHTML==="nie wybrano" || document.getElementById("st_do_output").innerHTML.indexOf('!')>-1){
  4494.         isOk = 0;
  4495.         text = "Proszę uzupełnić/poprawić stację do.";
  4496.     } else if(document.getElementById("st_p1_output").innerHTML.indexOf('!')>-1 || document.getElementById("st_p2_output").innerHTML.indexOf('!')>-1 ||
  4497.               document.getElementById("st_p3_output").innerHTML.indexOf('!')>-1 || document.getElementById("st_p4_output").innerHTML.indexOf('!')>-1){
  4498.         isOk = 0;
  4499.         text = "Proszę poprawić stacje przez.";
  4500.     } else {
  4501.         var ibnrod = document.getElementById("st_od_input").value;
  4502.         var ibnrdo = document.getElementById("st_do_input").value;
  4503.         var ibnrp1 = document.getElementById("st_p1_input").value;
  4504.         var ibnrp2 = document.getElementById("st_p2_input").value;
  4505.         var ibnrp3 = document.getElementById("st_p3_input").value;
  4506.         var ibnrp4 = document.getElementById("st_p4_input").value;
  4507.         var stacje = new Array(ibnrod, ibnrdo, ibnrp1, ibnrp2, ibnrp3, ibnrp4);
  4508.         for (var i = 0; i < 5; i++) {
  4509.             if (stacje[i] !== '') {
  4510.                 for (var j = i + 1; j < 6; j++) {
  4511.                     if (stacje[j] !== '' && stacje[i] === stacje[j]) {
  4512.                         isOk = 0;
  4513.                         text = "Stacje nie mogš się powtarzać.";
  4514.                         break;
  4515.                     }
  4516.                 }
  4517.             }
  4518.             if (isOk === 0) {
  4519.                 break;
  4520.             }
  4521.         }
  4522.         if (isOk === 1) {
  4523.             for (var i = 5; i > 2; i--) {
  4524.                 if (stacje[i] !== '') {
  4525.                     for (var j = i - 1; j > 1; j--) {
  4526.                         if (stacje[j] === '') {
  4527.                             isOk = 0;
  4528.                             text = "Proszę uzupełnić puste stacje przez.";
  4529.                             break;
  4530.                         }
  4531.                     }
  4532.                 }
  4533.                 if (isOk === 0) {
  4534.                     break;
  4535.                 }
  4536.             }
  4537.         }
  4538.     }
  4539.     if (isOk === 1) {
  4540.         document.saveForm.submit();
  4541.     } else {
  4542.         alert(text);
  4543.     }
  4544. }
  4545.  
  4546. function sprNip(nip_id){
  4547.     var ret = 0;
  4548.  
  4549.     if (document.getElementById(nip_id).value.length === 0) {
  4550.         ret = 0;
  4551.     } else if(eval(/^[0-9]{10}$/).test(document.getElementById(nip_id).value)){
  4552.         ret = 1;
  4553.     } else {
  4554.         alert("Nieprawidłowy NIP.\nPowinien się składać z 10 cyfr, bez znaków podziału.");
  4555.         document.getElementById(nip_id).focus();
  4556.     }
  4557.    
  4558.     if (ret==1)
  4559.     {
  4560.         if (!validatenip(document.getElementById(nip_id).value))
  4561.         {
  4562.             alert("Nieprawidłowy NIP.\nPowinien się składać z 10 cyfr, bez znaków podziału.\nSystem sprawdza cyfrę kontrolnš");
  4563.             document.getElementById(nip_id).focus();
  4564.             ret =0;
  4565.         }
  4566.     }
  4567.  
  4568.     return ret;
  4569. }
  4570.  
  4571. function sprNipValue(nip_id){
  4572.     var ret = 0;
  4573.  
  4574.     if(eval(/^[0-9]{10}$/).test(document.getElementById(nip_id).value)){
  4575.         ret = 1;
  4576.     }
  4577.     return ret;
  4578. }
  4579.  
  4580. function sprTylkoLiteryICyfry(field_id, message){
  4581.     var ret = 0;
  4582.  
  4583.     if (document.getElementById(field_id).value.length === 0) {
  4584.         ret = 1;
  4585.     } else if((eval(/^[A-Za-z]+[0-9]+/).test(document.getElementById(field_id).value)||eval(/^[0-9]+[A-Za-z]+/).test(document.getElementById(field_id).value))&& eval(/^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$/).test(document.getElementById(field_id).value)){
  4586.         ret = 1;
  4587.     } else {
  4588.         alert(message);
  4589.         document.getElementById(field_id).focus();
  4590.     }
  4591.  
  4592.     return ret;
  4593. }
  4594.  
  4595. function sprNrBiletu(bil_id,msg,typ)
  4596. {
  4597.     var ret=0;
  4598.     if (tylko_cyfra1(bil_id)==0)
  4599.     {
  4600.         if (typ==0)
  4601.         {
  4602.             alert(msg)
  4603.         }        
  4604.     }
  4605.     else
  4606.     {
  4607.         ret=1;
  4608.     }
  4609.    
  4610.     return ret;
  4611. }
  4612.  
  4613. function sprPesel(pesel,msg,typ)
  4614. {    
  4615.     var ret=0;
  4616.     if (tylko_cyfra1(pesel)==0 || pesel.length!=11 || pesel=='00000000000')
  4617.     {
  4618.         if (typ==0)
  4619.         {
  4620.              alert(msg)
  4621.          }
  4622.     }
  4623.     else
  4624.     {
  4625.         if (!validatepesel(pesel))
  4626.         {
  4627.             alert(msg);
  4628.         }
  4629.         else
  4630.         {
  4631.             ret=1;
  4632.         }
  4633.        
  4634.     }
  4635.    
  4636.     return ret;
  4637. }
  4638.  
  4639. function sprDowodOsobisty(dowodOsobosty,msg,typ)
  4640. {
  4641.     var ret=0;    
  4642.     reg = /^[A-Z0-9\-\\\s\\\\\/]{9,30}$/;
  4643.     if (!dowodOsobosty.match(reg))
  4644.     {
  4645.         if (typ==0)
  4646.         {
  4647.             alert(msg)
  4648.         }
  4649.     }
  4650.     else
  4651.     {
  4652.         ret=1;
  4653.     }
  4654.    
  4655.     return ret;    
  4656. }
  4657.  
  4658. function sprIdentyfikator(idOption, identyfikator, msgDowod, msgPesel, typDowod, typPesel, typ){
  4659.     var ret = 0;
  4660.     if (document.getElementById(idOption).value === typPesel) {
  4661.         ret = sprPesel(identyfikator, msgPesel, typ);
  4662.     } else if (document.getElementById(idOption).value === typDowod) {
  4663.         ret = sprDowodOsobisty(identyfikator, msgDowod, typ);
  4664.     }
  4665.     return ret;
  4666. }
  4667.  
  4668. function sprImieNazwisko(imienazwisko,msg,typ,iloscznakow)
  4669. {
  4670.  var ret=0;    
  4671.     if (tylko_litery(imienazwisko)==0 || imienazwisko.length<iloscznakow)
  4672.     {
  4673.         if (typ==0)
  4674.         {
  4675.             alert(msg)
  4676.         }
  4677.     }
  4678.     else
  4679.     {
  4680.         ret=1;
  4681.     }
  4682.    
  4683.     return ret;    
  4684. }
  4685.  
  4686. function sprEmail(email,msg,typ)
  4687. {
  4688.      var ret=0;
  4689.     if (poprawny_email(email)==0)
  4690.     {
  4691.         if (typ==0)
  4692.         {
  4693.             alert(msg)
  4694.         }
  4695.     }
  4696.     else
  4697.     {
  4698.         ret=1;
  4699.     }
  4700.    
  4701.     return ret;    
  4702. }
  4703.  
  4704. function kompletnoscDanychLogowanieKontoGosc(bil_id,email,msg)
  4705. {
  4706.     if (sprNrBiletu(bil_id,'',1)==0  || (email.length!=0 && sprEmail(email,'',1)==0))
  4707.     {
  4708.         alert(msg);
  4709.     }
  4710.     else
  4711.     {
  4712.         document.kontogosclogowanie.submit();        
  4713.     }
  4714. }
  4715.  
  4716. function validatepesel(pesel) {
  4717.     var reg = /^[0-9]{11}$/;
  4718.     if(reg.test(pesel) == false) {
  4719.     return false;}
  4720.     else
  4721.     {
  4722.         var dig = (""+pesel).split("");
  4723.         var kontrola = (1*parseInt(dig[0]) + 3*parseInt(dig[1]) + 7*parseInt(dig[2]) + 9*parseInt(dig[3]) + 1*parseInt(dig[4]) + 3*parseInt(dig[5]) + 7*parseInt(dig[6]) + 9*parseInt(dig[7]) + 1*parseInt(dig[8]) + 3*parseInt(dig[9]))%10;
  4724.         if(kontrola==0) kontrola = 10;
  4725.         kontrola = 10 - kontrola;
  4726.         if(parseInt(dig[10])==kontrola)
  4727.         return true;
  4728.         else
  4729.         return false;
  4730.     }
  4731.  
  4732. }
  4733.  
  4734. function validatenip(nip) {
  4735.     var nip_bez_kresek = nip.replace(/-/g,"");
  4736.     var reg = /^[0-9]{10}$/;
  4737.     if(reg.test(nip_bez_kresek) == false) {
  4738.     return false;}
  4739.     else
  4740.     {
  4741.         var dig = (""+nip_bez_kresek).split("");
  4742.         var kontrola = (6*parseInt(dig[0]) + 5*parseInt(dig[1]) + 7*parseInt(dig[2]) + 2*parseInt(dig[3]) + 3*parseInt(dig[4]) + 4*parseInt(dig[5]) + 5*parseInt(dig[6]) + 6*parseInt(dig[7]) + 7*parseInt(dig[8]))%11;
  4743.         if(parseInt(dig[9])==kontrola)
  4744.         return true;
  4745.         else
  4746.         return false;
  4747.     }
  4748.  
  4749. }
  4750.  
  4751.  
  4752. function validateregon9(regon) {
  4753.     var reg = /^[0-9]{9}$/;
  4754.     if(reg.test(regon) == false) {
  4755.     return false;}
  4756.     else
  4757.     {
  4758.         var dig = (""+regon).split("");
  4759.         var kontrola = (8*parseInt(dig[0]) + 9*parseInt(dig[1]) + 2*parseInt(dig[2]) + 3*parseInt(dig[3]) + 4*parseInt(dig[4]) + 5*parseInt(dig[5]) + 6*parseInt(dig[6]) + 7*parseInt(dig[7]))%11;
  4760.         if(kontrola == 10) kontrola = 0;
  4761.         if(parseInt(dig[8])==kontrola)
  4762.         return true;
  4763.         else
  4764.         return false;
  4765.     }
  4766. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement