	var tabdiv = new Array();
	var divactive = '';
	document.onclick=checkdivactive;

	/* ---------------------------- */
	/* XMLHTTPRequest Enable 		*/
	/* ---------------------------- */
	function createObject() {
		var request_type;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
		request_type = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			request_type = new XMLHttpRequest();
		}
			return request_type;
	}

	var http = createObject();

	/* -------------------------- */
	/* SEARCH					 */
	/* -------------------------- */
	function autosuggest(urlsearch, urlaction, id, page) {
		var url = '';
		var query = '';
		var divresults = 'div' + id;

		if (page == '' || page == undefined) { page = 1; }

		document.getElementById(divresults).innerHTML = '<h5><img src="http://www.upconcert.com/img/loading.gif" width="16" height="16" border="0" style="vertical-align: middle;" /> Recherche en cours...</h5>';

		// Set the random number to add to URL request
		nocache = Math.random();
		if (urlsearch.indexOf('?') == '-1') {
			urlsearch = urlsearch + '?id=' + nocache;
 		}
		if (urlaction == '') {
			urlaction = 'javascript:fillinput(\'' + id + '\', \'#id#\', \'#value#\');';
		}
		query = document.getElementById('input' + id).value;
		while (query.indexOf('+') != '-1') {
			query = trim(String(query).substring(query.indexOf('+') + 1, query.length));
		}
		http.open('get', urlsearch + '&divid=' + id + '&q=' + escape(query) + '&page=' + page + '&nocache = ' + nocache + '&url=' + escape(urlaction));
		http.onreadystatechange = function() {
			if(http.readyState == 4){
				var response = http.responseText;
				e = document.getElementById(divresults);
				if(response!=""){
					e.innerHTML=response;
					e.style.display="block";
				} else {
					e.style.display="none";
				}
			}
		}
		http.send(null);
	}

	function fillinput(id, valueid, value){
		var text = document.getElementById('input' + id).value;
		var myArray;
		var fvalue = '';
		myArray = text.split("+")

		for (i = 0; i < myArray.length - 1; i++) {
			if (fvalue != '') {
				fvalue += ' + ';
			}
			fvalue += trim(myArray[i]);
		}

		if (fvalue != '') {
			fvalue += ' + ' + value;
		} else {
			fvalue = value;
		}
		document.getElementById('input' + id).value = fvalue;
		document.getElementById('id' + id).value = valueid;
		document.getElementById('div' + id).style.display = 'none';
		document.getElementById('input' + id).focus();
		return void(0);
	}

	function checkdivactive(){
		for (i = 0; i < tabdiv.length; i++) {
			if(divactive != tabdiv[i]){
				if (document.getElementById(tabdiv[i])) {
					document.getElementById(tabdiv[i]).style.display = 'none';
				}
			}
		}
		divactive = '';
	}
