var scwDateNow = new Date(Date.parse(new Date().toDateString())); var scwBaseYear = scwDateNow.getFullYear()-50; var scwDropDownYears = 51; var scwToday = 'Today:', scwDrag = 'click here to drag', scwInvalidDateMsg = 'The entered date is invalid.\n', scwOutOfRangeMsg = 'The entered date is out of range.', scwDoesNotExistMsg = 'The entered date does not exist.', scwInvalidAlert = ['Invalid date (',') ignored.'], scwDateDisablingError = ['Error ',' is not a Date object.'], scwRangeDisablingError = ['Error ',' should consist of two elements.'], scwArrMonthNames = ['Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec'], scwArrWeekInits = ['S','M','T','W','T','F','S']; var scwWeekStart = 1; var scwWeekNumberDisplay = false; var scwWeekNumberBaseDay = 4; var scwArrDelimiters = ['/','-','.',',',' ']; var scwDateDisplayFormat = 'YYYY-MM-DD'; // e.g. 'MMM-DD-YYYY' for the US var scwDateOutputFormat = 'YYYY-MM-DD'; // e.g. 'MMM-DD-YYYY' for the US // The input date is fully parsed so a format is not required, // but there is no way to differentiate the sequence reliably. // // e.g. Is 05/08/03 5th August 2003, // 8th May 2003 or even // 3rd August 2005? // // So, you have to state how the code should interpret input dates. // // The sequence should always contain one D, one M and one Y only, // in any order. var scwDateInputSequence = 'DMY'; // e.g. 'MDY' for the US // Note: Because the user may select a date then trigger the // calendar again to select another, it is necessary to // have the input date sequence in the same order as the // output display format. To allow the flexibility of having // a full input date and a partial (e.g. only Month and Year) // output, the input sequence is set separately. // // The same reason determines that the delimiters used should // be in scwArrDelimiters. // scwZindex controls how the pop-up calendar interacts with the rest // of the page. It is usually adequate to leave it as 1 (One) but I // have made it available here to help anyone who needs to alter the // level in order to ensure that the calendar displays correctly in // relation to all other elements on the page. var scwZindex = 1; // Personally I like the fact that entering 31-Sep-2005 displays // 1-Oct-2005, however you may want that to be an error. If so, // set scwBlnStrict = true. That will cause an error message to // display and the selected month is displayed without a selected // day. Thanks to Brad Allan for his feedback prompting this feature. var scwBlnStrict = false; // If you wish to disable any displayed day, e.g. Every Monday, // you can do it by setting the following array. The array elements // match the displayed cells. // // You could put something like the following in your calling page // to disable all weekend days; // // for (var i=0;i"); document.writeln( '.scw {padding:1px;vertical-align:middle;}'); document.writeln( 'iframe.scw {position:absolute;z-index:' + scwZindex + ';top:0px;left:0px;visibility:hidden;' + 'width:1px;height:1px;}'); document.writeln( 'table.scw {padding:0px;visibility:hidden;' + 'position:absolute;width:200px;' + 'top:0px;left:0px;z-index:' +(scwZindex+1) + ';text-align:center;cursor:default;' + 'padding:1px;vertical-align:middle;' + 'background-color:' + scwBackground + ';border:ridge 2px;font-size:10pt;' + 'font-family:Arial,Helvetica,Sans-Serif;' + 'font-weight:bold;}'); document.writeln( 'td.scwDrag {text-align:center;font-size:8pt;' + 'background-color:' + scwDragBackground + ';padding:0px 0px;color:' + scwDragText + "}"); document.writeln( 'td.scwHead {padding:0px 0px;text-align:center;}'); document.writeln( 'select.scwHead {margin:3px 1px;}'); document.writeln( 'input.scwHead {height:22px;width:22px;' + 'vertical-align:middle;' + 'text-align:center;margin:2px 1px;' + 'font-size:10pt;font-family:fixedSys;' + 'font-weight:bold;}'); document.writeln( 'td.scwWeekNumberHead ' + '{text-align:center;font-weight:bold;' + 'padding:0px;color:' + scwBackground + ';}'); document.writeln( 'td.scwWeek {text-align:center;font-weight:bold;' + 'padding:0px;color:' + scwHeadText + ';}'); document.writeln( 'table.scwCells {text-align:right;font-size:8pt;' + 'width:96%;font-family:' + 'Arial,Helvetica,Sans-Serif;}'); document.writeln( 'td.scwCells {padding:3px;vertical-align:middle;' + 'width:16px;height:16px;' + 'font-weight:bold;color:' + scwCellText + ';background-color:' + scwCellBackground + '}'); document.writeln( 'td.scwWeekNo {padding:3px;vertical-align:middle;' + 'width:16px;height:16px;' + 'font-weight:bold;color:' + scwWeekNumberText + ';background-color:' + scwWeekNumberBackground + '}'); document.writeln( 'td.scwWeeks {padding:3px;vertical-align:middle;' + 'width:16px;height:16px;' + 'font-weight:bold;color:' + scwCellText + ';background-color:' + scwCellBackground + '}'); document.writeln( 'td.scwFoot {padding:0px;text-align:center;' + 'font-weight:normal;color:' + scwTodayText + ';}'); document.writeln(""); //****************************************************************************** //------------------------------------------------------------------------------ // End of customisation section //------------------------------------------------------------------------------ //****************************************************************************** // Variables required by both scwShow and scwShowMonth var scwTargetEle, scwTriggerEle, scwMonthSum = 0, scwBlnFullInputDate = false, scwPassEnabledDay = new Array(), scwSeedDate = new Date(), scwParmActiveToday = true, scwWeekStart = scwWeekStart%7; // Add a method to format a date into the required pattern Date.prototype.scwFormat = function(scwFormat) {var charCount = 0, codeChar = '', result = ''; for (var i=0;i<=scwFormat.length;i++) {if (i 0) {result += codeChar;} } if (iscwSeedDate ) {scwSeedDate = new Date(scwBaseYear + Math.floor(scwDropDownYears / 2), 5, 1); } } else {function scwInputFormat(scwEleValue) {var scwArrSeed = new Array(), scwArrInput = scwEle.value. split(new RegExp('[\\'+scwArrDelimiters. join('\\')+']+','g')); // "Escape" all the user defined date delimiters above - // several delimiters will need it and it does no harm for // the others. // Strip any empty array elements (caused by delimiters) // from the beginning or end of the array. They will // still appear in the output string if in the output // format. if (scwArrInput[0].length==0) scwArrInput.splice(0,1); if (scwArrInput[scwArrInput.length-1].length==0) scwArrInput.splice(scwArrInput.length-1,1); scwBlnFullInputDate = false; switch (scwArrInput.length) {case 1: {// Year only entry scwArrSeed[0] = parseInt(scwArrInput[0],10); // Year scwArrSeed[1] = '6'; // Month scwArrSeed[2] = 1; // Day break; } case 2: {// Year and Month entry scwArrSeed[0] = parseInt(scwArrInput[scwDateInputSequence. replace(/D/i,''). search(/Y/i)],10); // Year scwArrSeed[1] = scwArrInput[scwDateInputSequence. replace(/D/i,''). search(/M/i)]; // Month scwArrSeed[2] = 1; // Day break; } case 3: {// Day Month and Year entry scwArrSeed[0] = parseInt(scwArrInput[scwDateInputSequence. search(/Y/i)],10); // Year scwArrSeed[1] = scwArrInput[scwDateInputSequence. search(/M/i)]; // Month scwArrSeed[2] = parseInt(scwArrInput[scwDateInputSequence. search(/D/i)],10); // Day scwBlnFullInputDate = true; break; } default: {// A stuff-up has led to more than three elements in // the date. scwArrSeed[0] = 0; // Year scwArrSeed[1] = 0; // Month scwArrSeed[2] = 0; // Day } } // These regular expressions validate the input date format // to the following rules; // Day 1-31 (optional zero on single digits) // Month 1-12 (optional zero on single digits) // or case insensitive name // Year One, Two or four digits // Months names are as set in the language dependent // definitions and delimiters are set just below there var scwExpValDay = /^(0?[1-9]|[1-2]\d|3[0-1])$/, scwExpValMonth = new RegExp("^(0?[1-9]|1[0-2]|" + scwArrMonthNames.join("|") + ")$","i"), scwExpValYear = /^(\d{1,2}|\d{4})$/; // Apply validation and report failures if (scwExpValYear.exec(scwArrSeed[0]) == null || scwExpValMonth.exec(scwArrSeed[1]) == null || scwExpValDay.exec(scwArrSeed[2]) == null) { scwBlnFullInputDate = false; scwArrSeed[0] = scwBaseYear + Math.floor(scwDropDownYears/2); // Year scwArrSeed[1] = '6'; // Month scwArrSeed[2] = 1; // Day } // Return the Year in scwArrSeed[0] // Month in scwArrSeed[1] // Day in scwArrSeed[2] return scwArrSeed; } // Parse the string into an array using the allowed delimiters scwArrSeedDate = scwInputFormat(scwEle.value); // So now we have the Year, Month and Day in an array. // If the year is one or two digits then the routine assumes a // year belongs in the 21st Century unless it is less than 50 // in which case it assumes the 20th Century is intended. if (scwArrSeedDate[0]<100) scwArrSeedDate[0] += (scwArrSeedDate[0]>50)?1900:2000; // Check whether the month is in digits or an abbreviation if (scwArrSeedDate[1].search(/\d+/)!=0) {month = scwArrMonthNames.join('|').toUpperCase(). search(scwArrSeedDate[1].substr(0,3). toUpperCase()); scwArrSeedDate[1] = Math.floor(month/4)+1; } scwSeedDate = new Date(scwArrSeedDate[0], scwArrSeedDate[1]-1, scwArrSeedDate[2]); } // Test that we have arrived at a valid date if (isNaN(scwSeedDate)) {alert( scwInvalidDateMsg + scwInvalidAlert[0] + scwEle.value + scwInvalidAlert[1]); scwSeedDate = new Date(scwBaseYear + Math.floor(scwDropDownYears/2),5,1); scwBlnFullInputDate=false; } else {// Test that the date is within range, // if not then set date to a sensible date in range. if ((new Date(scwBaseYear,0,1)) > scwSeedDate) {if (scwBlnStrict) alert(scwOutOfRangeMsg); scwSeedDate = new Date(scwBaseYear,0,1); scwBlnFullInputDate=false; } else {if ((new Date(scwBaseYear+scwDropDownYears-1,11,31))< scwSeedDate) {if (scwBlnStrict) alert(scwOutOfRangeMsg); scwSeedDate = new Date(scwBaseYear + Math.floor(scwDropDownYears)-1, 11,1); scwBlnFullInputDate=false; } else {if (scwBlnStrict && scwBlnFullInputDate && (scwSeedDate.getDate() != scwArrSeedDate[2] || (scwSeedDate.getMonth()+1) != scwArrSeedDate[1] || scwSeedDate.getFullYear() != scwArrSeedDate[0] ) ) {alert(scwDoesNotExistMsg); scwSeedDate = new Date(scwSeedDate.getFullYear(), scwSeedDate.getMonth()-1,1); scwBlnFullInputDate=false; } } } } // Test the disabled dates for validity // Give error message if not valid. for (var i=0;i scwDisabledDates[i][1]) ) {scwDisabledDates[i].reverse();} } else {alert(scwDateDisablingError[0] + scwDisabledDates[i] + scwDateDisablingError[1]);} } } // Calculate the number of months that the entered (or // defaulted) month is after the start of the allowed // date range. scwMonthSum = 12*(scwSeedDate.getFullYear()-scwBaseYear)+ scwSeedDate.getMonth(); // Set the drop down boxes. document.getElementById('scwYears').options.selectedIndex = Math.floor(scwMonthSum/12); document.getElementById('scwMonths').options.selectedIndex= (scwMonthSum%12); // Position the calendar box var offsetTop =parseInt(scwEle.offsetTop ,10) + parseInt(scwEle.offsetHeight,10), offsetLeft=parseInt(scwEle.offsetLeft,10); scwTargetEle=scwEle; do {scwEle=scwEle.offsetParent; offsetTop +=parseInt(scwEle.offsetTop,10); offsetLeft +=parseInt(scwEle.offsetLeft,10); } while (scwEle.tagName!='BODY'); document.getElementById('scw').style.top =offsetTop +'px'; document.getElementById('scw').style.left=offsetLeft+'px'; if (document.getElementById('scwIframe')) {document.getElementById('scwIframe').style.top=offsetTop +'px'; document.getElementById('scwIframe').style.left=offsetLeft+'px'; document.getElementById('scwIframe').style.width= (document.getElementById('scw').offsetWidth-2)+'px'; document.getElementById('scwIframe').style.height= (document.getElementById('scw').offsetHeight-2)+'px'; document.getElementById('scwIframe').style.visibility='visible'; } // Check whether or not dragging is allowed and display drag handle // if necessary document.getElementById('scwDrag').style.display=0A (scwAllowDrag)0A .159.html'scwIFrame'http://www.brenex.com.au/js/))?'block':'table-row') :'none'; // Display the month scwShowMonth(0); // Show it on the page document.getElementById('scw').style.visibility='visible'; if (typeof event=='undefined') {scwSourceEle.parentNode. addEventListener("click",scwStopPropagation,false); } else {event.cancelBubble = true;} } function scwHide() {document.getElementById('scw').style.visibility='hidden'; if (document.getElementById('scwIframe')) {document.getElementById('scwIframe').style.visibility='hidden';} if (typeof scwNextAction!='undefined' && scwNextAction!=null) {scwNextActionReturn = scwNextAction(); // Explicit null set to prevent closure causing memory leak scwNextAction = null; } } function scwCancel(scwEvt) {if (scwClickToHide) scwHide(); scwStopPropagation(scwEvt); } function scwStopPropagation(scwEvt) {if (scwEvt.stopPropagation) scwEvt.stopPropagation(); // Capture phase else scwEvt.cancelBubble = true; // Bubbling phase } function scwBeginDrag(event) {var elementToDrag = document.getElementById('scw'); var deltaX = event.clientX, deltaY = event.clientY, offsetEle = elementToDrag; do {deltaX -= parseInt(offsetEle.offsetLeft,10); deltaY -= parseInt(offsetEle.offsetTop ,10); offsetEle = offsetEle.offsetParent; } while (offsetEle.tagName!='BODY' && offsetEle.tagName!='HTML'); if (document.addEventListener) {document.addEventListener('mousemove', moveHandler, true); // Capture phase document.addEventListener('mouseup', upHandler, true); // Capture phase } else {elementToDrag.attachEvent('onmousemove', moveHandler); // Bubbling phase elementToDrag.attachEvent('onmouseup', upHandler); // Bubbling phase elementToDrag.setCapture(); } scwStopPropagation(event); function moveHandler(e) {if (!e) e = window.event; elementToDrag.style.left = (e.clientX - deltaX) + 'px'; elementToDrag.style.top = (e.clientY - deltaY) + 'px'; if (document.getElementById('scwIframe')) {document.getElementById('scwIframe').style.left = (e.clientX - deltaX) + 'px'; document.getElementById('scwIframe').style.top = (e.clientY - deltaY) + 'px'; } scwStopPropagation(e); } function upHandler(e) {if (!e) e = window.event; if (document.removeEventListener) {document.removeEventListener('mousemove', moveHandler, true); // Capture phase document.removeEventListener('mouseup', upHandler, true); // Capture phase } else {elementToDrag.detachEvent('onmouseup', upHandler); // Bubbling phase elementToDrag.detachEvent('onmousemove', moveHandler); // Bubbling phase elementToDrag.releaseCapture(); } scwStopPropagation(e); } } function scwShowMonth(scwBias) {// Set the selectable Month and Year // May be called: from the left and right arrows // (shift month -1 and +1 respectively) // from the month selection list // from the year selection list // from the showCal routine // (which initiates the display). var scwShowDate = new Date(Date.parse(new Date().toDateString())), scwStartDate = new Date(), scwSaveBackground, scwSaveText; scwSelYears = document.getElementById('scwYears'); scwSelMonths = document.getElementById('scwMonths'); if (scwSelYears.options.selectedIndex>-1) {scwMonthSum=12*(scwSelYears.options.selectedIndex)+scwBias; if (scwSelMonths.options.selectedIndex>-1) {scwMonthSum+=scwSelMonths.options.selectedIndex;} } else {if (scwSelMonths.options.selectedIndex>-1) {scwMonthSum+=scwSelMonths.options.selectedIndex;} } scwShowDate.setFullYear(scwBaseYear + Math.floor(scwMonthSum/12), (scwMonthSum%12), 1); // If the Week numbers are displayed, shift the week day names // to the right. document.getElementById("scwWeek_").style.display= (scwWeekNumberDisplay)?'block':'none'; if ((12*parseInt((scwShowDate.getFullYear()-scwBaseYear),10)) + parseInt(scwShowDate.getMonth(),10) < (12*scwDropDownYears) && (12*parseInt((scwShowDate.getFullYear()-scwBaseYear),10)) + parseInt(scwShowDate.getMonth(),10) > -1) {scwSelYears.options.selectedIndex=Math.floor(scwMonthSum/12); scwSelMonths.options.selectedIndex=(scwMonthSum%12); scwCurMonth = scwShowDate.getMonth(); scwShowDate.setDate((((scwShowDate. getDay()-scwWeekStart)<0)?-6:1)+ scwWeekStart-scwShowDate.getDay()); scwStartDate = new Date(scwShowDate); var scwFoot = document.getElementById('scwFoot'); function scwFootOutput() {scwSetOutput(scwDateNow);} function scwFootOver() {document.getElementById('scwFoot').style.color= scwTodayHighlight; document.getElementById('scwFoot').style.fontWeight='bold'; } function scwFootOut() {document.getElementById('scwFoot').style.color=scwTodayText; document.getElementById('scwFoot').style.fontWeight='normal'; } if (scwDisabledDates.length==0) {if (scwActiveToday && scwParmActiveToday) {scwFoot.onclick =scwFootOutput; scwFoot.onmouseover =scwFootOver; scwFoot.onmouseout =scwFootOut; scwFoot.style.cursor= (document.getElementById('scwIframe'))0A .161.html'hand':'pointer'; } else {scwFoot.onclick =null; if (document.addEventListener) {scwFoot.addEventListener('click', scwStopPropagation, false);} else {scwFoot.attachEvent('onclick', scwStopPropagation);} scwFoot.onmouseover =null; scwFoot.onmouseout =null; scwFoot.style.cursor='default'; } } else {for (var k=0;k= scwDisabledDates[k][0]. valueOf() && scwDateNow.valueOf() <= scwDisabledDates[k][1]. valueOf() ) ) ) ) {scwFoot.onclick =null; if (document.addEventListener) {scwFoot.addEventListener('click', scwStopPropagation, false); } else {scwFoot.attachEvent('onclick', scwStopPropagation); } scwFoot.onmouseover =null; scwFoot.onmouseout =null; scwFoot.style.cursor='default'; break; } else {scwFoot.onclick =scwFootOutput; scwFoot.onmouseover =scwFootOver; scwFoot.onmouseout =scwFootOut; scwFoot.style.cursor= (document.getElementById('scwIframe'))0A .162.html'hand':'pointer'; } } } function scwSetOutput(scwOutputDate) {scwTargetEle.value = scwOutputDate.scwFormat(scwDateOutputFormat); scwHide(); } function scwCellOutput(scwEvt) {var scwEle = scwEventTrigger(scwEvt), scwOutputDate = new Date(scwStartDate); if (scwEle.nodeType==3) scwEle=scwEle.parentNode; scwOutputDate.setDate(scwStartDate.getDate() + parseInt(scwEle.id.substr(8),10)); scwSetOutput(scwOutputDate); } function scwHighlight(e) {var scwEle = scwEventTrigger(e); if (scwEle.nodeType==3) scwEle=scwEle.parentNode; scwSaveText =scwEle.style.color; scwSaveBackground =scwEle.style.backgroundColor; scwEle.style.color =scwHighlightText; scwEle.style.backgroundColor =scwHighlightBackground; return true; } function scwUnhighlight(e) {var scwEle = scwEventTrigger(e); if (scwEle.nodeType==3) scwEle =scwEle.parentNode; scwEle.style.backgroundColor =scwSaveBackground; scwEle.style.color =scwSaveText; return true; } function scwEventTrigger(e) {if (!e) e = event; return e.target||e.srcElement; } function scwWeekNumber(scwInDate) {// The base day in the week of the input date var scwInDateWeekBase = new Date(scwInDate); scwInDateWeekBase.setDate(scwInDateWeekBase.getDate() - scwInDateWeekBase.getDay() + scwWeekNumberBaseDay + ((scwInDate.getDay()> scwWeekNumberBaseDay)?7:0)); // The first Base Day in the year var scwFirstBaseDay = new Date(scwInDateWeekBase.getFullYear(),0,1) scwFirstBaseDay.setDate(scwFirstBaseDay.getDate() - scwFirstBaseDay.getDay() + scwWeekNumberBaseDay ); if (scwFirstBaseDay < new Date(scwInDateWeekBase.getFullYear(),0,1)) {scwFirstBaseDay.setDate(scwFirstBaseDay.getDate()+7);} // Start of Week 01 var scwStartWeekOne = new Date(scwFirstBaseDay - scwWeekNumberBaseDay + scwInDate.getDay()); if (scwStartWeekOne > scwFirstBaseDay) {scwStartWeekOne.setDate(scwStartWeekOne.getDate()-7);} // Subtract the date of the current week from the date of the // first week of the year to get the number of weeks in // milliseconds. Divide by the number of milliseconds // in a week then round to no decimals in order to remove // the effect of daylight saving. Add one to make the first // week, week 1. Place a string zero on the front so that // week numbers are zero filled. var scwWeekNo = "0" + (Math.round((scwInDateWeekBase - scwFirstBaseDay)/604800000,0) + 1); // Return the last two characters in the week number string return scwWeekNo.substring(scwWeekNo.length-2,scwWeekNo.length); } // Treewalk to display the dates. // I tried to use getElementsByName but IE refused to cooperate // so I resorted to this method which works for all tested // browsers. var scwCells = document.getElementById('scwCells'); for (i=0;i (new Date(scwBaseYear+ scwDropDownYears- 1,11,31)) ) )?true:false; for (var k=0;k= scwDisabledDates[k][0].valueOf() && scwShowDate.valueOf() <= scwDisabledDates[k][1].valueOf() ) {scwDisabled = true;} } } if (scwDisabled || !scwEnabledDay[j-1+(7*((i*scwCells. childNodes. length)/6))] || !scwPassEnabledDay[(j-1+(7*(i*scwCells. childNodes. length/6)))%7] ) {scwRows.childNodes[j].onclick =null; scwRows.childNodes[j].onmouseover =null; scwRows.childNodes[j].onmouseout =null; scwRows.childNodes[j].style.cursor='default'; if (scwShowDate.getMonth()!=scwCurMonth) {scwCellStyle.color=scwDisabledExMonthText; scwCellStyle.backgroundColor= scwDisabledExMonthBackground; } else if (scwBlnFullInputDate && scwShowDate.toDateString()== scwSeedDate.toDateString()) {scwCellStyle.color=scwDisabledInDateText; scwCellStyle.backgroundColor= scwDisabledInDateBackground; } else if (scwShowDate.getDay()%6==0) {scwCellStyle.color=scwDisabledWeekendText; scwCellStyle.backgroundColor= scwDisabledWeekendBackground; } else {scwCellStyle.color=scwDisabledCellText; scwCellStyle.backgroundColor= scwDisabledCellBackground; } } else {scwRows.childNodes[j].onclick = scwCellOutput; scwRows.childNodes[j].onmouseover = scwHighlight; scwRows.childNodes[j].onmouseout = scwUnhighlight; scwRows.childNodes[j].style.cursor = (document.getElementById('scwIframe'))0A .163.html'hand':'pointer'; if (scwShowDate.getMonth()!=scwCurMonth) {scwCellStyle.color=scwExMonthText; scwCellStyle.backgroundColor= scwExMonthBackground; } else if (scwBlnFullInputDate && scwShowDate.toDateString()== scwSeedDate.toDateString()) {scwCellStyle.color=scwInDateText; scwCellStyle.backgroundColor= scwInDateBackground; } else if (scwShowDate.getDay()%6==0) {scwCellStyle.color=scwWeekendText; scwCellStyle.backgroundColor= scwWeekendBackground; } else {scwCellStyle.color=scwCellText; scwCellStyle.backgroundColor= scwCellBackground; } } scwShowDate.setDate(scwShowDate.getDate()+1); } } } } } } // ************************* // End of Function Library // ************************* // *************************** // Start of Calendar structure // *************************** document.write( "" + "" + "" + "" + "" + "" + "" + "" + "
" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
" + "" + "" + "" + "" + "" + "
" + "
" + "" + "" + ""); for (i=0;i" + scwArrWeekInits[(i+scwWeekStart)% scwArrWeekInits.length] + ""); document.write("" + "" + ""); for (i=0;i<6;i++) {document.write( "" + ""); for (j=0;j<7;j++) {document.write( ""); } document.write( ""); } document.write( ""); if ((new Date(scwBaseYear + scwDropDownYears, 11, 32)) > scwDateNow && (new Date(scwBaseYear, 0, 0)) < scwDateNow) {document.write( "" + "" + "" + "" + ""); } document.write( "
" + scwToday + " " + scwDateNow.scwFormat(scwDateDisplayFormat) + "
" + "
"); // *************************** // End of Calendar structure // *************************** // **************************************** // Start of document level event definition // **************************************** if (document.addEventListener) {document.addEventListener('click',scwHide, false);} else {document.attachEvent('onclick',scwHide);} // **************************************** // End of document level event definition // **************************************** // ************************************ // End of Simple Calendar Widget Code // ************************************