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