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