Jquery Date Picker with different links
<p>I am new to Jquery. I am using JQuery DatePicker as a calender entry with some date showing in different colour but my problem is that when I want to assign a link to that date it is now working well...Here is the code</p>

<p><strong>I defined the pink and green as style as well and is working perfect.</strong></p>

<pre><code>var events = {};
    events[new Date("02/14/2011")] = new Event("Valentines Day", "pink");
    events[new Date("02/18/2011")] = new Event("Payday", "green");

    $('#calender').datepicker({
        changeMonth : true,
        changeYear : true,
        beforeShowDay : function(date) {
            var event = events[date];
            if (event) {
                return [ true, event.className, event.text ];
            } else {
                return [ true, '', '' ];
            }
        },
        onSelect : function(date) {
            var event = events[date];
            alert(event.text ,"Event on " + date);
        }
    });
</code></pre>

<p>title on date 02/14/2011 and 02/18/2011 is perfectly working because of beforeShowDay but when I am doing the same thing in onSelect it is showing undefined.Thanks in advance......Thanks</p>
