home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / JanaSetup.exe / admin / pruefen_js / rasparameter_edit.js < prev    next >
Encoding:
Text File  |  2006-08-03  |  3.6 KB  |  196 lines

  1. function pwfeld()
  2. {
  3.     with (document.formular)
  4.     {
  5.         var d1 = D1.options[0].value;
  6.         var f1 = T1.value;
  7.         var f2 = T2;
  8.         var f3 = T3;
  9.         var f4 = T4;
  10.         var f9 = T9;
  11.         var f10 = T10.value;
  12.  
  13.         if (f1 != '')
  14.             f2.value = parent.header.document.dummy.feld.value;
  15.  
  16.         if (f10 != '')
  17.             f3.value = parent.header.document.dummy.feld.value;
  18.  
  19.         if (d1 == 'DF▄-Verbindung wΣhlen')
  20.         {
  21.             for (var i = 1; i <= 7; i++)
  22.                 elements['C' + i].checked = true;
  23.  
  24.             f9.value = '00:00'
  25.             f4.value = '23:59'
  26.         }
  27.  
  28.         var fh = new Array('F0');
  29.         var wh = new Array('F0');
  30.  
  31.         for (var j = 0; j < fh.length; j++)
  32.         {
  33.             var pr = elements[fh[j]];
  34.  
  35.             if (pr.value == '')
  36.                 pr.value = wh[j]
  37.         }
  38.     }
  39. }
  40.  
  41. /**/
  42.  
  43. function konvert()
  44. {
  45.     with (document.formular)
  46.     {
  47.         var f1 = elements['T4'];
  48.  
  49.         if (f1.value == '24:00')
  50.         {
  51.             f1.value = '23:59';
  52.             send();
  53.         }
  54.     }
  55. }
  56.  
  57. /**/
  58.  
  59. function send()
  60. {
  61.     if (pruefen())
  62.         with (document.formular)
  63.             submit();
  64. }
  65.  
  66. /**/
  67.  
  68. function pruefen()
  69. {
  70.     with (document.formular)
  71.     {
  72.         var f1 = T1.value;
  73.         var f2 = T2.value;
  74.         var f4 = T4.value;
  75.         var f6 = T6.value;
  76.         var f7 = T7.value;
  77.         var f8 = T8.value;
  78.         var f9 = T9.value;
  79.         var c1 = C1.checked;
  80.         var c2 = C2.checked;
  81.         var c3 = C3.checked;
  82.         var c4 = C4.checked;
  83.         var c5 = C5.checked;
  84.         var c6 = C6.checked;
  85.         var c7 = C7.checked;
  86.         var d1 = D1.options[D1.selectedIndex].value;
  87.  
  88.         var va = '\' " ,';
  89.         var rx = new RegExp('[\'",]', '');
  90.         var fe = new Array('T1', 'T2', 'T6');
  91.  
  92.         for (var i = 0; i < fe.length; i++)
  93.         {
  94.             var ei = elements[fe[i]];
  95.  
  96.             if (rx.test(ei.value))
  97.             {
  98.                 alert(txt[5][7] + va + txt[5][8]);
  99.                 ei.select();
  100.                 ei.focus();
  101.                 return false;
  102.             }
  103.         }
  104.  
  105.         if (d1 == 'DF▄-Verbindung wΣhlen')
  106.         {
  107.             alert(txt[19][9] + txt[21][0] + txt[21][9]);
  108.             D1.focus();
  109.             return false;
  110.         }
  111.  
  112.         if (f1 == '')
  113.         {
  114.             alert(txt[21][10] + txt[21][2] + ' "\t\n' + txt[21][11]);
  115.             T1.select();
  116.             T1.focus();
  117.             return false;
  118.         }
  119.  
  120.         if (f2 == '')
  121.         {
  122.             alert(txt[21][10] + txt[21][3] + ' "\t\n\t' + txt[21][12]);
  123.             T2.select();
  124.             T2.focus();
  125.             return false;
  126.         }
  127.  
  128.         if (c1 || c2 || c3 || c4 || c5 || c6 || c7)
  129.         {
  130.             var z1 = Date.parse('Wed, 23 Oct 2002 ' + f9 + ':00');
  131.             var z2 = Date.parse('Wed, 23 Oct 2002 ' + f4 + ':00');
  132.             var ce = new Array(f9, f4);
  133.             var pr = new Array(z1, z2);
  134.             var se = new Array(T9, T4);
  135.  
  136.             for (var j = 0; j < ce.length; j++)
  137.             {
  138.                 if ((ce[j].length != 5) || isNaN(pr[j]))
  139.                 {
  140.                     alert(txt[42][6] + ' ( ' + txt[20][5 + j] + ' ),   " ' + txt[42][7] + '\t');
  141.                     se[j].select();
  142.                     se[j].focus();
  143.                     return false;
  144.                 }
  145.             }
  146.  
  147.             var dif = (z2 - z1) / 60 / 1000;
  148.  
  149.             if (dif < 30)
  150.             {
  151.                 alert(txt[42][3] + '" ' + txt[20][5] + '  -  ' + txt[20][6] + ' "' + txt[42][4]);
  152.                 se[1].select();
  153.                 se[1].focus();
  154.                 return false;
  155.             }
  156.         }
  157.         else
  158.         {
  159.             alert(txt[21][15]);
  160.             C1.focus();
  161.             return false;
  162.         }
  163.  
  164.         if ((f6 == '') && (f7 != ''))
  165.         {
  166.             alert(txt[21][16] + txt[21][6] + txt[21][17] + txt[21][5] + txt[21][18]);
  167.             T7.select();
  168.             T7.focus();
  169.             return false;
  170.         }
  171.  
  172.         if ((f6 != '') && (isNaN(f7) || (f7 < 1) || (f7 > 65535)))
  173.         {
  174.             alert(txt[19][9] + txt[21][6] + ' "\t\n' + txt[21][19]);
  175.             T7.select();
  176.             T7.focus();
  177.             return false;
  178.         }
  179.  
  180.         if (f8 != '')
  181.         {
  182.             var ip_num = '(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])';
  183.             var ip_exp = new RegExp('^' + ip_num + '\\.' + ip_num + '\\.' + ip_num + '\\.' + ip_num + '$', '');
  184.  
  185.             if ((f8 == '255.255.255.255') || (ip_exp.test(f8) == false))
  186.             {
  187.                 alert(f8 + ', ' + txt[18][27]);
  188.                 T8.select();
  189.                 T8.focus();
  190.                 return false;
  191.             }
  192.         }
  193.     }
  194.  
  195.     return true;
  196. }