//fonctions js
function lookup(inputString) {
	if(inputString.length == 0) {
		// Hide the suggestion box.
		$('#suggestions').hide();
	} 
	else {
		$.post("../includes/rpc/rpc_personnes.php", {queryString: ""+inputString+""}, function(data){
			if(data.length >0) {
				$('#suggestions').show();
				$('#autoSuggestionsList').html(data);
			}
		});
	}
} // lookup

function fill(thisValue) {
	$('#searchpersonne').val(thisValue);
	document.forms['searchformpersonne'].searchpersonne.value = thisValue;
	$('#suggestions').hide();
	document.forms['searchformpersonne'].submit();
}

//--------------------------------------------------------------

function lookup2(inputString) {
	if(inputString.length == 0) {
		// Hide the suggestion box.
		$('#suggestions2').hide();
	} 
	else {
		$.post("../includes/rpc/rpc_contacts.php", {queryString: ""+inputString+""}, function(data){
			if(data.length >0) {
				$('#suggestions2').show();
				$('#autoSuggestionsList2').html(data);
			}
		});
	}
} // lookup

function fill2(thisValue) {
	$('#searchcontact').val(thisValue);
	document.forms['searchformcontact'].searchcontact.value = thisValue;
	$('#suggestions2').hide();
	document.forms['searchformcontact'].submit();
}