var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); var CALENDAR_MonthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; var CALENDAR_MonthShortNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"]; var CALENDAR_DayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; // var CALENDAR_DayShortNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; var CALENDAR_DayShortNames = ["S", "M", "T", "W", "T", "F", "S"]; // This will set the current date as the date on the user's clock. Change to server date here if necessary. // Remember: Month is 0-indexed in javascript. //var DAYS_OUT = 3; var temp = new Date(); if (!CALENDAR_CurrentDate) { var CALENDAR_CurrentDate = new Date(temp.getFullYear(), temp.getMonth(), temp.getDate()); } // Main constructor function. Takes the object variable name as a parameter (for self-refferential behavior with links) function Calendar(selfName) { this.name = selfName; // Self-refferential property. Necessary!!! this.selectedDate = CALENDAR_CurrentDate; this.currentMonth = this.selectedDate.getMonth(); this.currentYear = this.selectedDate.getFullYear(); this.layer = false; // Layer to regenerate into // Application-specific behaviors this.autoRender = true; // Should we regenerate if the user selects something? this.onDateSelect = false; // If not false, must contain a valid js command to execute when date is selected this.onMonthSelect = false; // If not false, must contain a valid js command to execute when month is selected this.backgroundcolor = false; this.weekdayHeaderBackgroundColor = false; this.dayBackgroundColor = false; this.currentDayBackgroundColor = false; this.font_size = false; this.lowerLimit = false; // If not false, must contain a valid date (lower bound) this.upperLimit = false; // If not false, must contain a valid date (upper bound) this.outOfBounds = CalendarOutOfBounds; this.getMonthName = CalendarGetMonthName; this.getMonthShortName = CalendarGetMonthShortName; this.getSelectedDate = CalendarGetSelectedDate; this.getDaysInMonth = CalendarGetDaysInMonth; this.select = CalendarSelect; this.selectMonth = CalendarSelectMonth; this.renderDays = CalendarRenderDays; this.renderDaySelectLink = CalendarRenderDaySelect; this.renderPrevMonthLink = CalendarRenderPrevMonth; this.renderNextMonthLink = CalendarRenderNextMonth; this.renderHeader = CalendarRenderHeader; this.render = CalendarRender; this.renderToLayer = CalendarRenderToLayer; this.refresh = CalendarRefresh; } //----------------------------- Methods function CalendarOutOfBounds(d) { var out = false; var dv = d.valueOf(); if (this.lowerLimit) { out = (this.lowerLimit.valueOf() > d); } if (this.upperLimit && !out) { out = (this.upperLimit.valueOf() < d); } return out; } function CalendarGetMonthName() { return CALENDAR_MonthNames[this.currentMonth]; } function CalendarGetMonthShortName() { return CALENDAR_MonthShortNames[this.currentMonth]; } function CalendarGetSelectedDate() { return this.selectedDate; } function CalendarGetDaysInMonth(year, month) { var a = new Date(year, month, 1); if (month == 11) { var b = new Date(year+1, 0, 1); } else { var b = new Date(year, month+1, 1); } var millsDiff = b-a; return Math.round(millsDiff / 86400000); // 86,400,000 milliseconds in a day } //------------- Actions function CalendarSelect(y, m, d) { this.selectedDate = new Date(y, m, d); this.refresh(); if (this.onDateSelect) { eval(this.onDateSelect); } } function CalendarSelectMonth(y, m) { this.currentMonth = m; this.currentYear = y; this.refresh(); if (this.onMonthSelect) { eval(this.onMonthSelect); } } //------------- HTML Rendering routines function CalendarRenderDays() { var output = ""; // Figure out how many days are being shown var totalDays = this.getDaysInMonth(this.currentYear, this.currentMonth); // Identify what day-of-week to start on var startDay = (new Date(this.currentYear, this.currentMonth, 1)).getDay(); // Add day-name header row output += "
"; for (var i in CALENDAR_DayShortNames) { output += ""; } output += ""; var showDays = false; var currentDay = 1; for (var w = 0; w < 6; w++) { output += ""; for (var d = 0; d < 7; d++) { showDays = (showDays || (!showDays && d == startDay)); if (!showDays || currentDay > totalDays) { // Show disabled box output += ""; } else { var currentDate = new Date(this.currentYear, this.currentMonth, currentDay); //alert(this.selectedDate); if (this.outOfBounds(currentDate)) { // Show disabled box output += ""; } else if (this.selectedDate && currentDate.valueOf() == this.selectedDate.valueOf()) { // Show current date box output += ""; } else { // Show selectable date box output += ""; } currentDay++; } } output += "\n"; } output += "
" + CALENDAR_DayShortNames[i] + "
 "+currentDay+""; output += this.renderDaySelectLink(currentDate); output += ""; output += this.renderDaySelectLink(currentDate); output += "
"; return output; } function CalendarRenderDaySelect(date) { var output = ""+date.getDate()+""; } else { output += "' style='text-decoration:none;'>"+date.getDate()+""; } return output; } function CalendarRenderHeader() { var output = ""; output += ""; output += ""; output += ""; output += ""; output += "
"; output += this.renderPrevMonthLink(); output += ""; output += this.getMonthName(this.currentMonth) + " " + this.currentYear; output += ""; output += this.renderNextMonthLink(); output += "
"; return output; } function CalendarRenderPrevMonth() { var output = ""; if (this.currentMonth == 0) { var m = 11; var y = this.currentYear - 1; } else { var m = this.currentMonth - 1; var y = this.currentYear; } if (!this.outOfBounds(new Date(y, m, this.getDaysInMonth(y,m)))) { output += "<"; }else{ output += ""; } return output; } function CalendarRenderNextMonth() { var output = ""; if (this.currentMonth == 11) { var m = 0; var y = this.currentYear + 1; } else { var m = this.currentMonth + 1; var y = this.currentYear; } if (!this.outOfBounds(new Date(y, m, 1))) { output += "
>
"; }else{ output += ""; } return output; } function CalendarRender() { var output = ""; output += this.renderHeader(); output += this.renderDays(); return output; } function CalendarRenderToLayer(layerName, outerLayer) { outerLayerName = new String(outerLayer); if(outerLayerName == 'undefined') { outerLayerName = ''; } this.layer = new Layer(layerName, outerLayerName); this.layer.setHtml(this.render()); } function CalendarRefresh() { if (this.autoRender && this.layer) { this.layer.setHtml(this.render()); } } } /* FILE ARCHIVED ON 01:54:44 Feb 05, 2005 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 13:18:31 May 04, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 0.935 exclusion.robots: 0.094 exclusion.robots.policy: 0.079 cdx.remote: 0.106 esindex: 0.015 LoadShardBlock: 175.176 (3) PetaboxLoader3.resolve: 191.264 (3) PetaboxLoader3.datanode: 142.982 (4) load_resource: 191.969 */