// JavaScript Document
function initBuscador(strNombre)
{
	var txtBox = $("#" + strNombre);
	
	txtBox.focus(); // - Establecemos el foco en el buscador - //
	
	txtBox.keypress(function (e) {
				
		if(e.which == 13)
		{
			if ($(this).val() == "") 
			{
				setMensaje("mensaje", "ventanaMensaje", "txtMensaje", "Debe introducir un texto válido en el buscador");
			}
			else
			{
				window.location = "listado.php?txt=" + $(this).val();
			}
		}
		
	});
}
