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