Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-216320.js

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