// CacheBalise
function cb_visible(variable) {
	document.getElementById(variable).style.display = 'block';
}

function cb_invisible(variable) {
	document.getElementById(variable).style.display = 'none';
}

// Ajax
function writediv(div, texte)
{
	document.getElementById(div).innerHTML = texte;
}

function ajax_champs(champs, page, div)
{
	if(champs != '')
	{
		if( texte = file(page + champs) )
		{
			writediv(div, texte);
		}
	}	
}

function file(fichier)
{
	if(window.XMLHttpRequest) // FIREFOX
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else
		return(false);
	xhr_object.open("GET", fichier, false);
	xhr_object.send(null);
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}

	function lookup(inputString, nombre) {
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("autoComplete/rpc"+nombre+".php", {proprietaire: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}

function include(fileName){
document.write("<script type='text/javascript' src='"+fileName+"'></script>" );
}
