var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

if ( BrowserDetect.browser == "Explorer" && BrowserDetect.browser <= 6 ) {
document.location.href="toobad.html";
}



/********** STARS ***************/
function change_note(id, wich){

for(i=1;i<=5;i++){                                                                         
//et là toutes les etoiles comprise entre 1 et celle cliquée sont changé apres pas compliqué de transformer un peu pour que les "etoilex_active.jpg" soient cliquables aussi pour pvoir rechanger avant  envoi
        SetOpacity(wich+i, 0, 0.3);
    }
    
if (id == 0) {


document.getElementById(wich).value =0;




} else {




    for(i=1;i<=5;i++){                            // ici je recupere la valeur de la note en fonction de l'image qui a été cliquée
        if(id==wich+i) var valeur = i;
    }
    document.getElementById(wich).value = valeur;  // ici la note est mise dans le champs caché du formulaire
    for(i=1;i<=valeur;i++){                                                                         
//et là toutes les etoiles comprise entre 1 et celle cliquée sont changé apres pas compliqué de transformer un peu pour que les "etoilex_active.jpg" soient cliquables aussi pour pvoir rechanger avant  envoi
        SetOpacity(wich+i, 0, 1);
    }
    
}
}




function SetOpacity(Star, key, opacity)
{
	StarNb=Name2Nb(Star, key);
	for (var i = 1; i <= StarNb; i++)
	{
		document.getElementById(StarBaseId[key]+i).style.opacity = opacity;
	}
}

function Name2Nb(Star, key) {
	//Le survol d'une Ã©toile ne nous permet pas de connaÃ®tre directement son numÃ©ro
	//Cette fonction extrait donc ce numÃ©ro Ã  partir de l'Id
	StarNb=Star.slice(LgtStarBaseId[key]);
	return(StarNb);
}


/********** /STARS ***************/

/********** PLAYER FLASH *************/


/********** Constantes **************/
last_ref = 0;
last_ligne = '';
last_kind = '';
last_sort = '';
last_version = null;
linetochange = '';
/****

ref = morceau à jouer

ligne = id (id la version primaire) de la ligne qui contient le morceau. ex : main_000015

sort = main || side

kind = selection || backoffice || recherche || album_classic || album_ethnic || album_library || production || production_home || homepage

version = true || false

***/



function suppression_element(wich) {
var noeud=document.getElementById(wich).firstChild;
disparu = document.getElementById(wich).removeChild(noeud);
}


function sendEvent(thePlayer, typ, prm) { thisMovie(thePlayer).sendEvent(typ,prm); };


function play(pref, pligne, psort, pkind, pversion, plight, action, libelle) {

	//alert ('' + collection + ' > ' + album + ' > ' + track + '');

	pageTracker._trackEvent('Ecoutes', 'Stream ' + action + '', '' + libelle + '');
	
// Afficher le player du div holder
	document.getElementById("track_"+psort+pref).style.display='';
	
// Construction du player et écriture dans le div holder

if ( psort == "main" ) {

	if ( pkind == "production_home" || pkind == "homepage"){
	
	var so = new SWFObject('mediaplayer.swf','mpl','200','18','7');
	
	} else {
	
	var so = new SWFObject('mediaplayer.swf','mpl','250','18','7');
	
	}



} else {

var so = new SWFObject('mediaplayer.swf','mpl','200','18','7');
}

switch (pkind) {
	case 'selection':
	backcolor = '0x4d4d4d';
	frontcolor = '0xffffff';
	lightcolor = '0xffffff';
	break;
	case 'recherche':
	backcolor = '0xfaf5ed';
	frontcolor = '0x33241a';
	lightcolor = '0xe59f35';
	linecolor = '#faf5ed';
	break;
	case 'album_library':
	backcolor = '0xedfaf9';
	frontcolor = '0x1a3332';
	lightcolor = '0xe59f35';
	linecolor = '#edfaf9';
	break;
	case 'album_classic':
	backcolor = '0xedf2fa';
	frontcolor = '0x1a2433';
	lightcolor = '0xe59f35';
	linecolor = '#edf2fa';
	break;
	case 'album_ethnic':
	backcolor = '0xfaedf0';
	frontcolor = '0x331a1f';
	lightcolor = '0xe59f35';
	linecolor = '#faedf0';
	break;
	case 'production':
	backcolor = '0xedfaee';
	frontcolor = '0x32331a';
	lightcolor = '0xe59f35';
	linecolor = '#edfaee';
	break;
	case 'production_home':
	backcolor = '0x434d25';
	frontcolor = '0xffffff';
	lightcolor = '0xffffff';
	linecolor = '#434d25';
	break;
	case 'homepage':
	backcolor = '0x4d3e27';
	linecolor = '#4d3e27';
	frontcolor = '0xffffff';
	lightcolor = '0xffffff';
	
	if (linetochange == 'fonce') {
	backcolor = '0x4d3e27';
	linecolor = '#4d3e27';
	} else {
	backcolor = '0x735c39';
	linecolor = '#735c39';
	}
	break;
	case 'backoffice':
	backcolor = '0xedf8fa';
	frontcolor = '0x333333';
	lightcolor = '0xe59f35';
	linecolor = '#edf8fa';
	break;
}
		
		so.addParam('allowfullscreen','false');
		so.addVariable("enablejs","true");
		so.addVariable("javascriptid",'mpl');
		so.addVariable('file', 'http://www.justement-music.com/music/mp3_128/' + pref + '.mp3');
		so.addVariable('autostart','true');
		so.addVariable('usefullscreen','false');
		so.addVariable('type','mp3');
		so.addVariable('backcolor', backcolor);
		so.addVariable('frontcolor', frontcolor);
		so.addVariable('lightcolor', lightcolor);
		so.addVariable('showvolume','false');
		so.addParam('wmode','transparent');
		so.write("track_"+psort+pref);
		
// Reinitialiser la couleur de la ligne en fonction du plight
	if ( plight == true ) {
	
		if ( (psort == "main" || psort == "version") && pkind != "homepage") {
		
		document.getElementById(pligne).style.backgroundColor = linecolor;
		
		}
		
	}

// Mettre le picto stop en fonction de si c'est une version et du kind
	
	if ( pversion == null ) {
		
		
		document.getElementById("play_"+psort+pref).src='_img/fiche_morceau/stop_' + pkind + '.png';
		
	
	} else {
		
		document.getElementById("play_"+psort+pref).src='_img/fiche_morceau/stop_version_' +pkind + '.png';
			
	}
	
}


function stop(sref, sligne, ssort, skind, sversion, slight) {

	// Effacer le player du div holder
	document.getElementById('mpl').sendEvent('stop');
	suppression_element("track_"+ssort+sref);
	document.getElementById("track_"+ssort+sref).style.display='none';
	

	// Reinitialiser la couleur de la ligne en fonction du slight
	if ( slight == true ) {
		
		if ( (ssort == "main" || ssort== "version") && skind != "production_home" && skind != "homepage" ) {
		
			document.getElementById(sligne).style.backgroundColor='#FFFFFF';
			
		}
		
	}

	// Mettre le picto play en fonction de si c'est une version et du kind
	
	if( sversion == null ) {
		
		document.getElementById("play_"+ssort+sref).src='_img/fiche_morceau/play_' + skind + '.png';
	
	} else {
		
		document.getElementById("play_"+ssort+sref).src='_img/fiche_morceau/play_version_' + skind + '.png';
			
	}

}


function loadPlayer(ref, ligne, sort, kind, version, action, libelle) {

	if ( last_ligne == ligne && last_ref == ref ) {
	
		//window.alert('last_ligne == ligne && last_ref == ref' + ' ' + version);
	
		stop(ref, ligne, sort, kind, version, true);
		
		// Reinitialisation
		last_ref = 0;
		last_ligne = '';
		last_kind = '';
		last_sort = '';
		last_version = null;
		
	
	} else if ( last_ligne == ligne && last_ref != ref ) {
	
		//window.alert('last_ligne == ligne && last_ref != ref' + ' ' + version);
	
		stop (last_ref, last_ligne, last_sort, last_kind, last_version, false);
		play(ref, ligne, sort, kind, version, false, action, libelle);

		
		last_ref = ref;
		last_ligne = ligne;
		last_kind = kind;
		last_sort = sort;
		last_version = version;

		
	} else if ( last_ref == 0 ) {
		
		//toto = $('#container'+i > ul).activeTab();
		
		//window.alert('last_ref == 0');
	
		play(ref, ligne, sort, kind, version, true, action, libelle);
		
		last_ref = ref;
		last_ligne = ligne;
		last_kind = kind;
		last_sort = sort;
		last_version = version;
		
		
	} else {
	
		//window.alert('Autres' + ' ' + version);
		
		stop (last_ref, last_ligne, last_sort, last_kind, last_version, true);
		play(ref, ligne, sort, kind, version, true, action, libelle);

		last_ref = ref;
		last_ligne = ligne;
		last_kind = kind;
		last_sort = sort;
		last_version = version;
		
	}

}


/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}

function pngFix(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function windowOpener(popurl,name,option){ //v3.0
  var winpops=window.open(popurl,name,option);
}

//__________________________________ Construction Menus-Search _____________________________



var menu=new CreerMenu(2,"Sélectionnez une catégorie","ET une sous-catégorie","titre 3","titre 4","self");
// CreerMenu(Nb de listes, titre1, titre2, titre3, target)
// Nb listes=4 maxi
// Les 4 titres sont obligatoires (meme si Nb_liste<4)
// target=nom de la frame ou "self" si c'est la fenetre elle meme, "_blank" pour une nouvelle
// Pour ajouter les liens dans les listes, utiliser menu.Add
// Menu.Add(numéro de la liste, texte, page à charger)
function CreerMenu(profondeur,titre1,titre2,titre3,titre4,target) {
	this.nb=0;this.prof=profondeur;
	this.titre1=titre1; this.titre2=titre2; this.titre3=titre3; this.titre4=titre4; this.target=target;
	this.Add=AddObjet;
	this.Aff=AffMenu;
	
}
function AddObjet(deep,txt,page) {
	var rub = new Object;
	rub.deep=deep;
	rub.txt=txt;
	rub.page=page;
	this[this.nb]=rub;
	this.nb++;
}
function AffMenu() {
	var Z='<form name="mf" id="mf"><tr><td>';
	Z+='<select name="list1" class="select_search1" onChange="Clic(1)"><option selected="selected">'+this.titre1+'</option>';
	for (var i=0;i<this.nb;i++) {
		if (this[i].deep==1) {
			Z+='<option value="'+i+'">'+this[i].txt+'</option>'
		}
	}
	Z+='</select>';
	Z+='</td></tr><tr><td height="10"><img src="_img/pix.gif" alt="" height="10"></td></tr><tr><td>';
	for (var i=2;i<=menu.prof;i++) {
		Z+='<select class="select_search2" name="list'+i+'" onChange="Clic('+i+');"><option>'+eval('menu.titre'+i)+'</option></select>';
	}
	Z+='</td></tr><tr><td height="10"><img src="_img/pix.gif" alt="" height="10"></td></tr>';
	Z+='</form>';
	//
	document.write(Z);
}
function add() {
	var c=new Option("ADD","",true,true);
	document.forms[0].elements["list"].options[0]=c;
}
function Clic(no) {
	
	var valeur=document.forms["mf"].elements["list"+no].options[ document.forms["mf"].elements["list"+no].selectedIndex].value;
	
	if ((valeur!="")&&(valeur!=null)&&(no<menu.prof)) {
		var deep=menu[valeur].deep;
		var no2=1;
		for (var noX=(no+1);noX<=menu.prof;noX++) {
			document.forms["mf"].elements["list"+eval(noX)].options.length=0;
			var titre=eval("menu.titre"+noX);
			var c=new Option(titre);
			document.forms["mf"].elements["list"+(noX)].options[0]=c;
			document.forms["mf"].elements["list"+(noX)].selectedIndex=0;
		}
		valeur++;
		for (var i=valeur;i<menu.nb;i++) {
			//alert(i);
			if (menu[i].deep==deep+1) { 
				//alert("no="+no+" texte="+menu[i].txt);
				var c=new Option(menu[i].txt,i);
				document.forms["mf"].elements["list"+(no+1)].options[no2]=c;
				no2++;
			} else { if (menu[i].deep==deep){i=menu.nb;}}
		}
		document.forms["mf"].elements["list"+(no+1)].options.length=no2+1;
		document.forms["mf"].elements["list"+(no+1)].selectedIndex=0;
		Clic(no+1)
		valeur--;
	}
	if ((valeur!="")&&(valeur!=null)) {
		//document.write(page);
		var page=menu[valeur].page;
		//alert (page);
		
		if ((page!="")&&(page!=null)) {
		
			var select1 = document.forms["mf"].elements["list1"].options[ document.forms["mf"].elements["list1"].selectedIndex].text;
			var select2 = document.forms["mf"].elements["list"+no].options[ document.forms["mf"].elements["list"+no].selectedIndex].text;
			//pageTracker._trackEvent('Just Play', ''+select1+'', ''+ select2 +''); A REMETTRE POUR ONLINE
			
			if (menu.target=="self") {window.location=page;}
			else if (menu.target=="_blank") {window.open(page,"","menubar,scrollbars,toolbar,status,location")}
			else {parent.frames[menu.target].location.href=page;}
		}
	}
}
// Fonctions destinées à afficher l'arborescence du menu
function space(i) {var Z="";for (var j=0;j<i;j++){Z+="&nbsp;&nbsp;&nbsp;&nbsp;";}return Z}
function Arbo(m) {
	var Z="<BR>";
	for (var i=0;i<m.nb;i++) {
		Z+=space(m[i].deep)+m[i].txt+"&nbsp;&nbsp; <A href='"+m[i].page+"'>"+m[i].page+"</A><BR>"
	}
	document.write(Z);	
}






	function DivStatus( nom, numero, htmlpath, nuance )
		{
			var divID = nom + numero;
			if ( document.getElementById && document.getElementById( divID ) ) // Pour les navigateurs récents
				{
					Pdiv = document.getElementById( divID );
					PcH = true;
		 		}
			else if ( document.all && document.all[ divID ] ) // Pour les veilles versions
				{
					Pdiv = document.all[ divID ];
					PcH = true;
				}
			else if ( document.layers && document.layers[ divID ] ) // Pour les très veilles versions
				{
					Pdiv = document.layers[ divID ];
					PcH = true;
				}
			else
				{
					
					PcH = false;
				}
			if ( PcH )
				{
					Pdiv.className = ( Pdiv.className == 'cachediv' ) ? '' : 'cachediv';
					if ( Pdiv.className == 'cachediv') {
						if ( nuance == 'claire'){
						document['version' + numero].src= htmlpath + '_img/picto/marron_clair/fleche_version.gif';
						} else {
						document['version' + numero].src= htmlpath + '_img/picto/marron_fonce/fleche_version.gif';
						}
					}else {
						if ( nuance == 'claire'){
						document['version' + numero].src= htmlpath + '_img/picto/marron_clair/fleche_version_down.gif';
						} else {
						document['version' + numero].src= htmlpath + '_img/picto/marron_fonce/fleche_version_down.gif';
						}
					}
				}
		}
		
		
		
		
function SwitchTRColorBO (who, j, htmlpath, state) {
	if ( state == 'over'){
		who.style.background ='#d5d5d5';
	} else {
		who.style.background ='#FFFFFF';
	}
	var x = document.images;
	for (var i=0;i<x.length;i++){
	var tofind = new RegExp('on' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							
									x[i].src = htmlpath + '_img/picto/admin/on.gif';
									
						} else if ( state == 'out'){
							
									
									x[i].src = htmlpath + '_img/picto/admin/on_bl.gif';
									
						}
					}
					
					var tofind = new RegExp('off' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
									x[i].src = htmlpath + '_img/picto/admin/off.gif';
									
						} else if ( state == 'out'){
									x[i].src = htmlpath + '_img/picto/admin/off_bl.gif';
								}
					}
	
	}
}



function SwitchGifs ( who, j, htmlpath, state, nuance, page_family ) {
	
		if ( state == 'over'){
			if ( nuance == 'fonce'){
				switch (page_family){
					case "library":
					who.style.background ='#92a3a6';
					break;
					case "ethnic":
					who.style.background ='#a69292';
					break;
					case "classic":
					who.style.background ='#9296a6';
					break;
					case "production":
					who.style.background ='#a1a692';
					break;
					case "backoffice":
					who.style.background ='#a6a6a6';
					break;
					default:
					who.style.background ='#a69e93';
				
				}
			} else {
				switch (page_family){
					case "library":
					who.style.background ='#c3d2d5';
					break;
					case "ethnic":
					who.style.background ='#d5c3c4';
					break;
					case "classic":
					who.style.background ='#c3c7d5';
					break;
					case "production":
					who.style.background ='#d0d5c3';
					break;
					case "backoffice":
					who.style.background ='#d5d5d5';
					break;
					default:
					who.style.background ='#d5cec3';
				
				}
			}
		} else if ( state == 'out') {
			who.style.background = '#FFFFFF';
		}
		//document['play' + j].src = htmlpath + '_img/picto/marron_fonce/play.gif';
		var x = document.images;
		
		
		
		for (var i=0;i<x.length;i++){
					var tofind = new RegExp('play' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							//if (nuance == 'claire'){
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/play.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/play.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/play.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/play.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/play.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/play.gif';
				
								}
								
								/*} else {
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/play.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/play.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/play.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/play.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/play.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/play.gif';
				
								}
								}*/	
						} else if ( state == 'out'){
							//if ( nuance == 'claire'){
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/play_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/play_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/play_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/play_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/play_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/play_bl.gif';
				
								}
								/*} else {
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/play_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/play_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/play_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/play_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/play_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/play_bl.gif';
				
								}
								}*/
							}
						}
					
					var tofind = new RegExp('mp3' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							//if (nuance == 'claire'){
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/mp3.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/mp3.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/mp3.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/mp3.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/mp3.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/mp3.gif';
				
								}
								/*} else {
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/mp3.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/mp3.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/mp3.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/mp3.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/mp3.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/mp3.gif';
				
								}
								}	*/
							} else if ( state == 'out'){
							//if ( nuance == 'claire'){
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/mp3_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/mp3_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/mp3_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/mp3_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/mp3_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/mp3_bl.gif';
				
								}
								/*} else {
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/mp3_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/mp3_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/mp3_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/mp3_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/mp3_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/mp3_bl.gif';
				
								}
								}*/
							}
						}
					
					var tofind = new RegExp('wav' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							//if (nuance == 'claire'){
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/wav.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/wav.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/wav.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/wav.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/wav.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/wav.gif';
				
								}
								/*} else {
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/wav.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/wav.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/wav.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/wav.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/wav.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/wav.gif';
				
								}
								}*/
							} else if ( state == 'out'){
							//if ( nuance == 'claire'){
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/wav_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/wav_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/wav_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/wav_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/wav_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/wav_bl.gif';
				
								}
								/*} else {
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/wav_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/wav_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/wav_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/wav_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/wav_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/wav_bl.gif';
				
								}
								}*/
							}
						}
					
					var tofind = new RegExp('plus' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							//if (nuance == 'claire'){
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/plus.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/plus.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/plus.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/plus.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/plus.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/plus.gif';
				
								}
								/*} else {
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/plus.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/plus.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/plus.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/plus.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/plus.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/plus.gif';
				
								}
								}	*/
							} else if ( state == 'out'){
							//if ( nuance == 'claire'){
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/plus_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/plus_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/plus_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/plus_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/plus_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/plus_bl.gif';
				
								}
								/*} else {
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/plus_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/plus_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/plus_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/plus_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/plus_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/plus_bl.gif';
				
								}
								}*/
							}
						}
						
						/*var tofind = new RegExp('rapport' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							if (nuance == 'claire'){
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/rapport.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/rapport.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/rapport.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/rapport.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/rapport.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/rapport.gif';
				
								}
								} else {
								switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/rapport.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/rapport.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/rapport.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/rapport.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/rapport.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/rapport.gif';
				
								}
								}	
							} else if ( state == 'out'){
							if ( nuance == 'claire'){
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_clair/rapport_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_clair/rapport_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_clair/rapport_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_clair/rapport_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_clair/rapport_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_clair/rapport_bl.gif';
				
								}
								} else {
									switch (page_family){
									case "library":
									x[i].src = htmlpath + '_img/picto/turquoise_fonce/rapport_bl.gif';
									break;
									case "ethnic":
									x[i].src = htmlpath + '_img/picto/rouge_fonce/rapport_bl.gif';
									break;
									case "classic":
									x[i].src = htmlpath + '_img/picto/bleu_fonce/rapport_bl.gif';
									break;
									case "production":
									x[i].src = htmlpath + '_img/picto/vert_fonce/rapport_bl.gif';
									break;
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/gris_fonce/rapport_bl.gif';
									break;
									default:
									x[i].src = htmlpath + '_img/picto/marron_fonce/rapport_bl.gif';
				
								}
								}
							}
						}*/
						
					var tofind = new RegExp('edit' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							if (nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/edit.gif';
									break;
								}
							}	
						} else if ( state == 'out'){
							if ( nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/edit_bl.gif';
									break;
								}
							}
						}
					}
					
					var tofind = new RegExp('edit' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							if (nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/edit.gif';
									break;
								}
							}	
						} else if ( state == 'out'){
							if ( nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/edit_bl.gif';
									break;
								}
							}
						}
					}
					
					var tofind = new RegExp('supr' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							if (nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/supr.gif';
									break;
								}
							}	
						} else if ( state == 'out'){
							if ( nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/supr_bl.gif';
									break;
								}
							}
						}
					}
					
					var tofind = new RegExp('on' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							if (nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/on.gif';
									break;
								}
							}	
						} else if ( state == 'out'){
							if ( nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/on_bl.gif';
									break;
								}
							}
						}
					}
					
					var tofind = new RegExp('off' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							if (nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/off.gif';
									break;
								}
							}	
						} else if ( state == 'out'){
							if ( nuance == 'claire'){
								switch (page_family){
									case "backoffice":
									x[i].src = htmlpath + '_img/picto/admin/off_bl.gif';
									break;
								}
							}
						}
					}
					
		}
		
}

function SwitchGifsProd ( who, j, htmlpath, state, nuance ) {
		if ( state == 'over'){
			if ( nuance == 'fonce'){
				who.style.background ='#a1a692';
			} else {
				who.style.background ='#d0d5c3';
			}
		} else if ( state == 'out') {
			who.style.background = '#FFFFFF';
		}
		//document['play' + j].src = htmlpath + '_img/picto/marron_fonce/play.gif';
		var x = document.images;
		
		
		
		for (var i=0;i<x.length;i++){
					var tofind = new RegExp('play' + j);
					if ( tofind.test(x[i].name) ) {
						if ( state == 'over'){
							if (nuance == 'claire'){
								x[i].src = htmlpath + '_img/picto/production/play.gif';
								} else {
								x[i].src = htmlpath + '_img/picto/production/play.gif';
								}	
						} else if ( state == 'out'){
							if ( nuance == 'claire'){
									x[i].src = htmlpath + '_img/picto/production/play_bl.gif';
								} else {
									x[i].src = htmlpath + '_img/picto/production/play_bl.gif';
								}
							}
						}
					
		}
		
}

