Getting runtime error in IE 6 and 7

Getting runtime error in IE 6 and 7


Following is the sequence of inclusion of files:-
<script type="text/javascript" src="path/to/js/calendar.js"></script>
<script type="text/javascript" src="path/to/js/date.js"></
script><script type="text/javascript" src="path/to/js/
jquery.datePicker.min-2.1.1.js"></script>
and following is the content of calendar.js file:-
===============================
function displayCalendar( popupRefId, dateRefId, monthRefId,
yearRefId, disablaPastDates){
    // initialise the "Select date" link
var $options = $('option', $('#'+yearRefId));
//Set start date as the minimum possible value that can be selected
from the select tags
var rangeOfDate = getRangeOfVal(dateRefId);
var rangeOfMonth = getRangeOfVal(monthRefId);
var rangeOfYear = getRangeOfVal(yearRefId);
var start = new Date(
                            rangeOfYear[0],
                            (rangeOfMonth[0] - 1),
                            rangeOfDate[0]
                        );
var end = new Date(
                            rangeOfYear[1],
                            (rangeOfMonth[1] - 1),
                            rangeOfDate[1]
                        );
    $('#'+popupRefId)
        .datePicker(
            {    // associate the link with a date picker
                createButton:false,
                startDate:start.asString(),
                endDate:end.asString(),
            }