{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Courier New;}{\f1\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 // <![CDATA[     \par
\par
// A quick test of the setGlobalVars method - remember, the "lang" attribute will NOT work when passed to this method\par
datePickerController.setGlobalVars(\{"split":["-dd","-mm"]\});\par
\par
/* \par
        The following function dynamically calculates Easter Monday's date.\par
        It is used as the "redraw" callback function for the second last calendar on the page\par
        and returns an empty object.\par
   \par
        It dynamically calculates Easter Monday for the year in question and uses\par
        the "adddisabledDates" method of the datePickercontroller Object to\par
        disable the date in question.\par
   \par
        NOTE: This function is not needed, it is only present to show you how you\par
        might use this callback function to disable dates dynamically!   \par
*/            \par
function disableEasterMonday(argObj) \{ \par
        // Dynamically calculate Easter Monday - I've forgotten where this code \par
        // was originally found and I don't even know if it returns a valid\par
        // result so don't use it in a prod environment...\par
        var y = argObj.yyyy,\par
            a=y%4,\par
            b=y%7,\par
            c=y%19,\par
            d=(19*c+15)%30,\par
            e=(2*a+4*b-d+34)%7,\par
            m=Math.floor((d+e+114)/31),\par
            g=(d+e+114)%31+1,            \par
            yyyymmdd = y + "0" + m + String(g < 10 ? "0" + g : g);         \par
        \par
        datePickerController.addDisabledDates(argObj.id, yyyymmdd); \par
        \par
        // The redraw callback expects an Object as a return value\par
        // so we just give it an empty Object... \par
        return \{\};\par
\};\par
\par
/* \par
\par
        The following functions updates a span with an "English-ised" version of the\par
        currently selected date for the last datePicker on the page. \par
   \par
        NOTE: These functions are not needed, they are only present to show you how you\par
        might use callback functions to use the selected date in other ways!\par
   \par
*/\par
function createSpanElement(argObj) \{\par
        // Make sure the span doesn't exist already\par
        if(document.getElementById("EnglishDate-" + argObj.id)) return;\par
\par
        // create the span node dynamically...\par
        var spn = document.createElement('span');\par
            p   = document.getElementById(argObj.id).parentNode;\par
            \par
        spn.id = "EnglishDate-" + argObj.id;\par
        p.parentNode.appendChild(spn);\par
        \par
        // Remove the bottom margin on the input's wrapper paragraph\par
        p.style.marginBottom = "0";\par
        \par
        // Add a whitespace character to the span\par
        spn.appendChild(document.createTextNode(String.fromCharCode(160)));\par
\};\par
\par
function showEnglishDate(argObj) \{\par
        // Grab the span & get a more English-ised version of the selected date\par
        var spn = document.getElementById("EnglishDate-" + argObj.id),\par
            formattedDate = datePickerController.printFormattedDate(argObj.date, "l-cc-sp-d-S-sp-F-sp-Y", false);\par
        \par
        // Make sure the span exists before attempting to use it!\par
        if(!spn) \{\par
                createSpanElement(argObj); \par
                spn = document.getElementById("EnglishDate-" + argObj.id);\par
        \};\par
        \par
        // Note: The 3rd argument to printFormattedDate is a Boolean value that \par
        // instructs the script to use the imported locale (true) or not (false)\par
        // when creating the dates. In this case, I'm not using the imported locale\par
        // as I've used the "S" format mask, which returns the English ordinal\par
        // suffix for a date e.g. "st", "nd", "rd" or "th" and using an\par
        // imported locale would look strange if an English suffix was included\par
        \par
        // Remove the current contents of the span\par
        while(spn.firstChild) spn.removeChild(spn.firstChild);\par
        \par
        // Add a new text node containing our formatted date\par
        spn.appendChild(document.createTextNode(formattedDate));\par
\};\par
\par
      \par
/* \par
 \par
        Create a datepicker using Javascript and not classNames\par
        -------------------------------------------------------\par
      \par
        datePickerController.createDatePicker has to be called onload as we need \par
        the locale file to have loaded before we can create a datepicker.\par
      \par
        The only way to get around using an onload event is to \par
        explicitly set the language by adding it before the datepicker script e.g:\par
      \par
        <script type="text/javascript" src="/the/path/to/the/language/file.js"></ script>\par
        <script type="text/javascript" src="/the/path/to/the/datepicker/file.js"></ script>\par
     \par
*/\par
            \par
datePickerController.addEvent(window, "load", function() \{\par
      var opts = \{\par
        // The ID of the associated form element\par
        id:"dp-js1",\par
        // The date format to use\par
        format:"d-sl-m-sl-Y",\par
        // Days to highlight (starts on Monday)\par
        highlightDays:[0,0,0,0,0,1,1],\par
        // Days of the week to disable (starts on Monday)\par
        disabledDays:[0,0,0,0,0,0,0],\par
        // Dates to disable (YYYYMMDD format, "*" wildcards excepted)\par
        disabledDates:\{\par
                "20090601":"20090612", // Range of dates\par
                "20090622":"1",        // Single date\par
                "****1225":"1"         // Wildcard example \par
                \},\par
        // Date to always enable\par
        enabledDates:\{\},\par
        // Don't fade in the datepicker\par
        // NOTE: Only relevant if "staticPos" is set to false\par
        noFadeEffect:false,\par
        // Is it inline or popup\par
        staticPos:false,\par
        // Do we hide the associated form element on create\par
        hideInput:false,\par
        // Do we hide the today button\par
        noToday:true,\par
        // Do we show weeks along the left hand side\par
        showWeeks:true,\par
        // Is it drag disabled\par
        // NOTE: Only relevant if "staticPos" is set to false\par
        dragDisabled:true,\par
        // Positioned the datepicker within a wrapper div of your choice (requires the ID of the wrapper element)\par
        // NOTE: Only relevant if "staticPos" is set to true\par
        positioned:"",\par
        // Do we fill the entire grid with dates\par
        fillGrid:true,\par
        // Do we constrain dates not within the current month so that they cannot be selected\par
        constrainSelection:true,\par
        // Callback Object\par
        callbacks:\{"create":[createSpanElement], "dateselect":[showEnglishDate]\},\par
        // Do we create the button within a wrapper element of your choice (requires the ID of the wrapper element)\par
        // NOTE: Only relevant if staticPos is set to false\par
        buttonWrapper:"",\par
        // Do we start the cursor on a specific date (YYYYMMDD format string)\par
        cursorDate:""      \par
      \};\par
      datePickerController.createDatePicker(opts);\par
\});\par
\par
// ]]>\par
\par
\f1\par
}
 