/*************************************************************************************** JavaScript Calendar - Digital Christian Design //Script featured on and available at JavaScript Kit: http://www.javascriptkit.com // Functions changedate(): Moves to next or previous month or year, or current month depending on the button clicked. createCalendar(): Renders the calander into the page with links for each to fill the date form filds above. ***************************************************************************************/ // This is the Database of Upcoming Events // Please Edit with Care. // // 8 Fields (surrounded by brackets[]) are used for EACH event: // ["Recurring", "Month", "Day", "Year", "StartTime", "EndTime", "Name", "Description"] // Each event field must be be surrounded by quotation marks followed by a comma ("",) EXCEPT the "Description" field. // The "Description" field is surrounded by quotation marks only (""). // // Each event has a comma after the closing bracket IF another event is below it on the next line down. // Note: The last event in this file should NOT have a comma after the closing bracket // // The Recurring field uses: // "D" = Daily; "W" = Weekly; "M" = Monthly; "Y" = Yearly; "F" = Floating Holiday // // One Time only events should leave the Recurring field blank // (ex. "") // // Daily events do NOT require that anything be in the Month Day and Year fields // Everything in the Month Day and Year fields will be ignored // // Weekly events should have the day of the week field set to 1 - 7 // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // // "F"loating events uses: // the Month field for the Month. // the Day field as the Cardinal Occurrence // 1=1st, 2=2nd, 3=3rd, 4=4th, 5=5th, 6=6th occurrence of the day listed next // the Year field as the Day of the week the event/holiday falls on // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // example: "F", "1", "3", "2", = Floating holiday in January on the 3rd Monday of that month. // // Note: Easter has it's own special formula so Please don't change anything related to Easter below // // "Y"early events are specific dates that never change - the Year field is ignored // example - Christmas is: "12","25","", events = new Array( ["", "6", "14", "2007", "6:30 PM", "", "", "ASCO highlights, for physicians, nurses. Location: Capri Blu."], ["", "6", "27", "2007", "TBA", "", "", "An Update on Therapeutic Options for MDS, sponosred by MGI Pharma for oncology nurses.  Location: Junja Asian Bistro."], ["", "8", "1", "2007", "6:30 PM", "", "", "Post ASCO Review, for physicians, nurses.  Location: TBA."], ["", "9", "8", "2007", "9:45 AM", "12:00 PM", "", "Information for BRCA positive patients and their families. There is no charge for the public, registration required; To register call 561-366-4153. Location: Chesterfield Hotel, 363 Coconut Row, Palm Beach, FL."], ["", "9", "15", "2007", "5:30 PM", "", "", "Breast Cancer Awareness for the Haitian Community, Location: TBA."], ["", "9", "29", "2007", "8:30 AM", "3:00 PM", "", "Annual Oncology Nursing Symposium, for oncology nurses. Location: Marriott Hotel, Cityplace, West Palm Beach."], ["", "10", "24", "2007", "12:00 PM", "1:00 PM", "", "Sexuality and the Cancer Patient. To register please call 561-366-4153. Location: Cancer Teleconference Room at the Good Samaritan Medical Center."], ["", "10", "30", "2007", "9:30 AM", "", "", "Chemotherapy Education Classes, for patients. To register call 561-366-4153. Location: Cancer Teleconference Room at the Good Samaritan Medical Center."], ["", "11", "13", "2007", "9:30 AM", "", "", "Chemotherapy Education Classes, for patients. To register call 561-366-4153. Location: Cancer Teleconference Room at the Good Samaritan Medical Center."], ["", "11", "27", "2007", "9:30 AM", "", "", "Chemotherapy Education Classes, for patients. To register call 561-366-4153. Location: Cancer Teleconference Room at the Good Samaritan Medical Center."], ["", "4", "8", "2009", "2:00 PM", "3:00 PM", "Coping With Cancer ", "Bi-Monthly Support Group Location: Sari Asher Center for Integrative Cancer Care."] // Please omit the final comma after the ] from the last line above unless you are going to add another event at this time. ); /* Preload images script */ var myimages=new Array() function preloadimages(){ for (i=0;i\"Prev<\/a><\/td>'; calendarString += '\"Prev<\/a><\/td>'; calendarString += '' + wordMonth[monthNum-1] + '  ' + yearNum + '<\/b><\/td>'; calendarString += '\"Next<\/a><\/td>'; calendarString += '\"Next<\/a><\/td>'; calendarString += '<\/tr>'; calendarString += ''; calendarString += 'Sun<\/td>'; calendarString += 'Mon<\/td>'; calendarString += 'Tue<\/td>'; calendarString += 'Wed<\/td>'; calendarString += 'Thu<\/td>'; calendarString += 'Fri<\/td>'; calendarString += 'Sat<\/td>'; calendarString += '<\/tr>'; thisDate == 1; for (var i = 1; i <= 6; i++) { calendarString += ''; for (var x = 1; x <= 7; x++) { daycounter = (thisDate - firstDay)+1; thisDate++; if ((daycounter > numbDays) || (daycounter < 1)) { calendarString += ' <\/td>'; } else { if (checkevents(daycounter,monthNum,yearNum,i,x) || ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum))){ if ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum)) { calendarString += '' + daycounter + '<\/a><\/td>'; } else calendarString += '' + daycounter + '<\/a><\/td>'; } else { calendarString += '' + daycounter + '<\/td>'; } } } calendarString += '<\/tr>'; } calendarString += 'Show Current Date<\/b><\/a><\/td><\/tr><\/table>'; var object=document.getElementById('calendar'); object.innerHTML= calendarString; thisDate = 1; } function checkevents(day,month,year,week,dayofweek) { var numevents = 0; var floater = 0; for (var i = 0; i < events.length; i++) { if (events[i][0] == "W") { if ((events[i][2] == dayofweek)) numevents++; } else if (events[i][0] == "Y") { if ((events[i][2] == day) && (events[i][1] == month)) numevents++; } else if (events[i][0] == "F") { if ((events[i][1] == 3) && (events[i][2] == 0) && (events[i][3] == 0) ) { easter(year); if (easterday == day && eastermonth == month) numevents++; } else { floater = floatingholiday(year,events[i][1],events[i][2],events[i][3]); if ((month == 5) && (events[i][1] == 5) && (events[i][2] == 4) && (events[i][3] == 2)) { if ((floater + 7 <= 31) && (day == floater + 7)) { numevents++; } else if ((floater + 7 > 31) && (day == floater)) numevents++; } else if ((events[i][1] == month) && (floater == day)) numevents++; } } else if ((events[i][2] == day) && (events[i][1] == month) && (events[i][3] == year)) { numevents++; } } if (numevents == 0) { return false; } else { return true; } } function showevents(day,month,year,week,dayofweek) { var theevent = ""; var floater = 0; for (var i = 0; i < events.length; i++) { // First we'll process recurring events (if any): if (events[i][0] != "") { if (events[i][0] == "D") { } if (events[i][0] == "W") { if ((events[i][2] == dayofweek)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[i][6] + '\n'; theevent += 'Start Time: ' + events[i][4] + '\n'; theevent += 'Ending Time: ' + events[i][5] + '\n'; theevent += 'Description: ' + events[i][7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } if (events[i][0] == "M") { } if (events[i][0] == "Y") { if ((events[i][2] == day) && (events[i][1] == month)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[i][6] + '\n'; theevent += 'Start Time: ' + events[i][4] + '\n'; theevent += 'Ending Time: ' + events[i][5] + '\n'; theevent += 'Description: ' + events[i][7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } if (events[i][0] == "F") { if ((events[i][1] == 3) && (events[i][2] == 0) && (events[i][3] == 0) ) { if (easterday == day && eastermonth == month) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[i][6] + '\n'; theevent += 'Start Time: ' + events[i][4] + '\n'; theevent += 'Ending Time: ' + events[i][5] + '\n'; theevent += 'Description: ' + events[i][7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } else { floater = floatingholiday(year,events[i][1],events[i][2],events[i][3]); if ((month == 5) && (events[i][1] == 5) && (events[i][2] == 4) && (events[i][3] == 2)) { if ((floater + 7 <= 31) && (day == floater + 7)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[i][6] + '\n'; theevent += 'Start Time: ' + events[i][4] + '\n'; theevent += 'Ending Time: ' + events[i][5] + '\n'; theevent += 'Description: ' + events[i][7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } else if ((floater + 7 > 31) && (day == floater)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[i][6] + '\n'; theevent += 'Start Time: ' + events[i][4] + '\n'; theevent += 'Ending Time: ' + events[i][5] + '\n'; theevent += 'Description: ' + events[i][7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } else if ((events[i][1] == month) && (floater == day)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[i][6] + '\n'; theevent += 'Start Time: ' + events[i][4] + '\n'; theevent += 'Ending Time: ' + events[i][5] + '\n'; theevent += 'Description: ' + events[i][7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } } } // Now we'll process any One Time events happening on the matching month, day, year: else if ((events[i][2] == day) && (events[i][1] == month) && (events[i][3] == year)) { theevent += "Events of: \n" + month +'/'+ day +'/'+ year + '\n'; theevent += events[i][6] + '\n'; theevent += 'Start Time: ' + events[i][4] + '\n'; theevent += 'Ending Time: ' + events[i][5] + '\n'; theevent += 'Description: ' + events[i][7] + '\n'; theevent += '\n -------------- \n\n'; document.forms.eventform.eventlist.value = theevent; } } if (theevent == "") document.forms.eventform.eventlist.value = 'No events to show.'; } function floatingholiday(targetyr,targetmo,cardinaloccurrence,targetday) { // Floating holidays/events of the events.js file uses: // the Month field for the Month (here it becomes the targetmo field) // the Day field as the Cardinal Occurrence (here it becomes the cardinaloccurrence field) // 1=1st, 2=2nd, 3=3rd, 4=4th, 5=5th, 6=6th occurrence of the day listed next // the Year field as the Day of the week the event/holiday falls on (here it becomes the targetday field) // 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday // example: "F", "1", "3", "2", = Floating holiday in January on the 3rd Monday of that month. // // In our code below: // targetyr is the active year // targetmo is the active month (1-12) // cardinaloccurrence is the xth occurrence of the targetday (1-6) // targetday is the day of the week the floating holiday is on // 0=Sun; 1=Mon; 2=Tue; 3=Wed; 4=Thu; 5=Fri; 6=Sat // Note: subtract 1 from the targetday field if the info comes from the events.js file // // Note: // If Memorial Day falls on the 22nd, 23rd, or 24th, then we add 7 to the dayofmonth to the result. // // Example: targetyr = 2052; targetmo = 5; cardinaloccurrence = 4; targetday = 1 // This is the same as saying our floating holiday in the year 2052, is during May, on the 4th Monday // var firstdate = new Date(String(targetmo)+"/1/"+String(targetyr)); // Object Storing the first day of the current month. var firstday = firstdate.getUTCDay(); // The first day (0-6) of the target month. var dayofmonth = 0; // zero out our calendar day variable. targetday = targetday - 1; if (targetday >= firstday) { cardinaloccurrence--; // Subtract 1 from cardinal day. dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } else { dayofmonth = (cardinaloccurrence * 7) + ((targetday - firstday)+1); } return dayofmonth; }