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