function display(id) {
		$(id).className=$(id).className==""?"hidden":"";
	}
	
	function hide_with_Delay(id,delay,scroll) {
		if(!delay) delay=20;
		var scrolling=false;
		if(scroll) scrolling=true;
		t=setTimeout("hideThis('"+id+"',"+scrolling+")",delay);
	}
	
	/*
	function hide_bizcard_with_Delay() {
		t=setTimeout("hide_bizcard()",50);
	}
	
	function hide_bizcard() {
		$('bizcard').className="hidden";
		$('bizcard').innerHTML='';
	}	*/
	
	function hideThis(id) {
		var scrolling="hidden";

		if($(id) && !($(id).className.match(scrolling)))	$(id).className=$(id).className+" "+scrolling;
	}
	
	function ct(ind)
	{if(!ind){ind=t;}clearTimeout(ind);}
	
	
	
function dump(arr,level) {
var dumped_text = "";
if(!level) level = 0;

//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j<level+1;j++) level_padding += "    ";

if(typeof(arr) == 'object') { //Array/Hashes/Objects
 for(var item in arr) {
  var value = arr[item];
 
  if(typeof(value) == 'object') { //If it is an array,
   dumped_text += level_padding + "'" + item + "' ...\n";
   dumped_text += dump(value,level+1);
  } else {
   dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
  }
 }
} else { //Stings/Chars/Numbers etc.
 dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
}

return dumped_text;
}	
	
	
	
	
function displayThis(id,placement,parent) {
	if(typeof placement != "undefined" && typeof parent != "undefined" && placement==true)
	{	//On replace la div en fonction de l'element parent

		var posX = $(parent.parentNode.id).getPosition(parent.parentNode.parentNode.parentNode)['x'];
		var posY = $(parent.parentNode.id).getPosition()['y'];

		$(id).style.left = posX+"px";
		$(id).style.top  = posY+"px";
	}
	var displayClass = $(id).className;
	$(id).className=displayClass.replace("hidden","");
}	

function showThis(id,placement,parent) {
	if(typeof placement != "undefined" && typeof parent != "undefined" && placement==true)
	{	//On replace la div en fonction de l'element parent

		var posX = $(parent.parentNode.id).getPosition(parent.parentNode.parentNode.parentNode)['x'];
		var posY = $(parent.parentNode.id).getPosition()['y'];

		$(id).style.left = posX+"px";
		$(id).style.top  = posY+"px";
	}
	var displayClass = $(id).className;
	$(id).className=displayClass.replace("invisible","");
}

function displayPlus(id) {
	$(id).className=$(id).className=="jukebox_add_this"?"jukebox_add_this hidden":"jukebox_add_this";
}

function displayAccess(id) {
	$("bloc_register").className="hidden";
	$("bloc_login").className="hidden";
	if($("bloc_login_err"))	$("bloc_login_err").className="hidden";
	$(id).className=$(id).className==""?"hidden":"";
	
	if (id=="bloc_login")
		$("email_connexion").focus();
	else
		$("email_inscription").focus();
}

function displayMoveTo(item) {
	var oTop=item.offsetTop;
	var oLeft=item.offsetLeft;

	var top=oTop+20;
	var left=oLeft+0;
	$('playlist_moveto').style.top=top+"px";
	$('playlist_moveto').style.left=left+"px";
	display("playlist_moveto");
}

function displayMaskSplash()
{
	$("overlay_splash").className=''; var object = $("overlay_splash").style; object.opacity = (0.8); object.MozOpacity = (0.8); object.KhtmlOpacity = (0.8); object.filter = "alpha(opacity=" + 80 + ")";
	var h = $('body_container').clientHeight;
	var sc=document.documentElement.scrollTop;
	h+=160;
	
	$("overlay_splash").style.height=h+"px";
}

function displayMask(id, typeContenu, idContenu)
{
	$("overlay").className=''; var object = $("overlay").style; object.opacity = (0.8); object.MozOpacity = (0.8); object.KhtmlOpacity = (0.8); object.filter = "alpha(opacity=" + 80 + ")";
	var h = $('body_container').clientHeight;
	var sc=document.documentElement.scrollTop;
	h+=160;
	
	$("overlay").style.height=h+"px";
	if(id==1)
	{
		$('flag_reponse').className="hidden";
		$("flag_container").style.top=sc+'px';
		$("flag_container").className='';			
		$("type_contenu").value=typeContenu;			
		$("id_contenu").value=idContenu;			
	}
	else if(id==2)
	{
		
		if ($('share_social_title')) {
			// Grande Box - Affichage des options de reseaux sociaux
			$('share_container').style.height="460px"; 
			$('share_container').style.background="url('../_images/design/share_background.png') no-repeat top left"; 
		}
		else {
			// Petite box - Uniquement partage par messagerie privée
			$('share_container').style.height="300px"; 
			$('share_container').style.background="url('../_images/design/share_background_small.png') no-repeat top left";
		}	
	
		$("share_container").style.top=sc+'px';
		$("share_container").className='';
		$("share_container").focus();			
	}
}







function displayProfil(idProfil)
{
	$("subcontent").innerHTML="";
	displayThis('subcontent_container');
	hideThis('leftpart');
	
	var xhr = createXHR();

	var script = '/voir-profil.html';
	
	xhr.open("POST", script, true);		
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	xhr.send("navigation=voir&profil="+ idProfil);
	
	ajaxLoading("subcontent");
	
	xhr.onreadystatechange = function() {
	// On ne fait quelque chose que si on a tout recu et que le serveur est ok
	if(xhr.readyState == 4 && xhr.status == 200){
			var contenuATraiter=xhr.responseText;
			setInnerHTML(window.$("subcontent"), contenuATraiter);
		}
	}
}

function displaySlideshow(idStart,uid)
{
	$("subcontent").innerHTML="";
	displayThis('subcontent_container');
	hideThis('leftpart');
	
	var xhr = createXHR();

	var script = '/voir-slideshow.html';
	
	xhr.open("POST", script, true);		
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	xhr.send("navigation=voir&start="+ idStart +"&uid="+uid);
	
	ajaxLoading("subcontent");
	
	xhr.onreadystatechange = function() {
	// On ne fait quelque chose que si on a tout recu et que le serveur est ok
	if(xhr.readyState == 4 && xhr.status == 200){
			var contenuATraiter=xhr.responseText;
			setInnerHTML(window.$("subcontent"), contenuATraiter);
		}
	}
}

function displayExplore( optTrackID )
{
	$("subcontent").innerHTML="";
	displayThis('subcontent_container');
	hideThis('leftpart');
	
	var xhr = createXHR();

	var script = '/explore.html';
	
	xhr.open("POST", script, true);		
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	if ( optTrackID==undefined ) {
		xhr.send("navigation=voir&track="+ jwGetDescription());
	} else {
		xhr.send("navigation=voir&track="+ optTrackID);
	} 
	ajaxLoading("subcontent");
	
	xhr.onreadystatechange = function() {
	// On ne fait quelque chose que si on a tout recu et que le serveur est ok
	if(xhr.readyState == 4 && xhr.status == 200){
			var contenuATraiter=xhr.responseText;
			setInnerHTML(window.$("subcontent"), contenuATraiter);
		}
	}
}

function displayProjet(idProjet, poste)
{
	$("subcontent").innerHTML="";
	displayThis('subcontent_container');
	hideThis('leftpart');
	
	var xhr = createXHR();
	
	if (poste == 'videaste') {
		var script = '/suivre-projet-videaste.html';
	}
	else if(poste == 'visuPro') {
		var script = '/voir-projet-pro.html';
	}
	else if(poste == 'visu') {
		var script = '/voir-projet-gratuit.html';
	}
	else {
		var script = '/suivre-projet.html';
	}
	
	xhr.open("POST", script, true);		
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	xhr.send("navigation=voir&idProjet="+ idProjet);
	
	ajaxLoading("subcontent");
	
	xhr.onreadystatechange = function() {
	// On ne fait quelque chose que si on a tout recu et que le serveur est ok
	if(xhr.readyState == 4 && xhr.status == 200){
			var contenuATraiter=xhr.responseText;
			setInnerHTML(window.$("subcontent"), contenuATraiter);
		}
	}
}

function closeSubcontent()
{
	hideThis('subcontent_container');
	displayThis('leftpart');

}

function hideMask()
{
	$("flag_container").className='hidden';
	$("share_container").className='hidden';
	$("popup_container").className='hidden';
	$("overlay").className='hidden';
}

function clearPlayerMessage()
{
	$('player_message').innerHTML="";
}

function setMenuActive(id)
{
	var a=$("bloc_menu_container").getElementsByTagName("a");
	$("a_menu_account").removeAttribute("style");
	for (var i=0;i<a.length;i++)	{a[i].className="menu_inactive";}
	$(id).className="menu_active";
	if(id!="a_menu_account")	{hideThis("bloc_submenu");}
	else						{displayThis("bloc_submenu");}
	
}

function setSubmenuActive(id)
{	
	setMenuActive("a_menu_account");
	$("a_menu_account").removeAttribute("style");
	var a=$("bloc_submenu").getElementsByTagName("a");
	for (var i=0;i<a.length;i++)	{a[i].className="menu_inactive";}
	$(id).className="menu_active";
	$("account_list").className="hidden";
	setColor('a_menu_account','#00899B');
	ct(c);
	
}

function setSubmenuActivePlaylist(id)
{	
	setColor('sub_new_playlist','#00899B');
	setColor('sub_mod_playlist','#00899B');
	setColor(id,'#FFF');
}

function setColorDelay(id,color,delay)
{
	if(!delay) delay=20;
	if($("account_list").className!="hidden" && $("bloc_submenu").className.match("hidden")){c=setTimeout("setColor('"+id+"','"+color+"')",delay);}
}

function setColor(id,color)
{
	$(id).style.color=color;
}	

function displayBizcard(item,track_id)
{
	ct(t);
	//alert("current_bizcard : "+current_bizcard+"\ntrack_id : "+track_id+"\n$('bizcard').className : "+$('bizcard').className);
	
	var oTop=item.offsetTop;
	var oLeft=item.offsetLeft;
	
	var top=oTop+160;
	var left=oLeft+50;
	$('bizcard').style.top=top+"px";
	$('bizcard').style.left=left+"px";
	
	if((current_bizcard!=track_id))
	{
		current_bizcard=track_id;
		
		$('bizcard').innerHTML=="";
		
		loadBizcard(track_id,"bizcard",false);
		
		
		
		
		$('bizcard').className="";
	}
	else if($('bizcard').className=="hidden")
	{
		$('bizcard').className="";
	}
}


function displayRefPlayLists(item,track_id)
{
	ct(t);
	//alert("current_bizcard : "+current_bizcard+"\ntrack_id : "+track_id+"\n$('bizcard').className : "+$('bizcard').className);
	var oTop=item.offsetTop;
	var oLeft=item.offsetLeft;
	
	var top=oTop+10;
	var left=oLeft+16;
	$('refPlayLists').style.top=top+"px";
	$('refPlayLists').style.left=left+"px";
	
	$('refPlayLists').innerHTML=="";
	loadRefPlaylists(track_id,"refPlayLists",false);
	$('refPlayLists').className="";
}



function displayPopup()
{
	var object = $("overlay").style; object.opacity = (0.8); object.MozOpacity = (0.8); object.KhtmlOpacity = (0.8); object.filter = "alpha(opacity=" + 80 + ")";
	var h = $('body_container').clientHeight;
	var sc=document.documentElement.scrollTop;
	h+=160;
	
	$("overlay").style.height=h+"px";
	$("overlay").className=''; 
	$("popup_container").style.top=sc+'px';
	$("popup_container").className='';		
}

setInnerHTML = function(divContent, HTML) {
	divContent.innerHTML=HTML; 
	var All=divContent.getElementsByTagName("*");
	for (var i=0; i<All.length; i++) {
		All[i].id=All[i].getAttribute("id")
		All[i].name=All[i].getAttribute("name")
		var elementClass = All[i].getAttribute("class");

		if (elementClass == null) {
			elementClass = All[i].getAttribute("className");
		}
		All[i].className=elementClass;
	}
	//alert(dump(AllScripts[0]));
	
	var AllScripts=divContent.getElementsByTagName("script")
	//alert(dump(AllScripts[0]));
	for (var i=0; i<AllScripts.length; i++) {
		var s=AllScripts[i];
		var g=this;
		//var tmpFunc=""; //Fonction temporaire qui permettra déviter d'avoir recours aux eval
		if (s.src && s.src!="") {
			
			if(g.eval(getFileContent(s.src))) {
				g.eval(getFileContent(s.src));
			}
			else {
				eval(getFileContent(s.src))
			}
			//tmpFunc = new Function(){s.src};
			//tmpFunc(); 
			//eval(getFileContent(s.src));
			
		}
		else { 
			//eval(s.innerHTML);
			if(g.eval(s.innerHTML)) {
				g.eval("s.innerHTML");
			}
			else { 
				eval("s.innerHTML");
			}
			//tmpFunc = new Function(){s.innerHTML};
			//tmpFunc(); 
			//eval(s.innerHTML);
		}
	}
}

function init_dw_Scroll() {
	var wndo = new dw_scrollObj('wn', 'lyr1');
	wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
	wndo.setUpScrollControls('scrollbar');
}	

function init_dw_Scroll_styles() {
	var sb = new dw_scrollObj("style_list_container", "style_list_content");
	sb.setUpScrollbar("style_dragBar", "style_track", "v", 1, 1);
	sb.setUpScrollControls("style_scrollbar");
}	