rem: var date = cal.date.getDate() - 1; var el = cal.currentDateEl; var ne = null; var prev = (ev.keyCode == 37) || (ev.keyCode == 38); switch (ev.keyCode) { case 37: (--date >= 0) && (ne = cal.ar_days[date]); break; case 38: date -= 7; (date >= 0) && (ne = cal.ar_days[date]); break; case 39: (++date < cal.ar_days.length) && (ne = cal.ar_days[date]); break; case 40: date += 7; (date < cal.ar_days.length) && (ne = cal.ar_days[date]); 
add: var prev, x, y, ne, el, step; prev = K == 37 || K == 38; step = (K == 37 || K == 39) ? 1 : 7; function setVars() { el = cal.currentDateEl; var p = el.pos; x = p & 15; y = p >> 4; ne = cal.ar_days[y][x]; };setVars(); function prevMonth() { var date = new Date(cal.date); date.setDate(date.getDate() - step); cal.setDate(date); }; function nextMonth() { var date = new Date(cal.date); date.setDate(date.getDate() + step); cal.setDate(date); }; while (1) { switch (K) { case 37: if (--x >= 0) ne = cal.ar_days[y][x]; else { x = 6; K = 38; continue; } break; case 38: if (--y >= 0) ne = cal.ar_days[y][x]; else { prevMonth(); setVars(); } break; case 39: if (++x < 7) ne = cal.ar_days[y][x]; else { x = 0; K = 40; continue; } break; case 40: if (++y < cal.ar_days.length) ne = cal.ar_days[y][x]; else { nextMonth(); setVars(); } break; } 
context: Calendar._keyEvent = function(ev) {	if (!window.calendar) {		return false;	}	(Calendar.is_ie) && (ev = window.event);	var cal = window.calendar;	var act = (Calendar.is_ie || ev.type == "keypress");	if (ev.ctrlKey) {		switch (ev.keyCode) {		    case 37: // KEY left			act && Calendar.cellClick(cal._nav_pm);			break;		    case 38: // KEY up			act && Calendar.cellClick(cal._nav_py);			break;		    case 39: // KEY right			act && Calendar.cellClick(cal._nav_nm);			break;		    case 40: // KEY down			act && Calendar.cellClick(cal._nav_ny);			break;		    default:			return false;		}	} else switch (ev.keyCode) {	    case 32: // KEY space (now)		Calendar.cellClick(cal._nav_now);		break;	    case 27: // KEY esc		act && cal.callCloseHandler();		break;	    case 37: // KEY left	    case 38: // KEY up	    case 39: // KEY right	    case 40: // KEY down		if (act) {			var date = cal.date.getDate() - 1;			var el = cal.currentDateEl;			var ne = null;			var prev = (ev.keyCode == 37) || (ev.keyCode == 38);			switch (ev.keyCode) {			    case 37: // KEY left				(--date >= 0) && (ne = cal.ar_days[date]);				break;			    case 38: // KEY up				date -= 7;				(date >= 0) && (ne = cal.ar_days[date]);				break;			    case 39: // KEY right				(++date < cal.ar_days.length) && (ne = cal.ar_days[date]);				break;			    case 40: // KEY down				date += 7;				(date < cal.ar_days.length) && (ne = cal.ar_days[date]);				break;			}			if (!ne) {				if (prev) {					Calendar.cellClick(cal._nav_pm);				} else {					Calendar.cellClick(cal._nav_nm);				}				date = (prev) ? cal.date.getMonthDays() : 1;				el = cal.currentDateEl;				ne = cal.ar_days[date - 1];			}			Calendar.removeClass(el, "selected");			Calendar.addClass(ne, "selected");			cal.date = new Date(ne.caldate);			cal.callHandler();			cal.currentDateEl = ne;		}		break;	    case 13: // KEY enter		if (act) {			cal.callHandler();			cal.hide();		}		break;	    default:		return false;	}	return Calendar.stopEvent(ev);};
meta: 412	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/412/cc0a102fe5cd9f8421b73686dd57c312335278dc/calendar.js/clean/include/jscalendar/calendar.js