1isMessenger = !!isMessenger; 2var c = false; 3var j,m,calLocation,theYearObj,theDayObj,myDay,myMonth,myYear; 4var prevMonth,prevYear,subsequentMonth,subsequentYear,yOffset; 5var theElement = 'mydate1'; 6var thisClass="f"; 7var thisStyle = ""; 8var cVisible = false; 9var recurModEndCal = false; 10var gWeekDays= 7; // number of days 11var gNow = new Date(); 12 13gNow.setDate( todayDay); 14gNow.setMonth(todayMonth-1); 15gNow.setYear(todayYear); 16 17var vNowDay = gNow.getDate() ; 18var vNowMonth = gNow.getMonth(); 19var vNowYear = gNow.getFullYear(); 20var today; 21 22today = new Date(gNow); 23 24var dow = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; 25var months_short = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; 26var callCloseFunct = "Calendar.Close('" + this.gType + "','" + this.INLINE + "')"; 27var day_headers = [Su, Mo, Tu, We, Th, Fr, Sa, Su, Mo, Tu, We, Th, Fr]; //Objects come from Index pages that use localized text 28if (weekBeginsDay == "") weekBeginsDay = 0; 29 30weekBeginsDay = parseInt(weekBeginsDay); 31if (weekBeginsDay >= gWeekDays || weekBeginsDay < 0) 32 weekBeginsDay = 0; 33 34var day_header = copyDayHeaders(day_headers); 35 36 37function copyDayHeaders(day_headers){ 38 var tmp = new Array(gWeekDays); 39 for (var i=0; i<gWeekDays; i++){ 40 tmp[i] = day_headers[i+weekBeginsDay]; // shift by offset 41 } 42 return tmp; 43} 44function name_values(instring) { 45 var vars = new Array(); 46 rc = "\235"; 47 instring = instring.replace(/\\\;/g, rc); 48 var pattern = /[a-zA-Z0-9]+\=[:#a-zA-Z0-9\. \235]+/gi; 49 var y = instring.match(pattern); 50 for (i=0; i<y.length; i++) { 51 var s = y[i].split("="); 52 s[1] = s[1].replace(rc, ";"); 53 vars[i] = "v_" + s[0]; 54 eval(vars[i] + " = '" + s[1] + "'"); 55 } 56 return vars; 57} 58var onClickFnCode = ""; 59var orig_onClickFnCode = ""; 60function onClickFn(pday) { 61 if (pday.substring(0,2)=='08') 62 myMonth = 7; 63 else if (pday.substring(0,2)=='09') 64 myMonth = 8; 65 else 66 myMonth = parseInt(pday.substring(0,2)) - 1; 67 68 if(pday.substring(3,5)=='08') 69 myDay = 7; 70 else if(pday.substring(3,5)=='09') 71 myDay = 8; 72 else 73 myDay = parseInt(pday.substring(3,5)) - 1 ; 74 myYear = pday.substring(6,10); 75 myMonth=(theElement == 'mydate4' || theElement == 'mydate5') ? myMonth+1 : myMonth; 76 myDay=(theElement == 'mydate4' || theElement == 'mydate5' || theElement == 'mydate7') ? myDay+1 : myDay; 77 if (theElement == 'mydate7') 78 return; 79 80 fromMonth = theMonthObj.value; 81 fromYear = theYearObj.value; 82 theMonthObj.options[myMonth].selected = true; 83 84 for (var selYear=0; selYear<theYearObj.options.length; selYear++) 85 { 86 if (theYearObj.options[selYear].value==myYear) 87 theYearObj.options[selYear].selected = true; 88 } 89 if (theElement=='mydate4') 90 updateDay('start'); 91 else if (theElement=='mydate5') 92 updateDay('due'); 93 else if (theElement=='mydate1'|| theElement=='mydate2' || theElement=='mydate3') 94 { 95 toMonth = theMonthObj.value; 96 toYear = theYearObj.value; 97 doTheDays(theDayObj,theMonthObj,theYearObj); 98 } 99 theDayObj.options[myDay].selected = true; 100 var cTemp = 'nothing'; 101 if (theElement=='mydate1') 102 cTemp = 'start' 103 else if (theElement=='mydate2') 104 cTemp = 'end' 105 if (cTemp != 'nothing') 106 { 107 if (cTemp == 'start') 108 { 109 //fromMonth = document.myform.itemEndDateMonth.value; 110 //fromYear = document.myform.itemEndDateYear.value; 111 //doTheDays(document.myform.itemEndDateDay,document.myform.itemEndDateMonth,document.myform.itemEndDateYear,'true'); 112 } 113 syncEndDT(hDuration,minDuration); 114 } 115} 116// custom string 117var v_CloseOnSelect, v_AppendOrReplace, v_AppendChar, v_ReturnData; 118var v_InlineX, v_InlineY, v_Title; 119 120var weekend = [0,6]; 121var weekendColor = "white"; 122var fontface = "tahoma"; 123var fontsize = "11px"; 124var ggWinCal; // global variable pointing to the calendar window 125isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false; 126Calendar.Months = [janFull, febFull, marFull, aprFull, mayFull, junFull, 127 julFull, augFull, sepFull, octFull, novFull, decFull]; 128Calendar.DOMonth = [31,28,31,30,31,30,31,31,30,31,30,31]; 129Calendar.lDOMonth = [31,29,31,30,31,30,31,31,30,31,30,31]; 130Calendar.DOW = dow; 131Calendar.supportedFormats = ["MM/DD/YYYY", "MM/DD/YY", "DD/MON/YYYY", "DD/MON/YY"]; 132Calendar.count = 0; 133Calendar.Format = null; 134Calendar.gInitText = "MSN Calendar"; 135function Calendar(p_item, p_WinCal, p_month, p_year, p_format, p_type) { 136 Calendar.count += 1; 137 if ((p_month == null) && (p_year == null)) return; 138 if (p_WinCal == null) 139 this.gWinCal = ggWinCal; 140 else 141 this.gWinCal = p_WinCal; 142 if (p_month == null) { 143 this.gMonthName = null; 144 this.gMonth = null; 145 this.gYearly = true; 146 } else { 147 this.gMonthName = Calendar.get_month(p_month); 148 this.gMonth = new Number(p_month); 149 this.gYearly = false;
150 if (p_month=='11') 151 { subsequentMonth = 1; 152 subsequentYear = parseInt(p_year) + 1; 153 prevMonth = 11; 154 prevYear = parseInt(p_year); 155 } 156 else if (p_month=="0") 157 { subsequentMonth = parseInt(p_month) + 2; 158 subsequentYear = parseInt(p_year); 159 prevMonth = 12; 160 prevYear = parseInt(p_year) - 1; 161 } 162 else 163 { 164 subsequentMonth = parseInt(p_month) + 2; 165 subsequentYear = parseInt(p_year); 166 prevMonth = parseInt(p_month); 167 prevYear = parseInt(p_year); 168 } 169 subsequentMonth = (subsequentMonth.toString().length < 2) ? "0" + subsequentMonth : subsequentMonth; 170 prevMonth = (prevMonth.toString().length < 2) ? "0" + prevMonth : prevMonth; 171/* ***** end block *** */ 172 } 173 if (p_type == null) 174 this.gType = "POPUP"; // Default is popup 175 else 176 this.gType = p_type; 177 if (this.gType == "INLINE") { 178 this.WHO = ""; 179 this.INLINE = "Calendar"; // Inline Calendar Layer name 180 this.codeINLINE = ""; // Calendar code constructed in this var 181 } else 182 this.WHO = "window.opener."; 183 this.gYear = p_year; 184 this.gFormat = p_format; 185 this.gBGColor = "white"; 186 this.gFGColor = "black"; 187 this.gTextColor = "black"; 188 this.gHeaderColor = "black"; 189 this.gReturnItem = p_item; 190 this.gTitle = ""; 191} 192Calendar.get_month = Calendar_get_month; 193Calendar.get_daysofmonth = Calendar_get_daysofmonth; 194Calendar.get_dow = Calendar_get_dow; 195Calendar.calc_month_year = Calendar_calc_month_year; 196Calendar.CreateCalendarLayer = Calendar_CreateCalendarLayer; 197Calendar.Close = Calendar_Close; 198Calendar.Lwwrite = Calendar_Lwwrite; 199Calendar.MoveTo = Calendar_MoveTo; 200function Calendar_get_month(monthNo) { 201 return Calendar.Months[monthNo]; 202} 203function Calendar_get_dow(dayNo) { 204 return Calendar.DOW[dayNo]; 205} 206function Calendar_get_daysofmonth(monthNo, p_year) { 207 if ((p_year % 4) == 0) { 208 if ((p_year % 100) == 0 && (p_year % 400) != 0) 209 return Calendar.DOMonth[monthNo]; 210 211 return Calendar.lDOMonth[monthNo]; 212 } else 213 return Calendar.DOMonth[monthNo]; 214} 215function Calendar_calc_month_year(p_Month, p_Year, incr) { 216 /* 217 Will return an 1-D array with 1st element being the calculated month 218 and second being the calculated year 219 after applying the month increment/decrement as specified by 'incr' parameter. 220 'incr' will normally have 1/-1 to navigate thru the months. 221 */ 222 var ret_arr = new Array(); 223 if (incr == -1) { 224 // backward 225 if (p_Month == 0) { 226 ret_arr[0] = 11; 227 ret_arr[1] = parseInt(p_Year) - 1; 228 } 229 else { 230 ret_arr[0] = parseInt(p_Month) - 1; 231 ret_arr[1] = parseInt(p_Year); 232 } 233 } else if (incr == 1) { 234 // forward 235 if (p_Month == 11) { 236 ret_arr[0] = 0; 237 ret_arr[1] = parseInt(p_Year) + 1; 238 } 239 else { 240 ret_arr[0] = parseInt(p_Month) + 1; 241 ret_arr[1] = parseInt(p_Year); 242 } 243 } 244 return ret_arr; 245} 246// create and discard one object before the prototype object can exist. 247new Calendar(); 248Calendar.prototype.setFormat = function(pFormat) { 249 for (j=0; j<Calendar.supportedFormats.length; j++) { 250 if (Calendar.supportedFormats[j] == pFormat) 251 Calendar.Format = pFormat; 252 } 253} 254Calendar.prototype.getMonthlyCalendarCode = function() { 255 var vCode = ""; 256 var vHeader_Code = ""; 257 var vData_Code = ""; 258 // Begin Table Drawing code 259 vCode = vCode + "<table width=150 BORDER=0 CELLSPACING=0 CELLPADDING=3 BGCOLOR='white'>"; 260 vHeader_Code = this.cal_header(); 261 vData_Code = this.cal_data(); 262 vCode = vCode + vHeader_Code + vData_Code; 263 vCode = vCode + "</TABLE>"; 264 return vCode; 265} 266 267 268Calendar.prototype.onclickfn = function() { 269 var whois = this.WHO + 270 ((this.gType == "POPUP") ? "document." : "window.document.") + 271 this.gReturnItem + ".value"; 272 var apchar = (this.returnMode == "Replace") ? " = " : " = "; 273 var retCode = "apchar = ''" + 274 ((this.returnMode == "Replace") ? ";" : " + ") + 275 "((" + whois + " == '') ? '' : '');\n" + 276 whois + apchar + "apchar + pday;\n"; 277 return retCode; 278} 279 280Calendar.prototype.show = function() { 281 if (IC_Locale=='1041'||IC_Locale=='1042'||IC_Locale=='2052'||IC_Locale=='1028'||IC_Locale=='3076') 282 var month_Title = this.gYear + locYear + " " + this.gMonthName + locMonth; 283 else 284 var month_Title = this.gMonthName + " " + this.gYear; 285 var vCode = ""; 286 if (this.gType == "POPUP") 287 this.gWinCal.document.open(); 288 // setting up document 289 this.wwrite("<html>"); 290 this.wwrite("<head><title>Calendar</title>"); 291 if (this.gType == "POPUP") 292 this.wwrite("<script language='javascript'>" + 293 "function onClickFn(pday) {\n" + 294 this.onclickfn() + "}\n<\/script>"); 295 else 296 orig_onClickFnCode = this.onclickfn(); 297 this.wwrite("</head>"); 298 this.wwrite("<body " + "link=\"" + this.gLinkColor + "\" " + 299 "vlink=\"" + this.gLinkColor + "\" " + "alink=\"" + this.gLinkColor + "\" " + 300 "text=\"" + this.gTextColor + "\">"); 301 this.wwrite("<table width=150 BORDER=0 CELLPADDING=0 class='leftBarBg'><TR><TD>" + 302 "<TABLE width='150' align='center'>" + "<TR><TD class='leftBarBg' COLSPAN=2 align='CENTER'>"); // inner table 303 // Show navigation buttons 304 var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1); 305 var prevMM = prevMMYYYY[0]; 306 var prevYYYY = prevMMYYYY[1]; 307 var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1); 308 var nextMM = nextMMYYYY[0]; 309 var nextYYYY = nextMMYYYY[1]; 310 this.wwrite("<TABLE ALIGN=center BORDER=0 CELLSPACING=0 class='leftBarBg' width='100%'><TR height=20><TD title='" + IC_previous + "' width='13' ALIGN=center onClick=\"" + this.WHO + "Build(" + "'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "', '" + this.gType + "'" + ")\"; alt='" + IC_previous + "' style='cursor:hand'>"); 311 this.wwrite("<img src='"+imgServer+"arrow_left.gif' alt='" + IC_previous + "'>" + "</TD><TD width='80%' NOWRAP ALIGN=center class='tab' onClick='event.cancelBubble=true'>"); 312 this.wwrite(month_Title + "</TD><TD title='" + IC_next + "' width='14' ALIGN=center onClick=\"" + this.WHO + "Build(" + "'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "', '" + this.gType + "'" + ")\"; alt='" + IC_previous + "' style='cursor:hand'>"); 313 this.wwrite("<img src='"+imgServer+"arrow_right.gif' alt='" + IC_next + "'>" + "</TD>"); 314 this.wwrite("</TR><tr>
314<td colspan='7' align=center class=box>"); 315 // Get the complete calendar code for the month 316 vCode = this.getMonthlyCalendarCode(); 317 this.wwrite(vCode); 318 this.wwrite("</TD></TR><tr><td colspan=7 align=center onClick='event.cancelBubble=true'>"); 319// today is: 320 this.wwrite(IC_TodayIs + IC_LocColon + " "); 321 var monthNumb = today.getMonth() + 1; 322 monthNumb = (monthNumb.toString().length < 2) ? "0" + monthNumb : monthNumb; 323 var todayDay = today.getDate(); 324 todayDay = (todayDay.toString().length < 2) ? "0" + todayDay : todayDay; 325 this.wwrite("<A HREF='javascript:" + closecodeI + "' " + 326 "onClick=\"onClickFn('" + monthNumb + "/" + 327 todayDay + "/" + today.getFullYear() + 328 "');" + closecodeP + 329 "\">" + IC_TodayDate + "<\/A>"); 330 this.wwrite("<HR></td></tr><TR><TD colspan=2 align=center onClick=\"event.cancelBubble=true\">"+ 331 "<A HREF='javascript:c=true;" + 332 this.WHO + "Calendar.Close(\"" + this.gType + "\", \"" + this.INLINE + "\");' " + 333 "class=bigbold>" + IC_Cancel + 334 "</A></td></TR></TABLE>"); 335 this.wwrite("</body></html>"); 336 if (this.gType == "POPUP") 337 this.gWinCal.document.close(); 338 if (this.gType == "INLINE") 339 Calendar.Lwwrite(this.codeINLINE, this.INLINE); 340 341 if (isMessenger) 342 { 343 var DivRef = document.getElementById('Calendar'); 344 var ifrRef = document.getElementById('DivShim'); 345 346 DivRef.style.display = "block"; 347 ifrRef.style.width = DivRef.offsetWidth; 348 ifrRef.style.height = DivRef.offsetHeight; 349 ifrRef.style.top = DivRef.style.top; 350 ifrRef.style.left = DivRef.style.left; 351 ifrRef.style.zIndex = DivRef.style.zIndex - 1; 352 ifrRef.style.display = "block"; 353 } 354 355} 356function Calendar_Close(pType, pINLINE) { 357 358 var ifrRef = document.getElementById('DivShim'); 359 360 ifrRef.style.display = "none"; 361 if (pType == "POPUP") 362 ggWinCal.close(); 363 if (pType == "INLINE") 364 { 365 366 367 if (theElement == 'mydate7' && false == c){ 368 showDayPicker(myYear, myMonth, myDay); 369 } 370 Calendar.Lwwrite(Calendar.gInitText, pINLINE) 371 //var inObj = new Array(theElement,document.myform.itemEndDateYear); 372 showCal(inObj); 373 } 374} 375Calendar.prototype.showY = function() { 376 var vCode = ""; 377 var i; 378 var vr, vc, vx, vy; // Row, Column, X-coord, Y-coord 379 var vxf = 285;
379 // X-Factor 380 var vyf = 200; // Y-Factor 381 var vxm = 10; // X-margin 382 var vym = 75; 383 this.gWinCal.document.open(); 384 this.wwrite("<html>"); 385 this.wwrite("<head><title>Calendar</title>"); 386 this.wwrite("<style type='text/css'>\n<!--"); 387 for (i=0; i<12; i++) { 388 vc = i % 3; 389 if (i>=0 && i<= 2) vr = 0; 390 if (i>=3 && i<= 5) vr = 1; 391 if (i>=6 && i<= 8) vr = 2; 392 if (i>=9 && i<= 11) vr = 3; 393 vx = parseInt(vxf * vc) + vxm; 394 vy = parseInt(vyf * vr) + vym; 395 this.wwrite(".lclass" + i + " {position:absolute;top:" + vy + ";left:" + vx + ";}"); 396 } 397 this.wwrite("-->\n</style>"); 398 this.wwrite("</head>"); 399 this.wwrite("<font face='" + fontface + "' size=2><strong>"); 400 this.wwrite("Year : " + this.gYear); 401 this.wwrite("</strong><br />"); 402 // Navigation buttons 403 var prevYYYY = parseInt(this.gYear) - 1; 404 var nextYYYY = parseInt(this.gYear) + 1; 405 this.wwrite("<TABLE WIDTH='100%' BORDER=1 CELLSPACING=0 BGCOLOR='#e0e0e0'><TR><TD ALIGN=center>"); 406 this.wwrite("[<A HREF=\"" + 407 "javascript:window.opener.Build(" + 408 "'" + this.gReturnItem + "', null, '" + prevYYYY + "', '" + this.gFormat + "'" + 409 ");" + 410 "\" alt='Prev Year'><<<\/A>]</TD><TD ALIGN=center>"); 411 this.wwrite("[<A HREF=\"javascript:window.print();\">Print</A>]</TD><TD ALIGN=center>"); 412 this.wwrite("[<A HREF=\"" + 413 "javascript:window.opener.Build(" + 414 "'" + this.gReturnItem + "', null, '" + nextYYYY + "', '" + this.gFormat + "'" + 415 ");" + 416 "\">>><\/A>]</TD></TR></TABLE><BR>"); 417 // Complete calendar code for each month 418 var j; 419 for (i=11; i>=0; i--) { 420 this.wwrite("<DIV ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">"); 421 this.gMonth = i; 422 this.gMonthName = Calendar.get_month(this.gMonth); 423 vCode = this.getMonthlyCalendarCode(); 424 this.wwrite(this.gMonthName + "/" + this.gYear + "<BR>"); 425 this.wwrite(vCode); 426 this.wwrite("</DIV>"); 427 } 428 this.wwrite("</font><BR></body></html>"); 429 this.gWinCal.document.close(); 430} 431Calendar.prototype.cal_header = function() { 432 var vCode = ""; 433 vCode = vCode + "<TR onClick='event.cancelBubble=true'>"; 434 for (var dh=0; dh<day_header.length - 1; dh++) 435 vCode = vCode + "<TD WIDTH='14%' align='center'>" + day_header[dh] + "</TD>"; 436 vCode = vCode + "<TD WIDTH='16%' align='center' class='dayofweek'>" + day_header[6] + "</TD>"; 437 vCode = vCode + "</TR><tr height=1><td colspan=7 class='boxHd'></td></tr>"; 438 return vCode; 439} 440Calendar.prototype.cal_data = function() { 441 var vDate = new Date(); 442 vDate.setDate(1); 443 vDate.setMonth(this.gMonth); 444 vDate.setFullYear(this.gYear); 445 446 var vFirstDay=vDate.getDay(); 447 448 // shift by offset to correct position 449 if (weekBeginsDay > vFirstDay){ 450 vFirstDay = gWeekDays - weekBeginsDay + vFirstDay; // overlap 451 }else 452 vFirstDay-= weekBeginsDay; 453 454 var vDay=1; 455 var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear); 456 if (this.gMonth==0) 457 var pLastDay=Calendar.get_daysofmonth(11, this.gYear-1); 458 else 459 var pLastDay=Calendar.get_daysofmonth(this.gMonth-1, this.gYear); 460 if (this.closeable) { 461 closecodeP = ((this.gType=="POPUP") ? "window.close();" : ""); 462 closecodeI = "Calendar.Close(\"" + this.gType + "\", \"" + this.INLINE + "\"); "; 463 } else { 464 closecodeP = ""; 465 closecodeI = "void(0);' "; 466 } 467 var vOnLastDay=0; 468 var pdays=pLastDay-vFirstDay; 469 var vCode = ""; 470 // Previous month 471 vCode = vCode + "<TR>"; 472 for (i=0; i<vFirstDay; i++) { 473 pdays=pdays+1; 474 vCode = vCode + 475 "<A HREF='javascript:" + closecodeI + "' " + "onClick=\"onClickFn('" + prevMonth + "/" + 476 pdays + "/" + prevYear + "');" + closecodeP + "\">" + 477 "<TD valign='middle' WIDTH='14%' style='color:#999999;' onMouseOver='className=\"linkOn\"' onMouseOut='className=\"linkOff\"' align='center'" + thisStyle + ">" + 478 pdays + "</TD></a>"; 479 } 480 481 var whois = this.WHO + 482 ((this.gType == "POPUP") ? "document." : "window.document.") + 483 this.gReturnItem + ".value"; 484 // The rest of the 1st week 485 486 for (j=vFirstDay; j<7; j++) { 487 vCode = vCode + 488 "<A HREF='javascript:" + closecodeI + "' " + "onClick=\"onClickFn('" + 489 ((this.returnData == "Date") ? this.format_data(vDay) : this.format_dow(vDay)) + "');" + 490 closecodeP + "\">" + "<TD valign='middle' WIDTH='14%' style='color:#000033;' onMouseOver='className=\"linkOn\"' onMouseOut='className=\"linkOff\"' align='center'" + this.write_weekend_string(j) + 491 thisStyle + ">" + this.format_day(vDay) + "</TD></A>"; 492 vDay=vDay + 1; 493 } 494 vCode = vCode + "</TR>"; 495// the rest of the weeks 496 for (k=2; k<7; k++) { 497 vCode = vCode + "<TR>"; 498 for (j=0; j<7; j++) { 499 vCode = vCode + 500 "<A HREF='javascript:" + closecodeI + "' " + 501 "onClick=\"onClickFn('" + 502 ((this.returnData == "Date") ? 503 this.format_data(vDay) : 504 this.format_dow(vDay)) + 505 "');" + 506 closecodeP + 507 "\">" + "<TD valign='middle' WIDTH='14%' style='color:#000033;' onMouseOver='className=\"linkOn\"' onMouseOut='className=\"linkOff\"' align='center'" + this.write_weekend_string(j) + thisStyle + ">" + 508 this.format_day(vDay) + 509 510 "</TD>" + "<\/A>"; 511 vDay=vDay + 1; 512 513 if (vDay > vLastDay) { 514 vOnLastDay = 1; 515 break; 516 } 517 } 518 if (j == 7) 519 vCode = vCode + "</TR>"; 520 if (vOnLastDay == 1) 521 break; 522 } 523 // the rest of last week 524 for (m=1; m<(7-j); m++) { 525 vCode = vCode + 526 "<A HREF='javascript:" + closecodeI + "' " + "onClick=\"onClickFn('" + subsequentMonth + 527 "/0" + m + "/" + subsequentYear + "');" + closecodeP + "\"><TD valign='middle' WIDTH='14%' style='color:#999999;' onMouseOver='className=\"linkOn\"' onMouseOut='className=\"linkOff\"' align='center'" + thisStyle + "> " + 528 m + " </TD></a>"; 529 } 530 return vCode; 531} 532Calendar.prototype.format_day = function(vday) { 533 534 if (vday == vNowDay-1 && this.gMonth == vNowMonth && this.gYear == vNowYear) 535 { 536 thisClass='today'; 537 thisStyle = " style='font-weight:bold;background-color:#FFFAE0;border:1px solid #000066;padding:2px;'"; //Fix bug 55444 538 } 539 else 540 { 541 thisClass='normal'; 542 thisStyle = ""; 543 } 544 return (vday); 545} 546Calendar.prototype.write_weekend_string = function(vday) { 547 var i; 548 // Return special formatting for the weekend day. 549 for (i=0; i<weekend.length; i++) { 550 if (vday == weekend[i]) 551 return (""); //(" BGCOLOR=\"" + weekendColor + "\""); 552 } 553 return ""; 554} 555Calendar.prototype.format_data = function(p_day) { 556 var vData; 557 var vMonth = 1 + this.gMonth; 558 var sMonth = months_short[vNowMonth]; 559 vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth; 560 var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase(); 561 var vFMon = Calendar.get_month(this.gMonth).toUpperCase(); 562 var vY4 = new String(this.gYear); 563 var vY2 = new String(this.gYear.substr(2,2)); 564 var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day; 565 switch (this.gFormat) { 566 case "MM\/DD\/YYYY" : 567 vData = vMonth + "\/" + vDD + "\/" + vY4; 568 break; 569 case "MM\/DD\/YY" : 570 vData = vMonth + "\/" + vDD + "\/" + vY2; 571 break; 572 case "DD\/MON\/YYYY" : 573 vData = vDD + "\/" + vMon + "\/" + vY4; 574 break; 575 case "DD\/MON\/YY" : 576 vData = vDD + "\/" + vMon + "\/" + vY2; 577 break; 578 default : 579 vData = vMonth + "\/" + vDD + "\/" + vY4; 580 } 581 return vData; 582} 583Calendar.prototype.format_dow = function(p_day) { 584 var vData; 585 var vMonth = 1 + this.gMonth; 586 vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth; 587 var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase(); 588 var vFMon = Calendar.get_month(this.gMonth).toUpperCase(); 589 var vY4 = new String(this.gYear); 590 var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day; 591 var vDate = new Date(vMonth + "\/" + vDD + "\/" + vY4); 592 vData = Calendar.get_dow(vDate.getDay()); 593 return vData; 594} 595Calendar.prototype.wwrite = function(wtext) { 596 if (this.gType == "POPUP") 597 this.gWinCal.document.writeln(wtext); 598 else { 599 this.codeINLINE += wtext; 600 } 601} 602Calendar.prototype.wwriteA = function(wtext) { 603 if (this.gType == "POPUP") 604 this.gWinCal.document.write(wtext); 605 else { 606 this.codeINLINE += wtext; 607 } 608} 609function Calendar_CreateCalendarLayer(pLeft, pTop, pInitText) { 610 if (pInitText == null) 611 pInitText = Calendar.gInitText; 612 else 613 Calendar.gInitText = pInitText; 614 615 v_InlineX = pLeft; 616 v_InlineY = pTop; 617 618 document.writeln("<DIV ID=\"" + "Calendar" + "\" STYLE=\"" + 619 "position:absolute;top:" + pTop + ";left:" + pLeft + ";z-index=4" + 620 "\">" + pInitText + "<\/DIV>"); 621 622 document.writeln("<iframe id=\"DivShim\" src=\"javascript:false;\" scrolling=\"no\" frameborder=\"0\" style=\"position:absolute; top:0px; left:0px; display:none;\"></iframe>"); 623 624 625 626} 627function Calendar_Lwwrite(pText, pINLINE) { 628 document.all[pINLINE].innerHTML = pText; 629} 630function Calendar_MoveTo(pX, pY, pINLINE) { 631 document.all[pINLINE].style.top = pY; 632 document.all[pINLINE].style.left = pX; 633} 634function Build(p_item, p_month, p_year, p_format, p_type, p_custom) { 635 var p_WinCal = ggWinCal; 636if (typeof(p_item.name)!='undefined') 637 theElement = p_item.name; 638if (theElement=='mydate1') 639{ 640 theYearObj = document.myform.itemStartDateYear; // Used as signalling element 641 theMonthObj = document.myform.itemStartDateMonth; 642 theDayObj = document.myform.itemStartDateDay; 643 recurModEndCal = false;
644} 645else if (theElement=='mydate2') 646{ 647 //theYearObj = document.myform.itemEndDateYear; 648 //theMonthObj = document.myform.itemEndDateMonth; 649 //theDayObj = document.myform.itemEndDateDay; 650 recurModEndCal = false; 651} 652else if (theElement=='mydate4') 653{ 654 theYearObj = document.myform.taskStartDateYear; 655 theMonthObj = document.myform.taskStartDateMonth; 656 theDayObj = document.myform.taskStartDateDay; 657 recurModEndCal = false; 658} 659else if (theElement=='mydate5') 660{ 661 theYearObj = document.myform.taskDueDateYear; 662 theMonthObj = document.myform.taskDueDateMonth; 663 theDayObj = document.myform.taskDueDateDay; 664 recurModEndCal = false; 665} 666else if (theElement=='mydate7') 667{ 668 theMonthObj = null; 669 theYearObj = null; 670 recurModEndCal = false; 671} 672else 673{ 674 theYearObj = document.myform.recurrenceEndDateYear; 675 theMonthObj = document.myform.recurrenceEndDateMonth; 676 theDayObj = document.myform.recurrenceEndDateDay; 677 recurModEndCal = true; 678} 679 gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format, p_type); 680 // Customize Calendar 681 gCal.gBGColor="white"; 682 gCal.gLinkColor="black"; 683 gCal.gTextColor="black"; 684 gCal.gHeaderColor="black"; 685 if (p_custom && p_custom != "") 686 var vvars = name_values(p_custom); 687 gCal.closeable = v_CloseOnSelect?((v_CloseOnSelect == "Yes") ? true : false): false; 688 gCal.returnMode = v_AppendOrReplace?v_AppendOrReplace : "Replace"; 689 gCal.returnData = v_ReturnData?v_ReturnData : "Date"; 690 // Character to be added For Append mode 691 gCal.appendChar = (gCal.returnMode == "Append")?v_AppendChar ? v_AppendChar : ";" : ""; 692 // specific messenger for recurr day picker. 693 if(isMessenger && calLocation.name == "iCalendar3"){ 694 gCal.InlineX = 145; 695 }else{ 696 gCal.InlineX = (getXY(calLocation).left-2); 697 } 698 yOffset = 20 // (grpCal)?-197:20; // un comment this line if want the popup cal drop up 699 700 if (recurModEndCal) 701 yOffset = -40; 702 // messenger overwrites this. 703 if( isMessenger && calLocation.name == "iCalendar3"){ 704 yOffset = -120; 705 } 706 707 gCal.InlineY = (getXY(calLocation).top+yOffset); //v_InlineY ? v_InlineY : 100; 708 if (gCal.gType == "INLINE") 709 Calendar.MoveTo(gCal.InlineX, gCal.InlineY, gCal.INLINE); 710 gCal.gTitle = v_Title ? v_Title : gCal.gMonthName + "/" + gCal.gYear; 711 gCal.show(); 712} 713//Monthly Calendar Code begins 714function show_calendar() { 715 /* 716 p_month : 0-11 for Jan-Dec; 12 for All Months. 717 p_year : 4-digit year 718 p_format: Date format (mm/dd/yyyy, dd/mm/yy, ...) 719 p_item : Return Item. 720 p_type : POPUP/INLINE Calendar 721 p_custom: String of customizable name/value pair parameters 722 */ 723 c = false; 724 p_item = arguments[0]; 725 if (arguments[1] == null) 726 p_month = new String(gNow.getMonth()); 727 else 728 p_month = (typeof(arguments[1]) == "number")?arguments[1].toString():arguments[1]; 729 if (arguments[2] == "" || arguments[2] == null) 730 p_year = new String(gNow.getFullYear().toString()); 731 else 732 p_year = (typeof(arguments[2]) == "number")?arguments[2].toString():arguments[2]; 733 if (arguments[3] == null) 734 p_format = "MM/DD/YYYY"; 735 else 736 p_format = (typeof(arguments[3]) == "string")?arguments[3]:"MM/DD/YYYY"; 737 if (arguments[4] == null) 738 p_type = "POPUP"; 739 else 740 p_type = (typeof(arguments[4]) == "string" && 741 (arguments[4] == "POPUP" || arguments[4] == "INLINE"))?arguments[4]:"POPUP"; 742 if (arguments[5] == null) 743 p_custom = "CloseOnSelect=Yes;AppendOrReplace=Replace;AppendChar=';';ReturnData=Date;Title=Popup Date Picker;"; 744 else 745 p_custom = typeof(arguments[5]) == "string"?arguments[5]:"CloseOnSelect=Yes;AppendOrReplace=Replace;AppendChar=';';ReturnData=Date;Title=Popup Date Picker;"; 746 if (p_type == "POPUP") { 747 vWinCal = window.open("", "Calendar", 748 "width=200,height=260,status=no,resizable=no"); 749 vWinCal.opener = self; 750 ggWinCal = vWinCal; 751 } 752 Build(p_item, p_month, p_year, p_format, p_type, p_custom); 753 cVisible = true; 754} 755 756function popCalClickHandle() 757{ 758 if (cVisible) 759 { 760 Calendar.Close('INLINE','Calendar'); 761 cVisible=false; 762 } 763}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.