// JavaScript Document
<!--

function fnLanceRec(){

	error = 0;
	if (window.document.formrecherche.champcherche.value == window.document.formrecherche.vallib1.value){alert(window.document.formrecherche.vallib2.value);error=1;}
	if ((error == 0) && (window.document.formrecherche.champcherche.value == '')){alert(window.document.formrecherche.vallib2.value);error=1;}
	if (error == 0) {	
		rec = window.document.formrecherche.champcherche.value;
		window.document.formrecherche.valrecherche.value = rec;

		window.document.formrecherche.submit()
	}
}

if (document.layers)
document.captureEvents(Event.KEYPRESS)

 function process_keypress(e,val) {
 // si nous avons un évênement clavier

 	if(window.event){
		if (window.event.type == "keypress" & window.event.keyCode == 13){
			if (val == 1) {fnLanceRec() ;}
			if (val == 2) {fnEnvoyer();}
		}
	}
	if(e)
	{
		if (e.type == "keypress" & e.keyCode == 13) {
			if (val == 1) {fnLanceRec() ;}
			if (val == 2) {fnEnvoyer();}
		}
	}
	}
 
 document.onkeypress = process_keypress;
 
//-->