
// Vérification du champ et lancement de la recherche
function test_recherche(texte)
{
	var rech = document.getElementById('dll_rech').value;
	var res = 1;
	
	if ( (rech == texte) || (rech == '') )
	{
		$('#dll_rech_erreur').html('Merci de saisir une recherche.');
		res = res * 0;
	}
	
	if (res == 1)
	{
		$.post("ajax/url_encode.php", { url:rech },
			function(data)
			{
				document.location.href = 'recherche.php?re='+data;
			}
		);
		
	}
}


// Vide le champ texte de recherche
function rech_efface_texte(texte)
{
	if (document.getElementById('dll_rech').value == texte)
		document.getElementById('dll_rech').value = '';
	
	document.getElementById('dll_rech_conteneur').className = 'moteur_rech_rounded_input';
	$('#dll_rech_erreur').html('');
}


// Affiche le message de remplissage du champ texte de recherche
function rech_affiche_texte(texte)
{
	if ( (document.getElementById('dll_rech').value == texte) || (document.getElementById('dll_rech').value == '') )
		document.getElementById('dll_rech_conteneur').className = 'moteur_rech_rounded_input_option';
	else
		document.getElementById('dll_rech_conteneur').className = 'moteur_rech_rounded_input';
	
	if (document.getElementById('dll_rech').value == '')
		document.getElementById('dll_rech').value = texte;
}


/*************** PAGINATION ***************/
$(document).ready(function() {
  $("#rech_page > ul").tabs(/*{ fx: { opacity:'toggle'} }*/);
});

function rech_go_page(num_page)
{
	$('#rech_plien'+num_page).click();
	// Enregistrement du numéro de page
	//$.get("ajax/me_pagination.php", { num_page:num_page });
}
