var $j = jQuery.noConflict();

function recopie_valeur()
{
		var nomville;
		$j('#societe_fact').val($j('#soc').val());
		$j('#numero2_fact').val($j('#numero').val());
		$j('#voie2_fact').val($j('#adresse').val());
		$j('#comp_adresse2_fact').val($j('#comp_adresse').val());
		$bb = $j('#inputString').val().split(" ")
		$j('#code_postal2').val($bb[0]);
		for (i=1; i<$bb.length; i++){ 
			if(i==1)nomville  = $bb[i];
			else nomville  += " "+$bb[i];
		}
		
		$j('#ville2').val(nomville);
	
}


function lookup(inputString,actionmethod,url) {
	if(inputString.length == 0) {
		// Hide the suggestion box.
		$j('#suggestions').hide();
	} else {
		$j.post(url, {queryString: ""+inputString+"",actionmethod: ""+actionmethod+""}, function(data){
			if(data.length >0) {
				$j('#suggestions').show();
				$j('#autoSuggestionsList').html(data);
			}
		});
	}
} // lookup

function fill(thisValue) {
	
	$j('#inputString').val(thisValue);
	setTimeout("$j('#suggestions').hide();", 200);
}

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

function fill2(thisValue) {
	$j('#pays').val(thisValue);
	setTimeout("$j('#suggestions2').hide();", 200);
}


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

function fill2(thisValue) {
	
	$j('#code_postal2').val(thisValue);
	setTimeout("$j('#suggestions2').hide();", 200);
}
*/
