Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / tests / js1_5 / Regress / regress-216320.js
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  * http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * The Original Code is JavaScript Engine testing utilities.
16  *
17  * The Initial Developer of the Original Code is
18  * Netscape Communications Corp.
19  * Portions created by the Initial Developer are Copyright (C) 2003
20  * the Initial Developer. All Rights Reserved.
21  *
22  * Contributor(s):
23  *   brendan@mozilla.org, pschwartau@netscape.com
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either the GNU General Public License Version 2 or later (the "GPL"), or
27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
38
39 /*
40  *
41  * Date:    09 September 2003
42  * SUMMARY: Just seeing we don't crash on this code
43  * See http://bugzilla.mozilla.org/show_bug.cgi?id=216320
44  *
45  */
46 //-----------------------------------------------------------------------------
47 var BUGNUMBER = 216320;
48 var summary = "Just seeing we don't crash on this code";
49
50 printBugNumber(BUGNUMBER);
51 printStatus(summary);
52
53
54 /* TESTCASE BEGINS HERE */
55 status=0;
56 ism='NO';
57 scf='N';
58
59 function vol(){
60   if(navigator.appName!="Netscape"){    if(!window.navigator.onLine){   alert(pbc0430); return false;   } }
61   return true; }
62
63 function vnid(formfield){
64   nid=formfield.value;
65   if(!nid.match(/^\s*$/)){
66     nl=nid.split('/').length;
67     if(nl!=2&&nl!=3){
68       alert(pbc0420);
69       formfield.focus();
70       return false;
71     }}}
72
73 function vnull(formfield){
74   text=formfield.value;
75   if(text.match(/^\s*$/)){
76     alert(pbc0425);
77     formfield.focus();
78     return false;
79   }
80   return true;
81 }
82
83 function vdt(formfield){
84   date=formfield.value;
85 //MM/DD/YYYY
86 //YYYY/MM/DD
87   year=date.substring(0,4);
88   hy1=date.charAt(4);
89   month=date.substring(5,7);
90   hy2=date.charAt(7);
91   day=date.substring(8,10);
92   today=new Date();
93   tdy=today.getDate();
94   tmn=today.getMonth()+1;
95   if(today.getYear()<2000)tyr=today.getYear()+1900;
96   else tyr=today.getYear();
97   if(date.match(/^\s*$/))       {return true;   }
98
99   if(hy1!="/"||hy2!="/"){
100     alert(pbc0409);
101     formfield.focus();
102     return false;
103   }
104   if(month>12||day>31||month<=0||day<=0||(isNaN(month)==true)||(isNaN(day)==true)||(isNaN(year)==true)){
105     alert(pbc0409);
106     formfield.focus();
107     return false;
108   }
109
110   if(((month==1||month==3||month==5||month==7||month==8||month==10||month==12)&&day>31)||(year%4==0&&month==2&&day>29)||(year%4!=0&&month==2&&day>28)||((month==4||month==6||month==9||month==11)&&day>30)){
111     alert(pbc0409);
112     formfield.focus();
113     return false;
114   }
115   return true;
116 }
117
118 function vkdt(formfield){
119   date=formfield.value;
120   year=date.substring(0,4);
121   hy1=date.charAt(4);
122   month=date.substring(5,7);
123   hy2=date.charAt(7);
124   day=date.substring(8,10);
125   today=new Date();
126   tdy=today.getDate();
127   tmn=today.getMonth()+1;
128   if(today.getYear()<2000)tyr=today.getYear()+1900;
129   else tyr=today.getYear();
130   if(date.match(/^\s*$/)){
131     alert(pbc0425);
132     formfield.focus();
133     return false;
134   }
135   if(hy1!="/"||hy2!="/"){
136     alert(pbc0409);
137     formfield.focus();
138     return false;
139   }
140
141   if(month>12||day>31||month<=0||day<=0||(isNaN(month)==true)||(isNaN(day)==true)||(isNaN(year)==true)){
142     alert(pbc0409);
143     formfield.focus();
144     return false;
145   }
146
147   if(((month==1||month==3||month==5||month==7||month==8||month==10||month==12)&&day>31)||(year%4==0&&month==2&&day>29)||(year%4!=0&&month==2&&day>28)||((month==4||month==6||month==9||month==11)&&day>30)){
148     alert(pbc0409);
149     formfield.focus();
150     return false;
151   }
152   return true;
153 }
154
155 function ddif(month1,day1,year1,month2,day2,year2){
156   start = new Date();
157   start.setYear(year1);
158   start.setMonth(month1-1);
159   start.setDate(day1);
160   start.setMinutes(0);
161   start.setHours(0);
162   start.setSeconds(0);
163   end = new Date();
164   end.setYear(year2);
165   end.setMonth(month2-1);
166   end.setDate(day2);
167   end.setMinutes(0);
168   end.setHours(0);
169   end.setSeconds(0);
170   current =(end.getTime() - start.getTime());
171   days = Math.floor(current /(1000 * 60 * 60 * 24));
172   return(days);
173 }
174
175 function vsub(form,status,ism,action){
176   if(!vol()){ return false; }
177   if(status<9||status==12){
178     band=form.BAND.options[form.BAND.selectedIndex].value;
179     if(band=="00"){
180       alert(pbc0425);
181       form.BAND.focus();
182       return false;
183     }
184   }
185
186   if((status>=0&&status<5)||(status==7)||(status>=5&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
187     if(!vnull(form.PT)) {       return false;   }
188     adt1=form.STD;
189     adt2=form.END;
190     stdt=adt1.value;
191     etdt=adt2.value;
192     syr=stdt.substring(0,4);
193     start_hy1=stdt.charAt(4);
194     smon=stdt.substring(5,7);
195     start_hy2=stdt.charAt(7);
196     sdy=stdt.substring(8,10);
197     eyr=etdt.substring(0,4);
198     end_hy1=etdt.charAt(4);
199     emon=etdt.substring(5,7);
200     end_hy2=etdt.charAt(7);
201     edy=etdt.substring(8,10);
202     today=new Date();
203     date=today.getDate();
204     month=today.getMonth()+1;
205     if(today.getYear()<2000)year=today.getYear()+1900;  else year=today.getYear();
206     nextYear=year+1;
207     if(!vnull(form.STD)){       return false;   }
208     if(!vnull(form.END)){       return false;   }
209     if(start_hy1!="/"||start_hy2!="/"){
210       alert(pbc0409);
211       form.STD.focus();
212       return false;
213     }
214     if(end_hy1!="/"||end_hy2!="/"){
215       alert(pbc0409);
216       form.END.focus();
217       return false;
218     }
219     if(smon>12||sdy>31||smon<=0||sdy<=0||(isNaN(smon)==true)||(isNaN(sdy)==true)||(isNaN(syr)==true)){
220       alert(pbc0409);
221       form.STD.focus();
222       return false;
223     }
224     if(emon>12||edy>31||emon<=0||edy<=0||(isNaN(emon)==true)||(isNaN(edy)==true)||(isNaN(eyr)==true)){
225       alert(pbc0409);
226       form.END.focus();
227       return false;
228     }
229     if(((smon==1||smon==3||smon==5||smon==7||smon==8||smon==10||smon==12)&&sdy>31)||(syr%4==0&&smon==2&&sdy>29)||(syr%4!=0&&smon==2&&sdy>28)||((smon==4||smon==6||smon==9||smon==11)&&sdy>30)){
230       alert(pbc0409);
231       form.STD.focus();
232       return false;
233     }
234     if(((emon==1||emon==3||emon==5||emon==7||emon==8||emon==10||emon==12)&&edy>31)||(eyr%4==0&&emon==2&&edy>29)||(eyr%4!=0&&emon==2&&edy>28)||((emon==4||emon==6||emon==9||emon==11)&&edy>30)){
235       alert(pbc0409);
236       form.END.focus();
237       return false;
238     }
239     if ((eyr==nextYear)&&(syr==year)) {
240       if ((emon>1)||(edy >31)) {
241         alert(pbc0401);
242         form.END.focus();
243         return false;
244       }
245     } else {
246
247       if ((syr!=eyr)){
248         alert(pbc0406);
249         form.STD.focus();
250         return false;
251       }
252       if(smon>emon||(smon==emon&&sdy>=edy)){
253         alert(pbc0402);
254         form.STD.focus();
255         return false;
256       }
257       if((eyr!=year)&&(eyr!=year-1)){
258         alert(pbc0405);
259         form.END.focus();
260         return false;
261       }
262     }
263     if(ism=='YES'&&(status==5||status==6||status==12)){
264       if(ddif(month,date,year,emon,edy,eyr)>31){
265         alert(pbc0421);
266         form.END.focus();
267         return false;
268       }
269     }
270     if((status>2&&status<5)||(status==7)||((status>=5&&status<9||status==12)&&ism=="YES")){
271       if(status!=5){
272         if(!vdt(form.IRD1)){
273           return false;
274         }
275         if(!vdt(form.IRD2)){
276           return false;
277         }
278         if(!vdt(form.IRD3)){
279           return false;
280         }
281         ird1=form.IRD1.value;
282         ird2=form.IRD2.value;
283         ird3=form.IRD3.value;
284         if(((ird1==ird2)&&(!ird1.match(/^\s*$/)))||((ird1==ird3)&&(!ird1.match(/^\s*$/)))){
285           alert(pbc0417);
286           form.IRD1.focus();
287           return false;
288         }
289         else if((ird2==ird3)&&(!ird2.match(/^\s*$/))){
290           alert(pbc0417);
291           form.IRD2.focus();
292           return false;
293         }
294         if(!vdt(form.FRD1)){ return false;}
295       }
296       if(status==5){
297         if(!vdt(form.IRD1)){return false;}
298         if(!vdt(form.IRD2)){return false;}
299         if(!vdt(form.IRD3)){return false;}
300         ird1=form.IRD1.value;
301         ird2=form.IRD2.value;
302         ird3=form.IRD3.value;
303         if(((ird1==ird2)&&(!ird1.match(/^\s*$/)))||((ird1==ird3)&&(!ird1.match(/^\s*$/)))){
304           alert(pbc0417);
305           form.IRD1.focus();
306           return false;
307         }
308         else if((ird2==ird3)&&(!ird2.match(/^\s*$/))){
309           alert(pbc0417);
310           form.IRD2.focus();
311           return false;
312         }
313         if(!vkdt(form.FRD1)){
314           return false;
315         }
316       }
317     }
318   }
319   if((status>=0&&status<2)||(status==3)||(status==7)||(status>=2&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
320     if(!vnull(form.WO)){
321       return false;
322     }
323     if(!vnull(form.EO)){
324       return false;
325     }
326     if(!vnull(form.TO)){
327       return false;
328     }
329   }
330   if((status==2||status==4)||(status>=5&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
331     if(!vnull(form.WR)){return false;}
332     if(!vnull(form.ER)){return false;}
333     if(!vnull(form.TR)){return false;}
334   }
335   if((status==5||status==6||status==12)&&ism=="YES"){
336     if(!vkdt(form.FRD1)){return false;}
337     frdt=form.FRD1.value;
338     fryr=frdt.substring(0,4);
339     frmn=frdt.substring(5,7);
340     frdy=frdt.substring(8,10);
341     if(fryr<syr||(fryr==syr&&frmn<smon)||(fryr==syr&&frmn==smon&&frdy<=sdy)){
342       alert(pbc0410);
343       form.FRD1.focus();
344       return false;
345     }
346     if((status==5||status==6||status==12)&&ism=="YES"){
347       isnh="";
348       for(i=0; i<form.INH.length; i++){
349         if(form.INH[i].checked==true){ isnh=form.INH[i].value; }
350       }
351       if(isnh==""){
352         alert(pbc0424);
353         form.INH[1].focus();
354         return false;
355       }
356       if(isnh=="Y"){
357         beh="";
358         for(i=0; i<form.NHB.length; i++){
359           if(form.NHB[i].checked==true){ beh=form.NHB[i].value; }
360         }
361         skl="";
362         for(i=0; i<form.NHS.length; i++){
363           if(form.NHS[i].checked==true){ skl=form.NHS[i].value; }
364         }
365         if(beh==""){
366           alert(pbc0408);
367           form.NHB[0].focus();
368           return false;
369         }
370         if(skl==""){
371           alert(pbc0426);
372           form.NHS[0].focus();
373           return false;
374         }
375         if((beh=="N"||skl=="N")&&status!=12){
376           if(form.RCD[3].checked==false){
377             if(confirm(pbc0455))srdb(form.RCD,"4");
378             else {
379               form.NHB[0].focus();
380               return false;
381             }}}}}
382     rating="";
383     if(status!=12){ for(i=0; i<form.RCD.length; i++){ if(form.RCD[i].checked==true)rating=form.RCD[i].value; } }
384     else if(status==12){ rating="4"; }
385     if(rating==""){
386       alert(pbc0428);
387       form.RCD[0].focus();
388       return false;
389     }
390     if(rating=="4"){
391       if(!vkdt(form.SID)){ return false; }
392       idt=form.SID.value;
393       iyr=idt.substring(0,4);
394       imon=idt.substring(5,7);
395       idy=idt.substring(8,10);
396       frdt=form.FRD1.value;
397       fryr=frdt.substring(0,4);
398       frmn=frdt.substring(5,7);
399       frdy=frdt.substring(8,10);
400       if(iyr<eyr||(iyr==eyr&&imon<emon)||(iyr==eyr&&imon==emon&&idy<=edy)){
401         alert(pbc0415);
402         form.SID.focus();
403         return false;
404       }
405       if(iyr<fryr||(iyr==fryr&&imon<frmn)||(iyr==fryr&&imon==frmn&&idy<=frdy)){
406         alert(pbc0427);
407         form.SID.focus();
408         return false;
409       }
410       if(ddif(emon,edy,eyr,imon,idy,iyr)<30){
411         alert(pbc0416);
412         form.SID.focus();
413         return false;
414       }
415       if(ddif(emon,edy,eyr,imon,idy,iyr)>90){
416         if(!confirm(pbc0439+" "+pbc0442)){
417           form.SID.focus();
418           return false;
419         }}} else {
420 // MK/06-20-01 = If Rating Not equals to 4 blank out the sustained improve Date
421       form.SID.value="";
422     }
423     if(!vnull(form.OAT)){ return false; }
424     if(form.MSRQ.checked==true){
425       if(form.NEW_SIGN_MGR_ID.value.match(/^\s*$/)){
426         alert(pbc0418);
427         form.NEW_SIGN_MGR_ID.focus();
428         return false;
429       }
430       if(vnid(form.NEW_SIGN_MGR_ID)==false){    return false; }
431     } else {
432       if(!form.NEW_SIGN_MGR_ID.value.match(/^\s*$/)){
433         alert(pbc0422);
434         form.NEW_SIGN_MGR_ID.focus();
435         return false;
436       }
437       if ( (form.TOC.value=="YES") && (form.RSRQ.checked==true) ) {
438         alert(pbc0429);
439         form.NEW_SEC_LINE_REV_ID.focus();
440         return false;
441       }
442     }
443     if(form.RSRQ.checked==true){
444       if(form.NEW_SEC_LINE_REV_ID.value.match(/^\s*$/)){
445         alert(pbc0418);
446         form.NEW_SEC_LINE_REV_ID.focus();
447         return false;
448       }
449       if(vnid(form.NEW_SEC_LINE_REV_ID)==false){        return false; }
450     } else {
451       if(!form.NEW_SEC_LINE_REV_ID.value.match(/^\s*$/)) {
452         alert(pbc0423);
453         form.NEW_SEC_LINE_REV_ID.focus();
454         return false;
455       }
456       if ( (form.TOC.value=="YES") && (form.MSRQ.checked==true) ) {
457         alert(pbc0431);
458         form.NEW_SEC_LINE_REV_ID.focus();
459         return false;
460       }}}
461   if(status!=9){
462 /**for returned objectives **/
463     if(status==3){
464       if(conf(pbc0466) == false) return false;
465     }
466
467     if(ism=='NO'){
468       if(status==0||status==1||status==3||status==7){
469         if(conf(pbc0456) == false) return false;
470       }
471
472       if(status==2||status==4||status==8){
473         if(conf(pbc0457) == false) return false;
474       }
475     } else if(ism=='YES'){
476       if(status==0||status==1||status==3||status==7){
477         if(conf(pbc0458) == false)return false;
478       }
479       if(status==2||status==4||status==8){
480         if(conf(pbc0459) == false)return false;
481       }
482       if(status==5||status==6){
483         if(form.ESRQ.checked==false){
484           if(conf(pbc0460) == false)return false;
485         } else {
486           if(conf(pbc0461) == false)return false;
487         }}}}
488   if(status==9){
489     if(ism=='NO'){
490       if(conf(pbc0462) == false)return false;
491     } else if(ism=='YES'){
492       if(conf(pbc0463) == false)return false;
493     } else if(ism=='REVIEWER'){
494       if(conf(pbc0464) == false)return false;
495     }}
496   sact(action);
497   if(status>=9&&status<=11){ snul(); }
498   form.submit();
499   return true;
500 }
501
502 function vsav(form,status,ism,action) {
503   if(!vol()){ return false; }
504   adt1=form.STD;
505   adt2=form.END;
506   stdt=adt1.value;
507   etdt=adt2.value;
508   syr=stdt.substring(0,4);
509   start_hy1=stdt.charAt(4);
510   smon=stdt.substring(5,7);
511   start_hy2=stdt.charAt(7);
512   sdy=stdt.substring(8,10);
513   eyr=etdt.substring(0,4);
514   end_hy1=etdt.charAt(4);
515   emon=etdt.substring(5,7);
516   end_hy2=etdt.charAt(7);
517   edy=etdt.substring(8,10);
518   today=new Date();
519   date=today.getDate();
520   month=today.getMonth()+1;
521   if(today.getYear()<2000) year=today.getYear()+1900; else year=today.getYear();
522   nextYear=year+1;
523   if(!vnull(form.STD)) return false;
524   if(!vnull(form.END)) return false;
525   if(start_hy1!="/"||start_hy2!="/"){
526     alert(pbc0409);
527     form.STD.focus();
528     return false;
529   }
530   if(end_hy1!="/"||end_hy2!="/"){
531     alert(pbc0409);
532     form.END.focus();
533     return false;
534   }
535   if(smon>12||sdy>31||smon<=0||sdy<=0||(isNaN(smon)==true)||(isNaN(sdy)==true)||(isNaN(syr)==true)){
536     alert(pbc0409);
537     form.STD.focus();
538     return false;
539   }
540   if(emon>12||edy>31||emon<=0||edy<=0||(isNaN(emon)==true)||(isNaN(edy)==true)||(isNaN(eyr)==true)){
541     alert(pbc0409);
542     form.END.focus();
543     return false;
544   }
545   if(((smon==1||smon==3||smon==5||smon==7||smon==8||smon==10||smon==12)&&sdy>31)||(syr%4==0&&smon==2&&sdy>29)||(syr%4!=0&&smon==2&&sdy>28)||((smon==4||smon==6||smon==9||smon==11)&&sdy>30)){
546     alert(pbc0409);
547     form.STD.focus();
548     return false;
549   }
550   if(((emon==1||emon==3||emon==5||emon==7||emon==8||emon==10||emon==12)&&edy>31)||(eyr%4==0&&emon==2&&edy>29)||(eyr%4!=0&&emon==2&&edy>28)||((emon==4||emon==6||emon==9||emon==11)&&edy>30)){
551     alert(pbc0409);
552     form.END.focus();
553     return false;
554   }
555   if ((eyr==nextYear)&&(syr==year)) {
556     if ((emon>1)||(edy >31)) {
557       alert(pbc0401);
558       form.END.focus();
559       return false;
560     }
561   } else {
562     if ((syr<year-1) || (syr>year)) {
563       alert(pbc0407);
564       form.STD.focus();
565       return false;
566     }
567     if((eyr!=year)&&(eyr!=year-1)){
568       alert(pbc0405);
569       form.END.focus();
570       return false;
571     }
572     if(smon>emon||(smon==emon&&sdy>=edy)){
573       alert(pbc0403);
574       form.STD.focus();
575       return false;
576     }
577   }
578   if((status>2&&status<5)||(status>=5&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
579     if(!vdt(form.IRD1)){return false;}
580     if(!vdt(form.IRD2)){return false;}
581     if(!vdt(form.IRD3)){        return false;   }
582     ird1=form.IRD1.value;
583     ird2=form.IRD2.value;
584     ird3=form.IRD3.value;
585     if(((ird1==ird2)&&(!ird1.match(/^\s*$/)))||((ird1==ird3)&&(!ird1.match(/^\s*$/)))){
586       alert(pbc0417);
587       form.IRD1.focus();
588       return false;
589     }
590     else if((ird2==ird3)&&(!ird2.match(/^\s*$/))){
591       alert(pbc0417);
592       form.IRD2.focus();
593       return false;
594     }
595     if(!vdt(form.FRD1)){return false;}
596     if(ism=="YES"){
597       if(!vdt(form.FRD1)){return false;}
598     }
599   }
600   if((status==5||status==6)&&ism=="YES"){
601     rating="";
602     for(i=0;i<form.RCD.length;i++){
603       if(form.RCD[i].checked==true)rating=form.RCD[i].value;
604     }
605     isnh="";
606     for(i=0; i<form.INH.length; i++){
607       if(form.INH[i].checked==true){
608         isnh=form.INH[i].value;
609       }
610     }
611     if(isnh=="Y"){
612       beh="";
613       for(i=0; i<form.NHB.length;i++){
614         if(form.NHB[i].checked==true){
615           beh=form.NHB[i].value;
616         }
617       }
618       skl="";
619       for(i=0; i<form.NHS.length;i++){
620         if(form.NHS[i].checked==true){
621           skl=form.NHS[i].value;
622         }
623       }
624       if((beh=="N"||skl=="N")&&rating!=""){
625         if(form.RCD[3].checked==false){
626           if(confirm(pbc0455))srdb(form.RCD,"4");
627           else {
628             form.NHB[0].focus();
629             return false;
630           }
631         }
632       }
633       if(!vdt(form.SID)){       return false;}
634     }
635   }
636   if((status==2||status==4 || status==8 || status==5 || status==6 || status==10)&&ism=='YES')
637   {
638     if(!confirm(pbc0436)){      return false;}
639     if(form.OBJECTIVE_CHANGED.value=='Y') {
640       if(confirm(pbc0452+" "+pbc0453+" "+pbc0454)){form.MRQ.value=4; } else { form.MRQ.value=0; }
641     }else if (( status==5 || status==6 || status==10) && (form.RESULTS_CHANGED.value=='Y')) {
642       if(confirm(pbc0470+" "+pbc0453+" "+pbc0454)){form.MRQ.value=8; } else { form.MRQ.value=0; }
643     }
644   }
645   sact(action);
646   if(status>=9&&status<=11){
647     snul();
648   }
649   form.submit();
650   return true;
651 }
652 function cft(formfield){
653   nid=formfield.value;
654   if(nid.match(/^\s*$/)){
655     alert(pbc0419);
656     formfield.focus();
657     return false;
658   }
659   nl=nid.split('/').length;
660   if(nl!=2&&nl!=3){
661     alert(pbc0420);
662     formfield.focus();
663     return false;
664   }
665   return true;
666 }
667 function dcf(form,pbcId,cnum,sequence,status,atyp,ver){
668   if(!vol()){}
669   dflg=confirm("\n\n<====================== " + pbc0468 + " ======================>\n\n" + pbc0469 + "\n\n<==================================================================>");
670   if(dflg==true) {
671     form.ATYP.value=atyp;
672     form.PID.value=pbcId;
673     form.CNUM.value=cnum;
674     form.SEQ.value=sequence;
675     form.ST.value=status;
676     form.VER.value=ver;
677     form.submit();
678   }
679
680 }
681
682
683
684 function lop(){
685 //if(confirm(pbc0447+" "+pbc0451)){
686   sck("timer","");
687   sck("PBC_AUTH4","");
688   sck("IBM004","");
689   this.close();
690 //}
691
692 }
693
694 function csrlop(){
695   top.location="logoff.jsp";
696 }
697 function lof(){
698   csr=gck("IBM004");
699   if(csr==null){ top.location="logoff.jsp";  }
700   else if(csr.charAt(0)==3){ window.location="csrlogoff.jsp"; }
701   else{ top.location="logoff.jsp";  }
702 }
703
704 function goToHome(){
705   top.location="pbcmain.jsp";
706 }
707
708 function docsr(){
709   sck("IBM004","1^NONE^1");
710   window.location="pbcmain.jsp"
711     }
712
713 function ccd(){
714   if(confirm(pbc0434)){
715     if(navigator.appName!="Netscape"){
716       if(!window.navigator.onLine){
717         window.close();
718       }
719       else {
720         window.location='pbcmain.jsp';
721       }
722     }
723     else {
724       window.location='pbcmain.jsp';
725     }
726   }
727 }
728
729 function crt(form,action){
730   if(!vol()){return false;}
731   band=form.BAND.options[form.BAND.selectedIndex].value;
732   if(band=="00"){
733     alert(pbc0425);
734     form.BAND.focus();
735     return false;
736   }
737   if(!confirm(pbc0450)){return false;}
738   sact(action);
739   form.submit();
740   return true;
741 }
742 function cusat(form,action){
743   if(!vol()){return false;}
744   sact(action);
745   form.action="unsatreq.jsp";
746   form.submit();
747   return true;
748 }
749 function cfrt(form,ism,action){
750   if(!vol()){return false;}
751   sact(action);
752   if(ism=="NO"){
753     if(confirm(pbc0449+" "+pbc0432)){
754       snul();
755       form.submit();
756       return true;
757     }
758   }
759   if(ism=="REVIEWER"){
760     if(confirm(pbc0449+" "+pbc0448)){
761       snul();
762       form.submit();
763       return true;
764     }
765   }
766   if(ism=="YES"){
767     if(confirm(pbc0440)){
768       snul();
769       form.submit();
770       return true;
771     }
772   }
773 }
774
775 function cces(form){
776   if(form.ESRQ.checked==true){
777     if(!confirm(pbc0435+" "+pbc0443))form.ESRQ.checked=false;
778     else {form.ESRQ.checked=true;}
779   }
780 }
781
782 function ccms(form){
783   if(form.MSRQ.checked==true){
784     if(!confirm(pbc0441+" "+pbc0438+" "+pbc0444+" "+pbc0445))form.MSRQ.checked=false;
785     else {
786       form.MSRQ.checked=true;
787     }
788   }
789 }
790
791 function ccrs(form){
792   if(form.RSRQ.checked==true){
793     if(!confirm(pbc0441+" "+pbc0438+" "+pbc0444+" "+pbc0446))form.RSRQ.checked=false;
794     else {
795       form.RSRQ.checked=true;
796     }
797   }
798 }
799
800 function seo(){
801   alert(pbc0412+" "+pbc0413+" "+pbc0414);
802 }
803 function cows(form,action){
804   if(!vol()){
805     return false;
806   }
807   if(confirm(pbc0437)){
808     sact(action);
809     form.submit();
810     return true;
811   }
812 }
813
814 function srdb(rdb,value) {
815   for(i=0; i<rdb.length;i++) {
816     if(rdb[i].value == value) {
817       rdb[i].checked = true;
818       return true;
819     }
820   }
821   return true;
822 }
823
824 function slop(lbx,value) {
825   if(lbx.options.length > 0)  {
826     for(i=0;i < lbx.options.length;i++) {
827       if(lbx.options[i].value == value) {
828         lbx.options[i].selected = true;
829         return true;
830       }
831     }
832   }
833   return true;
834 }
835
836 function ourl(URL,WIN_NAME){
837   if(!vol()){ return; }
838   var emp_win;
839   if(document.layers) {
840     child_screenX=window.screenX+50;
841     child_width=window.innerWidth-75;
842     child_height=window.innerHeight-75;
843     emp_win=window.open(URL,WIN_NAME,"screenX="+ child_screenX +",screenY=75,height="+ child_height +",width="+ child_width +",resizable,status,scrollbars");
844   } else{
845     child_width = screen.width-160;
846     child_height = screen.height-200;
847     emp_win=window.open(URL,WIN_NAME,"height="+ child_height +",width="+ child_width +",resizable=yes,status=no,scrollbars=yes");
848 //emp_win.moveTo(110,0);
849   }
850 //if (URL.indexOf("pbcsitehelp")==-1) { alert("Opened new window."); }
851   emp_win.focus();
852 }
853
854 function dnh(form){
855   form.NHS[0].checked=false;
856   form.NHS[1].checked=false;
857   form.NHB[0].checked=false;
858   form.NHB[1].checked=false;
859 }
860
861 function cnh(form){
862   isnh="";
863   for(i=0; i<form.INH.length;i++)
864   {
865     if(form.INH[i].checked==true){isnh=form.INH[i].value; }
866   }
867   if(isnh != 'Y'){
868     form.NHS[0].checked=false;
869     form.NHS[1].checked=false;
870     form.NHB[0].checked=false;
871     form.NHB[1].checked=false;
872     return false;
873   }
874   else
875   {
876     //if ((form.NHS[0].checked || form.NHS[1].checked) && (form.NHB[0].checked || form.NHB[1].checked))
877     if (form.NHS[1].checked || form.NHB[1].checked )
878     {
879       form.RCD[3].checked=true;
880       return true;
881     }
882     return false;
883   }
884 }
885
886 function err(errMsg) {
887   alert(getEncodedText(errMsg));
888 }
889
890 function getEncodedText(txtValue) {
891   if (txtValue.match(/^\s*$/)) return txtValue;
892   var txtValue1 = txtValue.replace((/&quot;/g),'"');
893   var txtValue2 = txtValue1.replace((/&gt;/g),">");
894   var txtValue3 = txtValue2.replace((/&lt;/g),"<");
895   return txtValue3;
896 }
897
898 function encodeText(txtValue) {
899   if (txtValue.match(/^\s*$/)) return txtValue;
900   var txtValue0 = txtValue.replace((/\r\n/g),'&lf;');
901   var txtValue1 = txtValue0.replace((/"/g),'&quot;');
902 var txtValue2 = txtValue1.replace((/>/g),'&gt;');
903 var txtValue3 = txtValue2.replace((/</g),'&lt;');
904 return txtValue3;
905 }
906
907
908 function gck(name){
909 result = null;
910 mck = " " + document.cookie + ";";
911 srcnm = " " + name + "=";
912 scok = mck.indexOf(srcnm);
913 if(scok != -1){
914 scok += srcnm.length;
915 eofck = mck.indexOf(";",scok);
916 result = unescape(mck.substring(scok,eofck));
917 }
918 return(result);
919 }
920
921 function sck(name,value){
922 ckpth="path=/;domain=.ibm.com";
923 document.cookie = name + "=" + value + ";" + ckpth;
924 }
925
926
927 function testForCookie(){
928         sck("PBCTest","test");
929         if(gck("PBCTest") == "test") {
930                 //      alert("Cookie test is good");
931                         return true;
932                         }
933                 else {
934                 //      alert("Cookie test is bad");
935                         return false;
936                         }
937         }
938
939
940 function prn(form,l_status,l_ism,l_scf,l_locale){
941 status = l_status;
942 ism = l_ism;
943 scf = l_scf;
944 pwin=window.open("printvw.jsp?nls="+l_locale + "ISNEWWIN=TRUE","pwin","resizable=yes,width=560,height=400,scrollbars=yes,toolbar,screenX=5,screenY=5");
945 }
946
947 function gsno(form){
948 unum=form.UNUM.value;
949 eofsn=unum.length-3;
950 cnum=unum.substring(0,eofsn);
951 return(cnum);
952 }
953
954 function conf(msg){
955 return top.confirm(msg);
956 }
957
958 function sact(action){
959 document.PBC_FORM.ATYP.value=action;
960 }
961
962 function snul(){
963 document.PBC_FORM.WO.value="";
964 document.PBC_FORM.WR.value="";
965 document.PBC_FORM.EO.value="";
966 document.PBC_FORM.ER.value="";
967 document.PBC_FORM.TO.value="";
968 document.PBC_FORM.TR.value="";
969 document.PBC_FORM.OAT.value="";
970 }
971
972 function gcnum(){
973 unum=document.PBC_FORM.UNUM.value;
974 eofsn=unum.length-3;
975 cnum=unum.substring(0,eofsn);
976 return(cnum);
977 }
978 function checkForEditPage() {
979  if(true==checkForm()){
980    if(!confirm(pbc0465)) return false;
981  }
982  return true;
983 }
984
985 function checkForm() {
986   var frms=document.forms["PBC_FORM"];
987   if (navigator.appName=="Netscape") {
988     if (frms==undefined) return false;
989     if (frms.IS_EDIT==undefined) return false;
990   } else {
991     if(frms==null) return false;
992     if (frms.IS_EDIT==null) return false;
993   }
994   return true;
995 }
996
997
998
999 function removeAnchor(link){
1000 link2 = link;
1001 indx = link.indexOf('#');
1002 while (indx!=-1)
1003 {
1004 link2 = link.substring(0,indx);
1005 indx=link2.indexOf("#");
1006
1007
1008 }
1009 return link2;
1010 }
1011
1012 function gotoHREF(link){
1013 if(document.layers){
1014 var documentURL = removeAnchor(document.URL);
1015 location.href=documentURL+link;
1016 return true;
1017
1018 }else{
1019 var documentURL = removeAnchor(document.URL);
1020 document.URL=documentURL+link;
1021
1022
1023 }
1024
1025
1026 }
1027
1028 function init_resize_event(){
1029 }
1030
1031 function putVal2ck()
1032 {
1033 }
1034
1035 function setValuesFromCookie()
1036 {
1037 }
1038
1039 reportCompare('No Crash', 'No Crash', '');