	var idselect = '';
	var acmotcle = '';
	var aclist = new Array();

	function AutoCompletionArtiste(e, object, action) {
		var evt = window.event? event : e;
		
		if (document.getElementById('i' + object).value == '') {
			document.getElementById('d' + object).innerHTML = '';
			document.getElementById('d' + object).style.display = 'none';
		} else {
			document.getElementById('d' + object).style.display = 'block';
		}

		// Touche entrée
		if (evt.keyCode == 13 && idselect != '') {
			eval(action);
		// Flèche bas
		} else if (evt.keyCode == 40 && idselect != '') {
			ACChooseArtiste(parseInt(idselect) + 1);
		// Flèche haut
		} else if (evt.keyCode == 38 && idselect != '') {
			ACChooseArtiste(parseInt(idselect) - 1);
		} else if (document.getElementById('i' + object).value != acmotcle && document.getElementById('i' + object).value != '') {
			acmotcle = document.getElementById('i' + object).value;
			document.getElementById('d' + object).innerHTML = '<img src="http://www.upconcert.com/img/loading.gif" width="16" height="16" border="0" style="vertical-align: middle;" /><h5> Chargement...</h5>';
			new Ajax.Request('/recherche/ajax/ac_artiste.ajax.html',{method:'post',onSuccess:function(xhr){document.getElementById('d' + object).innerHTML = xhr.responseText;AddScript(document.getElementById('d' + object));ACChooseArtiste();},onFailure:function(){document.getElementById('d' + object).style.display = 'none';}, parameters:'motcle=' + encodeURIComponent(document.getElementById('i' + object).value) + '&js=' + encodeURIComponent(action)})
		}
	}

	function ACChooseArtiste(id) {
		if (id == '' || id == undefined) { id = '0'; }
		if (document.getElementById('ac' + id)) { 
			if (document.getElementById('ac' + idselect)) { document.getElementById('ac' + idselect).className = ''; }
			idselect = id;
			document.getElementById('ac' + id).className = 'on';
		}
	}

	function ACDeleteArtiste(id, object) {
		var text = '';
		var aclisttmp = new Array();
		if (aclist.length > 0) {
			for (i = 0; i < aclist.length; i++) {
				tab = aclist[i].split('|@|');
				if (id != tab[0]) {
					aclisttmp.push(aclist[i]);;
				}
			}
			aclist = aclisttmp;
		}
		ACShowSelect(object);
	}

	function ACSelectArtiste(object, value) {
		if (document.getElementById('iac' + idselect)) {
			if (!in_array(document.getElementById('iac' + idselect).value, aclist)) { 
				aclist.push(document.getElementById('iac' + idselect).value);
			}
		} else if (value != '') {
			if (!in_array(value, aclist)) { 
				aclist.push(value);
			}
		}

		document.getElementById('d' + object).innerHTML = '';
		document.getElementById('d' + object).style.display = 'none';
		acmotcle = '';
		document.getElementById('i' + object).value = '';

		ACShowSelect(object)
	}

	function ACShowSelect(object) {
		var text = '';
		var listref = '';
		if (aclist.length > 0) {
			for (i = 0; i < aclist.length; i++) {
				tab = aclist[i].split('|@|');
				text += '<table border="0" cellpadding="0" cellspacing="0" style="margin-right: 5px; margin-bottom: 3px; float: left;"><tr><td valign="top"><img src="http://www.upconcert.com/img/ac/ac_left_off.gif" width="13" height="14" border="0" style="cursor: hand; cursor: pointer;" onMouseOver="this.src=\'http://www.upconcert.com/img/ac/ac_left_on.gif\'" onMouseOut="this.src=\'http://www.upconcert.com/img/ac/ac_left_off.gif\'" onClick="ACDeleteArtiste(' + tab[0] + ', \'' + object + '\')" /></td><td style="background: url(http://www.upconcert.com/img/ac/ac_bg.gif) repeat-x top; padding: 0px 2px;" nowrap="nowrap"><h5 style="color: #FFF;">' + tab[1] + '</h5></td><td valign="top"><img src="http://www.upconcert.com/img/ac/ac_right.gif" width="1" height="14" border="0" /></td></tr></table>';
				if (listref != '') { listref += ','; }
				listref += tab[0];
			}
		}
		document.getElementById('r' + object).innerHTML = text;
		document.getElementById('r' + object).style.display = 'block';
		document.getElementById(object).value = listref;
	}