function traerUltimasBusquedas(sessionId, texto, nombreInput, nroInput) {
	//Solo activo la caja de sugerencias cuando no hay nada escrito en ella o el session id viene vacio
	if ( (sessionId.length == 0) || (texto.length != 0 ) ){
		if (nroInput == 1)
		{
			//Oculto la caja de sugerencias
			jQuery('#suggestions').hide();
		}
		else if (nroInput == 2)
		{
			//Oculto la caja de sugerencias 2
			jQuery('#suggestions2').hide();
		}
	} else {
		//Levanto la info de la db y la muestro en la caja de sugerencias
		jQuery.post("javascripts/autocompleteBusquedas/buscar.php", {querySessionId: ""+sessionId+"", queryNombreInput: ""+nombreInput+"", queryNroInput: ""+nroInput+""}, function(data){
			if(data.length >0) {
				if (nroInput == 1)
				{
					jQuery('#suggestions').show();
					jQuery('#suggestions2').hide();
					jQuery('#autoSuggestionsList').html(data);
				}
				else if (nroInput == 2)
				{
					jQuery('#suggestions2').show();
					jQuery('#suggestions').hide();
					jQuery('#autoSuggestionsList2').html(data);
				}
			}
		});
	}
}

function fill(thisValue, nombreInput, nroInput) {
	jQuery(nombreInput).val(thisValue);
	
	//Cambio de color - fix para el bug del watermark
	jQuery(nombreInput).css("color","#212121");
	
	if (nroInput == 1)
	{ 
		setTimeout("jQuery('#suggestions').hide();", 200);
	}
	else if (nroInput == 2)
	{
		setTimeout("jQuery('#suggestions2').hide();", 200);
	}
}