Strange behaviour with the DatePicker

Strange behaviour with the DatePicker


Hi
I am using the DatePicker component. I tested this locally and it
worked fine. However, when I tried to bring it in to my application I
started to get very strange behaviour.
The month outputs correctly with the next/previous navigation buttons.
However, the days of the week are output vertically. Then I get about
70 lines of Javascript that is output to the page(see below). I have
tested in both IE and firefox but not getting any scripting errors.
The output is as follows:
September 2008
S
M
T
W
T
F
S
function (iterator, context) { var index = 0; iterator =
iterator.bind(context); try { this._each(function (value)
{iterator(value, index++);}); } catch (e) { if (e != $break) { throw
e; } } return this; }
function (number, iterator, context) { iterator = iterator ?
iterator.bind(context) : Prototype.K; var index = - number, slices =
[], array = this.toArray(); while ((index etc etc etc etc etc etc etc
etc etc
My JQuery code looks as follows:
var J = jQuery.noConflict();
// <![CDATA[
J('#calendar').jCal({
    day:            new Date(),
    days:            1,
    showMonths:        1,
    sDate:            new Date(),
    eDate:            new Date(),
    callback:        function (day, days) {
            J(this._target).find('.dInfo').remove();
            var dCursor = new Date( day.getTime() );
            var currDay = document.getElementById(this.cID + 'd_' +
( dCursor.getMonth() + 1 ) + '_' + dCursor.getDate() + '_' +
dCursor.getFullYear());
            J(currDay, this._target).append('<div class="dInfo"></div>');
            dCursor.setDate( dCursor.getDate() + 1 );
            return true;
            }
    });
// ]]>
In my xhtml file I have the following divs:
<t:div id="calendar"></t:div>
<t:div id="calResults">
Any help greatly appreciated