function displayArtistInfos(shows, visual_value) {
	// On stop le slideshow
	active_slideshow = false;
	
	// On affiche les 2 prochain shows de l'artiste
	$('#promo-txt').get(0).innerHTML = shows;
	
	// On sépare le type de fichier et le fichier à afficher
	visual_value = visual_value.split('~');
	
	// Récupération des informations du onclick pour l'affichage
	showid = visual_value[0].split('*');
	showid = showid[1];
	video = visual_value[1].split('*');
	video = video[1];
	youtube = visual_value[2].split('*');
	youtube = youtube[1];
	image = visual_value[3].split('*');
	image = image[1];
	url = visual_value[4].split('*');
	url = url[1];
	
	if (showid != '0') {
		$('#btn_plus_details').get(0).style.visibility = 'visible';
		$('#btn_achetez-billets').get(0).style.visibility = 'visible';
		$('#btn_plus_details').get(0).onclick = function() { location.href = 'artistes.php?id=' + showid; }
	} else {
		$('#btn_plus_details').get(0).style.visibility = 'hidden';
		$('#btn_achetez-billets').get(0).style.visibility = 'hidden';
	}
	
	// On cache tous les calques des visuels des artistes
	for (novisual = 1; novisual <= 4; novisual++) {
		$('#visual' + novisual).get(0).style.visibility = 'hidden';
		$('#visual' + novisual).get(0).innerHTML = '';
	}
	
	$('#visual' + active_tab).get(0).style.visibility = 'visible';
	
	if (url != 'false') {
		$('#btn_achetez-billets').get(0).style.visibility = 'visible';
		$('#btn_achetez-billets').get(0).onclick = function() { window.open(url); }
	} else {
		$('#btn_achetez-billets').get(0).style.visibility = 'hidden';
	}
	
	// On vérifie si on affiche une image
	if (video != 'false') {
		$.ajax({
			url: "load_header_video.php",
			global: false,
			type: "POST",
			data: ({video: video}),
			success: function(msg){
				$('#visual' + active_tab).get(0).innerHTML = msg;
			}
		});
	} else if (youtube != 'false') {
		$.ajax({
			url: "load_header_youtube.php",
			global: false,
			type: "POST",
			data: ({youtube: youtube, showid: showid}),
			success: function(msg){
				temp = youtube.split(/v=/);
				temp = temp[temp.length - 1];
				temp = temp.split(/&/);
				temp = temp[0];
				
				// <div style="height: 190px; overflow: hidden; width: 285px; margin-left: -29px; margin-top: -2px;">
				// 	<div onclick="toggleVideo(\'vid4\');" style="height: 215px; width: 285px; margin-left: -29px; margin-top: -2px; z-index: 999; opacity: 0; position: absolute; cursor: pointer;">&nbsp;</div>
				// 	<div id="ytapivid4" style="position: absolute; z-index: 0;"> Vous devez avoir Flash 8 pour voir cette vidéo. </div>
				// 	<object width="285" height="215" type="application/x-shockwave-flash" id="vid4" data="http://www.youtube.com/v/' + temp + '?enablejsapi=1&amp;playerapiid=ytplayer&amp;rel=0&amp;border=0&amp;showinfo=0">
				// 		<param name="allowScriptAccess" value="always">
				// 		<param name="wmode" value="opaque">
				// 	</object>
				// </div>
				$('#visual' + active_tab).get(0).innerHTML = '<div style="height: 190px; overflow: hidden; width: 285px; margin-left: -29px; margin-top: -2px;"><div onclick="toggleVideo(\'vid4\'); stop_slideshow(' + active_tab + ');" style="height: 215px; width: 285px; margin-left: -29px; margin-top: -2px; z-index: 999; opacity: 0; position: absolute; cursor: pointer;">&nbsp;</div><div id="ytapivid4" style="position: absolute; z-index: 0;"> Vous devez avoir Flash 8 pour voir cette vidéo. </div><object width="285" height="215" type="application/x-shockwave-flash" id="vid4" data="http://www.youtube.com/v/' + temp + '?enablejsapi=1&amp;playerapiid=ytplayer&amp;rel=0&amp;border=0&amp;showinfo=0"><param name="allowScriptAccess" value="always"><param name="wmode" value="opaque"></object></div>';
				var params = { allowScriptAccess: "always",wmode:"opaque"};
				var atts = { id: "vid4" };
				swfobject.embedSWF("http://www.youtube.com/v/" + temp + "?enablejsapi=1&amp;playerapiid=ytplayer&amp;rel=0&amp;border=0&amp;showinfo=0", "ytapivid4", "285", "215", "8", null, null, params, atts);
			}
		});
	} else {
		$('#visual' + active_tab).get(0).innerHTML = '<img src="' + image + '" />';
	}
}


function loadDisplayArtistInfos(type) {
	// On récupère le contenu HTML du div scrollable affiché
	entire_div_value = test($('#scrollable' + type).get(0));
	//entire_div_value = $('#scrollable' + type).get(0).innerHTML;
	
	// Chrome : On décode les caractères encodés
	entire_div_value = entire_div_value.replace(/&lt;/g, '<');
	entire_div_value = entire_div_value.replace(/&gt;/g, '>');
	
	// On récupère la valeur du div contenant le premier artiste affiché
	first_div_value = entire_div_value.split(/<div id="first">/);
	first_div_value = first_div_value[1];
	
	// On récupère le contenu du onclick de l'image du premier artiste affiché
	onclick_value = first_div_value.match(/onclick="[a-zA-Z0-9,~'.\-\\|_<>!?&=;():* \/éÉàÀèÈêÊîÎçÇëËèâÂûÛ]+"/);
	onclick_value = onclick_value[0];
	onclick_value = onclick_value.substr(29);
	
	onclick_value = onclick_value.substr(0, onclick_value.length - 3);
	
	// On sépare les shows de l'image / vidéo
	onclick_value = onclick_value.split(/', '/)
	shows_value = onclick_value[0];
	visual_value = onclick_value[1];
	
	// On enlève les backslashes
	shows_value = shows_value.replace('\\', '');
	visual_value = visual_value.replace('\\', '');
	
	// On sépare le type de fichier et le fichier à afficher
	visual_value = visual_value.split('~');
	
	// Récupération des informations du onclick pour l'affichage
	showid = visual_value[0].split('*');
	showid = showid[1];
	video = visual_value[1].split('*');
	video = video[1];
	youtube = visual_value[2].split('*');
	youtube = youtube[1];
	image = visual_value[3].split('*');
	image = image[1];
	url = visual_value[4].split('*');
	url = url[1];
	
	if (showid != '0') {
		$('#btn_plus_details').get(0).style.visibility = 'visible';
		$('#btn_plus_details').get(0).onclick = function() { location.href = 'artistes.php?id=' + showid; }
	} else {
		$('#btn_plus_details').get(0).style.visibility = 'hidden';
		
	}
	
	if (url != 'false') {
		$('#btn_achetez-billets').get(0).style.visibility = 'visible';
		$('#btn_achetez-billets').get(0).onclick = function() { window.open(url); }
	} else {
		$('#btn_achetez-billets').get(0).style.visibility = 'hidden';
	}
	
	// On cache tous les calques des visuels des artistes
	for (novisual = 1; novisual <= 4; novisual++) {
		$('#visual' + novisual).get(0).style.visibility = 'hidden';
		$('#visual' + novisual).get(0).innerHTML = '';
	}
	
	$('#visual' + active_tab).get(0).style.visibility = 'visible';
	
	// On vérifie si on affiche une image
	if (video != 'false') {
		$.ajax({
			url: "load_header_video.php",
			global: false,
			type: "POST",
			data: ({video: video}),
			success: function(msg){
				$('#visual' + active_tab).get(0).innerHTML = msg;
			}
		});
	} else if (youtube != 'false') {
		$.ajax({
			url: "load_header_youtube.php",
			global: false,
			type: "POST",
			data: ({youtube: youtube, showid: showid}),
			success: function(msg){
				temp = youtube.split(/v=/);
				temp = temp[temp.length - 1];
				temp = temp.split(/&/);
				temp = temp[0];
				
				// <div style="height: 190px; overflow: hidden; width: 285px; margin-left: -29px; margin-top: -2px;">
				// 	<div onclick="toggleVideo(\'vid4\');" style="height: 215px; width: 285px; margin-left: -29px; margin-top: -2px; z-index: 999; opacity: 0; position: absolute; cursor: pointer;">&nbsp;</div>
				// 	<div id="ytapivid4" style="position: absolute; z-index: 0;"> Vous devez avoir Flash 8 pour voir cette vidéo. </div>
				// 	<object width="285" height="215" type="application/x-shockwave-flash" id="vid4" data="http://www.youtube.com/v/' + temp + '?enablejsapi=1&amp;playerapiid=ytplayer&amp;rel=0&amp;border=0&amp;showinfo=0">
				// 		<param name="allowScriptAccess" value="always">
				// 		<param name="wmode" value="opaque">
				// 	</object>
				// </div>
				$('#visual' + active_tab).get(0).innerHTML = '<div style="height: 190px; overflow: hidden; width: 285px; margin-left: -29px; margin-top: -2px;"><div onclick="toggleVideo(\'vid4\'); stop_slideshow(' + active_tab + ');" style="height: 215px; width: 285px; margin-left: -29px; margin-top: -2px; z-index: 999; opacity: 0; position: absolute; cursor: pointer;">&nbsp;</div><div id="ytapivid4" style="position: absolute; z-index: 0;"> Vous devez avoir Flash 8 pour voir cette vidéo. </div><object width="285" height="215" type="application/x-shockwave-flash" id="vid4" data="http://www.youtube.com/v/' + temp + '?enablejsapi=1&amp;playerapiid=ytplayer&amp;rel=0&amp;border=0&amp;showinfo=0"><param name="allowScriptAccess" value="always"><param name="wmode" value="opaque"></object></div>';
				var params = { allowScriptAccess: "always",wmode:"opaque"};
				var atts = { id: "vid4" };
				swfobject.embedSWF("http://www.youtube.com/v/" + temp + "?enablejsapi=1&amp;playerapiid=ytplayer&amp;rel=0&amp;border=0&amp;showinfo=0", "ytapivid4", "285", "215", "8", null, null, params, atts);
			}
		});
	} else {
		$('#visual' + active_tab).get(0).innerHTML = '<img src="' + image + '" />';
	}
	
	// Affichage de la photo/vidéo et des shows de l'artiste
	$('#promo-txt').get(0).innerHTML = shows_value;
}


function test(obj) {
	// http://stackoverflow.com/questions/1231770/innerhtml-removes-attribute-quotes-in-internet-explorer
	
	var zz = obj.innerHTML, 
     z =  
   zz.match(/<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/g); 
    //zz.match(/<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^\'\">\s]+))?)+\s*|\s*)\/?>/g);
  if (z){ 
    for (var i=0;i<z.length;i++){ 
      var y, zSaved = z[i]; 
      z[i] = z[i].replace(/(<?\w+)|(<\/?\w+)\s/, 
                          function(a){return a.toLowerCase();}); 
      y = z[i].match(/\=\w+[?\s+|?>]/g); 
       if (y){ 
        for (var j=0;j<y.length;j++){ 
          z[i] = z[i].replace(y[j],y[j] 
                     .replace(/\=(\w+)([?\s+|?>])/g,'="$1"$2')); 
        } 
       } 
       zz = zz.replace(zSaved,z[i]); 
     } 
   } 
  return zz; 
}
