/* (c) 2010 - Jean Luc BIELLMANN */

//var _FormViewEvents = {
	//keyPress : function (e) {
//console.log('keyPress : keyCode='+e.keyCode);	
//console.log(_FormViewCtrl.mode);
		//if ($('formViewData')) {
			//if (_FormViewCtrl.mode=='ls' && $$('tr.hover').length) {
				//var tr = $$('tr.hover')[0];
				//switch (e.keyCode) {		
					//case Event.KEY_UP:
						//var prev = e.shiftKey ? tr.previous('tr',5) : tr.previous('tr');
						//if (prev && prev.id.match(/row[0-9]+/)) {
							//_FormViewData.lsRowSelect(prev);
						//return true;
							//e.stopPropagation();
						//}
						//break;
					//case Event.KEY_DOWN:
						//var next = e.shiftKey ? tr.next('tr',5) : tr.next('tr');
						//if (next && next.id.match(/row[0-9]+/)) {
							//_FormViewData.lsRowSelect(next);
						//return true;
							//e.stopPropagation();
						//}
						//break;
				//}
			//}
		//}
		//return true;
	//},
	//keyDown : function (e) {
//console.log('keyDown : keyCode='+e.keyCode);		
//console.log(_FormViewCtrl.mode);
		//if ($('formViewData')) {
			//if (_FormViewCtrl.mode=='ls' && $$('tr.hover').length) {
				//var tr = $$('tr.hover')[0];
////console.debug(e);
				//switch (e.keyCode) {
					//case Event.KEY_RETURN:
						//if (Event.element(e)==$('formViewCtrl__kws')) {
							//_FormViewCtrl.search();
							//e.stopPropagation();
						//}
						//break;
					//case Event.KEY_RIGHT:
						//_FormViewData.lsRowEdit(tr);
						//e.stopPropagation();
						//break;
				//}
			//}
			//if (_FormViewCtrl.mode=='edit') {
				//switch (e.keyCode) {
					//case Event.KEY_RETURN:
						//if (e.shiftKey) {
							//_FormViewCtrl.json('c='+_FormViewCtrl.cn+'&f=rec');	
							//e.stopPropagation();
						//}
						//break;
					//case Event.KEY_DELETE:		
						//if (e.shiftKey) {
							//if (confirm('Effacer la fiche ?'))
								//_FormViewCtrl.del();
							//e.stopPropagation();
						//}
						//break;
					//case Event.KEY_ESC:
						//_FormViewCtrl.ls('');
						//e.stopPropagation();
						//break;
				//}
			//}
		//}
		//return true;
	//},
	//mouseMove : function (e) {
		//if ($('formViewData') && _FormViewCtrl.mode=='ls')
			//_FormViewData.eventMouseMove(e);
		//return true;
	//},
	//mouseClick : function (e) {
		//if ($('formViewData') && _FormViewCtrl.mode=='ls')
			//_FormViewData.eventMouseClick(e);
		//return true;
	//}
//};
	
//Event.observe(window,'load',function () {
	//if ($('formView')) {
		//document.body.observe('mousemove',_FormViewEvents.mouseMove);
		//document.body.observe('click',_FormViewEvents.mouseClick);
		//document.body.observe('keypress',_FormViewEvents.keyPress);
		//document.body.observe('keydown',_FormViewEvents.keyDown);
	//}
//});

