tbody.addEvent('mousewheel', function(e){
e.stop(); // prevent the mousewheel from scrolling the page.
this.navigate('m', (e.wheel < 0 ? -1 : 1));
this.build();
}.bind(this));

for (var i = 1; i < 43; i++) { // 1 to 42 (6 x 7 or 6 weeks)
if ((i - 1) % 7 == 0) { tr = new Element('tr').inject(tbody); } // each week is it's own table row

var td = new Element('td').inject(tr);
var day = i - offset;
var date = new Date(this.curFullYear, this.curMonth, day); if (day < 1) { // last days of prev month
day = prev + day;
td.addClass('inactive');
}
else if (day > last) { // first days of next month
day = day - last;
td.addClass('inactive');
}
else {
if(date.getTime() == current)  { td.addClass('hilite');  }
else if (date.getTime() == today) { td.addClass('today');  } // add class for today

td.addEvents({
'click': function(day) {
this.curDate = day;
this.elementChange();
}.bind(this, day),
'mouseover': function(td) { 
td.addClass('hilite'); 
}.bind(this, td),
'mouseout': function(td, date) {
if(date.getTime() != current)  //在这火狐获取date错误,不知为啥
td.removeClass('hilite'); 
}.bind(this, [td, date])
}).addClass('active');
}

td.set('text',day);
}
return tbody;
},