Bug 469739 - Add support for displaying Vista UAC shield icon; r=joe sr=vladimir
[wine-gecko.git] / js / tests / js1_5 / Regress / regress-216320.js
blobedf33e9e50f775aa049bc3b2ac643fe9830721a7
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
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/
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.
15 * The Original Code is JavaScript Engine testing utilities.
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.
22 * Contributor(s):
23 * brendan@mozilla.org, pschwartau@netscape.com
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.
37 * ***** END LICENSE BLOCK ***** */
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
46 //-----------------------------------------------------------------------------
47 var gTestfile = 'regress-216320.js';
48 var BUGNUMBER = 216320;
49 var summary = "Just seeing we don't crash on this code";
51 printBugNumber(BUGNUMBER);
52 printStatus(summary);
55 /* TESTCASE BEGINS HERE */
56 status=0;
57 ism='NO';
58 scf='N';
60 function vol(){
61 if(navigator.appName!="Netscape"){ if(!window.navigator.onLine){ alert(pbc0430); return false; } }
62 return true; }
64 function vnid(formfield){
65 nid=formfield.value;
66 if(!nid.match(/^\s*$/)){
67 nl=nid.split('/').length;
68 if(nl!=2&&nl!=3){
69 alert(pbc0420);
70 formfield.focus();
71 return false;
72 }}}
74 function vnull(formfield){
75 text=formfield.value;
76 if(text.match(/^\s*$/)){
77 alert(pbc0425);
78 formfield.focus();
79 return false;
81 return true;
84 function vdt(formfield){
85 date=formfield.value;
86 //MM/DD/YYYY
87 //YYYY/MM/DD
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*$/)) {return true; }
100 if(hy1!="/"||hy2!="/"){
101 alert(pbc0409);
102 formfield.focus();
103 return false;
105 if(month>12||day>31||month<=0||day<=0||(isNaN(month)==true)||(isNaN(day)==true)||(isNaN(year)==true)){
106 alert(pbc0409);
107 formfield.focus();
108 return false;
111 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)){
112 alert(pbc0409);
113 formfield.focus();
114 return false;
116 return true;
119 function vkdt(formfield){
120 date=formfield.value;
121 year=date.substring(0,4);
122 hy1=date.charAt(4);
123 month=date.substring(5,7);
124 hy2=date.charAt(7);
125 day=date.substring(8,10);
126 today=new Date();
127 tdy=today.getDate();
128 tmn=today.getMonth()+1;
129 if(today.getYear()<2000)tyr=today.getYear()+1900;
130 else tyr=today.getYear();
131 if(date.match(/^\s*$/)){
132 alert(pbc0425);
133 formfield.focus();
134 return false;
136 if(hy1!="/"||hy2!="/"){
137 alert(pbc0409);
138 formfield.focus();
139 return false;
142 if(month>12||day>31||month<=0||day<=0||(isNaN(month)==true)||(isNaN(day)==true)||(isNaN(year)==true)){
143 alert(pbc0409);
144 formfield.focus();
145 return false;
148 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)){
149 alert(pbc0409);
150 formfield.focus();
151 return false;
153 return true;
156 function ddif(month1,day1,year1,month2,day2,year2){
157 start = new Date();
158 start.setYear(year1);
159 start.setMonth(month1-1);
160 start.setDate(day1);
161 start.setMinutes(0);
162 start.setHours(0);
163 start.setSeconds(0);
164 end = new Date();
165 end.setYear(year2);
166 end.setMonth(month2-1);
167 end.setDate(day2);
168 end.setMinutes(0);
169 end.setHours(0);
170 end.setSeconds(0);
171 current =(end.getTime() - start.getTime());
172 days = Math.floor(current /(1000 * 60 * 60 * 24));
173 return(days);
176 function vsub(form,status,ism,action){
177 if(!vol()){ return false; }
178 if(status<9||status==12){
179 band=form.BAND.options[form.BAND.selectedIndex].value;
180 if(band=="00"){
181 alert(pbc0425);
182 form.BAND.focus();
183 return false;
187 if((status>=0&&status<5)||(status==7)||(status>=5&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
188 if(!vnull(form.PT)) { return false; }
189 adt1=form.STD;
190 adt2=form.END;
191 stdt=adt1.value;
192 etdt=adt2.value;
193 syr=stdt.substring(0,4);
194 start_hy1=stdt.charAt(4);
195 smon=stdt.substring(5,7);
196 start_hy2=stdt.charAt(7);
197 sdy=stdt.substring(8,10);
198 eyr=etdt.substring(0,4);
199 end_hy1=etdt.charAt(4);
200 emon=etdt.substring(5,7);
201 end_hy2=etdt.charAt(7);
202 edy=etdt.substring(8,10);
203 today=new Date();
204 date=today.getDate();
205 month=today.getMonth()+1;
206 if(today.getYear()<2000)year=today.getYear()+1900; else year=today.getYear();
207 nextYear=year+1;
208 if(!vnull(form.STD)){ return false; }
209 if(!vnull(form.END)){ return false; }
210 if(start_hy1!="/"||start_hy2!="/"){
211 alert(pbc0409);
212 form.STD.focus();
213 return false;
215 if(end_hy1!="/"||end_hy2!="/"){
216 alert(pbc0409);
217 form.END.focus();
218 return false;
220 if(smon>12||sdy>31||smon<=0||sdy<=0||(isNaN(smon)==true)||(isNaN(sdy)==true)||(isNaN(syr)==true)){
221 alert(pbc0409);
222 form.STD.focus();
223 return false;
225 if(emon>12||edy>31||emon<=0||edy<=0||(isNaN(emon)==true)||(isNaN(edy)==true)||(isNaN(eyr)==true)){
226 alert(pbc0409);
227 form.END.focus();
228 return false;
230 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)){
231 alert(pbc0409);
232 form.STD.focus();
233 return false;
235 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)){
236 alert(pbc0409);
237 form.END.focus();
238 return false;
240 if ((eyr==nextYear)&&(syr==year)) {
241 if ((emon>1)||(edy >31)) {
242 alert(pbc0401);
243 form.END.focus();
244 return false;
246 } else {
248 if ((syr!=eyr)){
249 alert(pbc0406);
250 form.STD.focus();
251 return false;
253 if(smon>emon||(smon==emon&&sdy>=edy)){
254 alert(pbc0402);
255 form.STD.focus();
256 return false;
258 if((eyr!=year)&&(eyr!=year-1)){
259 alert(pbc0405);
260 form.END.focus();
261 return false;
264 if(ism=='YES'&&(status==5||status==6||status==12)){
265 if(ddif(month,date,year,emon,edy,eyr)>31){
266 alert(pbc0421);
267 form.END.focus();
268 return false;
271 if((status>2&&status<5)||(status==7)||((status>=5&&status<9||status==12)&&ism=="YES")){
272 if(status!=5){
273 if(!vdt(form.IRD1)){
274 return false;
276 if(!vdt(form.IRD2)){
277 return false;
279 if(!vdt(form.IRD3)){
280 return false;
282 ird1=form.IRD1.value;
283 ird2=form.IRD2.value;
284 ird3=form.IRD3.value;
285 if(((ird1==ird2)&&(!ird1.match(/^\s*$/)))||((ird1==ird3)&&(!ird1.match(/^\s*$/)))){
286 alert(pbc0417);
287 form.IRD1.focus();
288 return false;
290 else if((ird2==ird3)&&(!ird2.match(/^\s*$/))){
291 alert(pbc0417);
292 form.IRD2.focus();
293 return false;
295 if(!vdt(form.FRD1)){ return false;}
297 if(status==5){
298 if(!vdt(form.IRD1)){return false;}
299 if(!vdt(form.IRD2)){return false;}
300 if(!vdt(form.IRD3)){return false;}
301 ird1=form.IRD1.value;
302 ird2=form.IRD2.value;
303 ird3=form.IRD3.value;
304 if(((ird1==ird2)&&(!ird1.match(/^\s*$/)))||((ird1==ird3)&&(!ird1.match(/^\s*$/)))){
305 alert(pbc0417);
306 form.IRD1.focus();
307 return false;
309 else if((ird2==ird3)&&(!ird2.match(/^\s*$/))){
310 alert(pbc0417);
311 form.IRD2.focus();
312 return false;
314 if(!vkdt(form.FRD1)){
315 return false;
320 if((status>=0&&status<2)||(status==3)||(status==7)||(status>=2&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
321 if(!vnull(form.WO)){
322 return false;
324 if(!vnull(form.EO)){
325 return false;
327 if(!vnull(form.TO)){
328 return false;
331 if((status==2||status==4)||(status>=5&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
332 if(!vnull(form.WR)){return false;}
333 if(!vnull(form.ER)){return false;}
334 if(!vnull(form.TR)){return false;}
336 if((status==5||status==6||status==12)&&ism=="YES"){
337 if(!vkdt(form.FRD1)){return false;}
338 frdt=form.FRD1.value;
339 fryr=frdt.substring(0,4);
340 frmn=frdt.substring(5,7);
341 frdy=frdt.substring(8,10);
342 if(fryr<syr||(fryr==syr&&frmn<smon)||(fryr==syr&&frmn==smon&&frdy<=sdy)){
343 alert(pbc0410);
344 form.FRD1.focus();
345 return false;
347 if((status==5||status==6||status==12)&&ism=="YES"){
348 isnh="";
349 for(i=0; i<form.INH.length; i++){
350 if(form.INH[i].checked==true){ isnh=form.INH[i].value; }
352 if(isnh==""){
353 alert(pbc0424);
354 form.INH[1].focus();
355 return false;
357 if(isnh=="Y"){
358 beh="";
359 for(i=0; i<form.NHB.length; i++){
360 if(form.NHB[i].checked==true){ beh=form.NHB[i].value; }
362 skl="";
363 for(i=0; i<form.NHS.length; i++){
364 if(form.NHS[i].checked==true){ skl=form.NHS[i].value; }
366 if(beh==""){
367 alert(pbc0408);
368 form.NHB[0].focus();
369 return false;
371 if(skl==""){
372 alert(pbc0426);
373 form.NHS[0].focus();
374 return false;
376 if((beh=="N"||skl=="N")&&status!=12){
377 if(form.RCD[3].checked==false){
378 if(confirm(pbc0455))srdb(form.RCD,"4");
379 else {
380 form.NHB[0].focus();
381 return false;
382 }}}}}
383 rating="";
384 if(status!=12){ for(i=0; i<form.RCD.length; i++){ if(form.RCD[i].checked==true)rating=form.RCD[i].value; } }
385 else if(status==12){ rating="4"; }
386 if(rating==""){
387 alert(pbc0428);
388 form.RCD[0].focus();
389 return false;
391 if(rating=="4"){
392 if(!vkdt(form.SID)){ return false; }
393 idt=form.SID.value;
394 iyr=idt.substring(0,4);
395 imon=idt.substring(5,7);
396 idy=idt.substring(8,10);
397 frdt=form.FRD1.value;
398 fryr=frdt.substring(0,4);
399 frmn=frdt.substring(5,7);
400 frdy=frdt.substring(8,10);
401 if(iyr<eyr||(iyr==eyr&&imon<emon)||(iyr==eyr&&imon==emon&&idy<=edy)){
402 alert(pbc0415);
403 form.SID.focus();
404 return false;
406 if(iyr<fryr||(iyr==fryr&&imon<frmn)||(iyr==fryr&&imon==frmn&&idy<=frdy)){
407 alert(pbc0427);
408 form.SID.focus();
409 return false;
411 if(ddif(emon,edy,eyr,imon,idy,iyr)<30){
412 alert(pbc0416);
413 form.SID.focus();
414 return false;
416 if(ddif(emon,edy,eyr,imon,idy,iyr)>90){
417 if(!confirm(pbc0439+" "+pbc0442)){
418 form.SID.focus();
419 return false;
420 }}} else {
421 // MK/06-20-01 = If Rating Not equals to 4 blank out the sustained improve Date
422 form.SID.value="";
424 if(!vnull(form.OAT)){ return false; }
425 if(form.MSRQ.checked==true){
426 if(form.NEW_SIGN_MGR_ID.value.match(/^\s*$/)){
427 alert(pbc0418);
428 form.NEW_SIGN_MGR_ID.focus();
429 return false;
431 if(vnid(form.NEW_SIGN_MGR_ID)==false){ return false; }
432 } else {
433 if(!form.NEW_SIGN_MGR_ID.value.match(/^\s*$/)){
434 alert(pbc0422);
435 form.NEW_SIGN_MGR_ID.focus();
436 return false;
438 if ( (form.TOC.value=="YES") && (form.RSRQ.checked==true) ) {
439 alert(pbc0429);
440 form.NEW_SEC_LINE_REV_ID.focus();
441 return false;
444 if(form.RSRQ.checked==true){
445 if(form.NEW_SEC_LINE_REV_ID.value.match(/^\s*$/)){
446 alert(pbc0418);
447 form.NEW_SEC_LINE_REV_ID.focus();
448 return false;
450 if(vnid(form.NEW_SEC_LINE_REV_ID)==false){ return false; }
451 } else {
452 if(!form.NEW_SEC_LINE_REV_ID.value.match(/^\s*$/)) {
453 alert(pbc0423);
454 form.NEW_SEC_LINE_REV_ID.focus();
455 return false;
457 if ( (form.TOC.value=="YES") && (form.MSRQ.checked==true) ) {
458 alert(pbc0431);
459 form.NEW_SEC_LINE_REV_ID.focus();
460 return false;
462 if(status!=9){
463 /**for returned objectives **/
464 if(status==3){
465 if(conf(pbc0466) == false) return false;
468 if(ism=='NO'){
469 if(status==0||status==1||status==3||status==7){
470 if(conf(pbc0456) == false) return false;
473 if(status==2||status==4||status==8){
474 if(conf(pbc0457) == false) return false;
476 } else if(ism=='YES'){
477 if(status==0||status==1||status==3||status==7){
478 if(conf(pbc0458) == false)return false;
480 if(status==2||status==4||status==8){
481 if(conf(pbc0459) == false)return false;
483 if(status==5||status==6){
484 if(form.ESRQ.checked==false){
485 if(conf(pbc0460) == false)return false;
486 } else {
487 if(conf(pbc0461) == false)return false;
488 }}}}
489 if(status==9){
490 if(ism=='NO'){
491 if(conf(pbc0462) == false)return false;
492 } else if(ism=='YES'){
493 if(conf(pbc0463) == false)return false;
494 } else if(ism=='REVIEWER'){
495 if(conf(pbc0464) == false)return false;
497 sact(action);
498 if(status>=9&&status<=11){ snul(); }
499 form.submit();
500 return true;
503 function vsav(form,status,ism,action) {
504 if(!vol()){ return false; }
505 adt1=form.STD;
506 adt2=form.END;
507 stdt=adt1.value;
508 etdt=adt2.value;
509 syr=stdt.substring(0,4);
510 start_hy1=stdt.charAt(4);
511 smon=stdt.substring(5,7);
512 start_hy2=stdt.charAt(7);
513 sdy=stdt.substring(8,10);
514 eyr=etdt.substring(0,4);
515 end_hy1=etdt.charAt(4);
516 emon=etdt.substring(5,7);
517 end_hy2=etdt.charAt(7);
518 edy=etdt.substring(8,10);
519 today=new Date();
520 date=today.getDate();
521 month=today.getMonth()+1;
522 if(today.getYear()<2000) year=today.getYear()+1900; else year=today.getYear();
523 nextYear=year+1;
524 if(!vnull(form.STD)) return false;
525 if(!vnull(form.END)) return false;
526 if(start_hy1!="/"||start_hy2!="/"){
527 alert(pbc0409);
528 form.STD.focus();
529 return false;
531 if(end_hy1!="/"||end_hy2!="/"){
532 alert(pbc0409);
533 form.END.focus();
534 return false;
536 if(smon>12||sdy>31||smon<=0||sdy<=0||(isNaN(smon)==true)||(isNaN(sdy)==true)||(isNaN(syr)==true)){
537 alert(pbc0409);
538 form.STD.focus();
539 return false;
541 if(emon>12||edy>31||emon<=0||edy<=0||(isNaN(emon)==true)||(isNaN(edy)==true)||(isNaN(eyr)==true)){
542 alert(pbc0409);
543 form.END.focus();
544 return false;
546 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)){
547 alert(pbc0409);
548 form.STD.focus();
549 return false;
551 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)){
552 alert(pbc0409);
553 form.END.focus();
554 return false;
556 if ((eyr==nextYear)&&(syr==year)) {
557 if ((emon>1)||(edy >31)) {
558 alert(pbc0401);
559 form.END.focus();
560 return false;
562 } else {
563 if ((syr<year-1) || (syr>year)) {
564 alert(pbc0407);
565 form.STD.focus();
566 return false;
568 if((eyr!=year)&&(eyr!=year-1)){
569 alert(pbc0405);
570 form.END.focus();
571 return false;
573 if(smon>emon||(smon==emon&&sdy>=edy)){
574 alert(pbc0403);
575 form.STD.focus();
576 return false;
579 if((status>2&&status<5)||(status>=5&&status<9&&ism=="YES")||(status==12&&ism=="YES")){
580 if(!vdt(form.IRD1)){return false;}
581 if(!vdt(form.IRD2)){return false;}
582 if(!vdt(form.IRD3)){ return false; }
583 ird1=form.IRD1.value;
584 ird2=form.IRD2.value;
585 ird3=form.IRD3.value;
586 if(((ird1==ird2)&&(!ird1.match(/^\s*$/)))||((ird1==ird3)&&(!ird1.match(/^\s*$/)))){
587 alert(pbc0417);
588 form.IRD1.focus();
589 return false;
591 else if((ird2==ird3)&&(!ird2.match(/^\s*$/))){
592 alert(pbc0417);
593 form.IRD2.focus();
594 return false;
596 if(!vdt(form.FRD1)){return false;}
597 if(ism=="YES"){
598 if(!vdt(form.FRD1)){return false;}
601 if((status==5||status==6)&&ism=="YES"){
602 rating="";
603 for(i=0;i<form.RCD.length;i++){
604 if(form.RCD[i].checked==true)rating=form.RCD[i].value;
606 isnh="";
607 for(i=0; i<form.INH.length; i++){
608 if(form.INH[i].checked==true){
609 isnh=form.INH[i].value;
612 if(isnh=="Y"){
613 beh="";
614 for(i=0; i<form.NHB.length;i++){
615 if(form.NHB[i].checked==true){
616 beh=form.NHB[i].value;
619 skl="";
620 for(i=0; i<form.NHS.length;i++){
621 if(form.NHS[i].checked==true){
622 skl=form.NHS[i].value;
625 if((beh=="N"||skl=="N")&&rating!=""){
626 if(form.RCD[3].checked==false){
627 if(confirm(pbc0455))srdb(form.RCD,"4");
628 else {
629 form.NHB[0].focus();
630 return false;
634 if(!vdt(form.SID)){ return false;}
637 if((status==2||status==4 || status==8 || status==5 || status==6 || status==10)&&ism=='YES')
639 if(!confirm(pbc0436)){ return false;}
640 if(form.OBJECTIVE_CHANGED.value=='Y') {
641 if(confirm(pbc0452+" "+pbc0453+" "+pbc0454)){form.MRQ.value=4; } else { form.MRQ.value=0; }
642 }else if (( status==5 || status==6 || status==10) && (form.RESULTS_CHANGED.value=='Y')) {
643 if(confirm(pbc0470+" "+pbc0453+" "+pbc0454)){form.MRQ.value=8; } else { form.MRQ.value=0; }
646 sact(action);
647 if(status>=9&&status<=11){
648 snul();
650 form.submit();
651 return true;
653 function cft(formfield){
654 nid=formfield.value;
655 if(nid.match(/^\s*$/)){
656 alert(pbc0419);
657 formfield.focus();
658 return false;
660 nl=nid.split('/').length;
661 if(nl!=2&&nl!=3){
662 alert(pbc0420);
663 formfield.focus();
664 return false;
666 return true;
668 function dcf(form,pbcId,cnum,sequence,status,atyp,ver){
669 if(!vol()){}
670 dflg=confirm("\n\n<====================== " + pbc0468 + " ======================>\n\n" + pbc0469 + "\n\n<==================================================================>");
671 if(dflg==true) {
672 form.ATYP.value=atyp;
673 form.PID.value=pbcId;
674 form.CNUM.value=cnum;
675 form.SEQ.value=sequence;
676 form.ST.value=status;
677 form.VER.value=ver;
678 form.submit();
685 function lop(){
686 //if(confirm(pbc0447+" "+pbc0451)){
687 sck("timer","");
688 sck("PBC_AUTH4","");
689 sck("IBM004","");
690 this.close();
695 function csrlop(){
696 top.location="logoff.jsp";
698 function lof(){
699 csr=gck("IBM004");
700 if(csr==null){ top.location="logoff.jsp"; }
701 else if(csr.charAt(0)==3){ window.location="csrlogoff.jsp"; }
702 else{ top.location="logoff.jsp"; }
705 function goToHome(){
706 top.location="pbcmain.jsp";
709 function docsr(){
710 sck("IBM004","1^NONE^1");
711 window.location="pbcmain.jsp"
714 function ccd(){
715 if(confirm(pbc0434)){
716 if(navigator.appName!="Netscape"){
717 if(!window.navigator.onLine){
718 window.close();
720 else {
721 window.location='pbcmain.jsp';
724 else {
725 window.location='pbcmain.jsp';
730 function crt(form,action){
731 if(!vol()){return false;}
732 band=form.BAND.options[form.BAND.selectedIndex].value;
733 if(band=="00"){
734 alert(pbc0425);
735 form.BAND.focus();
736 return false;
738 if(!confirm(pbc0450)){return false;}
739 sact(action);
740 form.submit();
741 return true;
743 function cusat(form,action){
744 if(!vol()){return false;}
745 sact(action);
746 form.action="unsatreq.jsp";
747 form.submit();
748 return true;
750 function cfrt(form,ism,action){
751 if(!vol()){return false;}
752 sact(action);
753 if(ism=="NO"){
754 if(confirm(pbc0449+" "+pbc0432)){
755 snul();
756 form.submit();
757 return true;
760 if(ism=="REVIEWER"){
761 if(confirm(pbc0449+" "+pbc0448)){
762 snul();
763 form.submit();
764 return true;
767 if(ism=="YES"){
768 if(confirm(pbc0440)){
769 snul();
770 form.submit();
771 return true;
776 function cces(form){
777 if(form.ESRQ.checked==true){
778 if(!confirm(pbc0435+" "+pbc0443))form.ESRQ.checked=false;
779 else {form.ESRQ.checked=true;}
783 function ccms(form){
784 if(form.MSRQ.checked==true){
785 if(!confirm(pbc0441+" "+pbc0438+" "+pbc0444+" "+pbc0445))form.MSRQ.checked=false;
786 else {
787 form.MSRQ.checked=true;
792 function ccrs(form){
793 if(form.RSRQ.checked==true){
794 if(!confirm(pbc0441+" "+pbc0438+" "+pbc0444+" "+pbc0446))form.RSRQ.checked=false;
795 else {
796 form.RSRQ.checked=true;
801 function seo(){
802 alert(pbc0412+" "+pbc0413+" "+pbc0414);
804 function cows(form,action){
805 if(!vol()){
806 return false;
808 if(confirm(pbc0437)){
809 sact(action);
810 form.submit();
811 return true;
815 function srdb(rdb,value) {
816 for(i=0; i<rdb.length;i++) {
817 if(rdb[i].value == value) {
818 rdb[i].checked = true;
819 return true;
822 return true;
825 function slop(lbx,value) {
826 if(lbx.options.length > 0) {
827 for(i=0;i < lbx.options.length;i++) {
828 if(lbx.options[i].value == value) {
829 lbx.options[i].selected = true;
830 return true;
834 return true;
837 function ourl(URL,WIN_NAME){
838 if(!vol()){ return; }
839 var emp_win;
840 if(document.layers) {
841 child_screenX=window.screenX+50;
842 child_width=window.innerWidth-75;
843 child_height=window.innerHeight-75;
844 emp_win=window.open(URL,WIN_NAME,"screenX="+ child_screenX +",screenY=75,height="+ child_height +",width="+ child_width +",resizable,status,scrollbars");
845 } else{
846 child_width = screen.width-160;
847 child_height = screen.height-200;
848 emp_win=window.open(URL,WIN_NAME,"height="+ child_height +",width="+ child_width +",resizable=yes,status=no,scrollbars=yes");
849 //emp_win.moveTo(110,0);
851 //if (URL.indexOf("pbcsitehelp")==-1) { alert("Opened new window."); }
852 emp_win.focus();
855 function dnh(form){
856 form.NHS[0].checked=false;
857 form.NHS[1].checked=false;
858 form.NHB[0].checked=false;
859 form.NHB[1].checked=false;
862 function cnh(form){
863 isnh="";
864 for(i=0; i<form.INH.length;i++)
866 if(form.INH[i].checked==true){isnh=form.INH[i].value; }
868 if(isnh != 'Y'){
869 form.NHS[0].checked=false;
870 form.NHS[1].checked=false;
871 form.NHB[0].checked=false;
872 form.NHB[1].checked=false;
873 return false;
875 else
877 //if ((form.NHS[0].checked || form.NHS[1].checked) && (form.NHB[0].checked || form.NHB[1].checked))
878 if (form.NHS[1].checked || form.NHB[1].checked )
880 form.RCD[3].checked=true;
881 return true;
883 return false;
887 function err(errMsg) {
888 alert(getEncodedText(errMsg));
891 function getEncodedText(txtValue) {
892 if (txtValue.match(/^\s*$/)) return txtValue;
893 var txtValue1 = txtValue.replace((/&quot;/g),'"');
894 var txtValue2 = txtValue1.replace((/&gt;/g),">");
895 var txtValue3 = txtValue2.replace((/&lt;/g),"<");
896 return txtValue3;
899 function encodeText(txtValue) {
900 if (txtValue.match(/^\s*$/)) return txtValue;
901 var txtValue0 = txtValue.replace((/\r\n/g),'&lf;');
902 var txtValue1 = txtValue0.replace((/"/g),'&quot;');
903 var txtValue2 = txtValue1.replace((/>/g),'&gt;');
904 var txtValue3 = txtValue2.replace((/</g),'&lt;');
905 return txtValue3;
909 function gck(name){
910 result = null;
911 mck = " " + document.cookie + ";";
912 srcnm = " " + name + "=";
913 scok = mck.indexOf(srcnm);
914 if(scok != -1){
915 scok += srcnm.length;
916 eofck = mck.indexOf(";",scok);
917 result = unescape(mck.substring(scok,eofck));
919 return(result);
922 function sck(name,value){
923 ckpth="path=/;domain=.ibm.com";
924 document.cookie = name + "=" + value + ";" + ckpth;
928 function testForCookie(){
929 sck("PBCTest","test");
930 if(gck("PBCTest") == "test") {
931 // alert("Cookie test is good");
932 return true;
934 else {
935 // alert("Cookie test is bad");
936 return false;
941 function prn(form,l_status,l_ism,l_scf,l_locale){
942 status = l_status;
943 ism = l_ism;
944 scf = l_scf;
945 pwin=window.open("printvw.jsp?nls="+l_locale + "ISNEWWIN=TRUE","pwin","resizable=yes,width=560,height=400,scrollbars=yes,toolbar,screenX=5,screenY=5");
948 function gsno(form){
949 unum=form.UNUM.value;
950 eofsn=unum.length-3;
951 cnum=unum.substring(0,eofsn);
952 return(cnum);
955 function conf(msg){
956 return top.confirm(msg);
959 function sact(action){
960 document.PBC_FORM.ATYP.value=action;
963 function snul(){
964 document.PBC_FORM.WO.value="";
965 document.PBC_FORM.WR.value="";
966 document.PBC_FORM.EO.value="";
967 document.PBC_FORM.ER.value="";
968 document.PBC_FORM.TO.value="";
969 document.PBC_FORM.TR.value="";
970 document.PBC_FORM.OAT.value="";
973 function gcnum(){
974 unum=document.PBC_FORM.UNUM.value;
975 eofsn=unum.length-3;
976 cnum=unum.substring(0,eofsn);
977 return(cnum);
979 function checkForEditPage() {
980 if(true==checkForm()){
981 if(!confirm(pbc0465)) return false;
983 return true;
986 function checkForm() {
987 var frms=document.forms["PBC_FORM"];
988 if (navigator.appName=="Netscape") {
989 if (frms==undefined) return false;
990 if (frms.IS_EDIT==undefined) return false;
991 } else {
992 if(frms==null) return false;
993 if (frms.IS_EDIT==null) return false;
995 return true;
1000 function removeAnchor(link){
1001 link2 = link;
1002 indx = link.indexOf('#');
1003 while (indx!=-1)
1005 link2 = link.substring(0,indx);
1006 indx=link2.indexOf("#");
1010 return link2;
1013 function gotoHREF(link){
1014 if(document.layers){
1015 var documentURL = removeAnchor(document.URL);
1016 location.href=documentURL+link;
1017 return true;
1019 }else{
1020 var documentURL = removeAnchor(document.URL);
1021 document.URL=documentURL+link;
1029 function init_resize_event(){
1032 function putVal2ck()
1036 function setValuesFromCookie()
1040 reportCompare('No Crash', 'No Crash', '');