	
//// soulignage la sequence active ////
	function change_sequences(obj){	
        if ( document.getElementById('menu_sequences') )
        {
		    ch_li = document.getElementById('menu_sequences').childNodes;
		    for (i=0; i<ch_li.length; i++){ch_li.item(i).className = '';}
		    document.getElementById(obj).className = 'encour';
        }
	}
/////////////// Communication avec le Flash ///////////////
//// FLASH -> JS ////
	function selectSequence(idSequence){
		//alert("idSequence " + idSequence);
	}

	function selectDiapositive(idNoeudDiapo){
		showDiapositive(idNoeudDiapo);
	}

//// JS -> FLASH ////
	var currentItem ='';	
	var currentPosition = 0;
	var currentState ='';
	var swf='player';
	var isLoaded=false;
	var timage=0;
	var idSeq=0;
	var idDiapo=0;
	var DiapoSync=false;

	function thisMovie(swf){
		if(navigator.appName.indexOf("Microsoft") != -1){
			return window[swf];
		}else{
			return document[swf];
		}
	}
	
	function timeTick (obj)
	{
		var time = obj.position;
		var i = 0;
		
		for ( i = 0 ; i < jsSeq.length ; i++ )
		{
			if ( jsSeq[i] > time )
			{
				if ( (i-1) != idSeq )
				{
					idSeq = i - 1;
					gotoSequence(idSeq);
				}
				break;
			}
            else if ( i == jsSeq.length - 1 )
            {
                if ( i != idSeq )
                {
                    idSeq = i;
                    gotoSequence (idSeq);
                }
            }
		}

		gotoSequence(idSeq);
		
		for ( i = 0 ; i < jsDiapo.length ; i++ )
		{
			if ( jsDiapo[i] > time )
			{
				if ( (i-1) != idDiapo )
				{
					idDiapo = i - 1;
					if ( jsDiapo[idDiapo] > 0 )
					{
						showDiapositive(jsidDiapo[idDiapo]);
					}
				}
				break;
			}
            else if ( i == jsDiapo.length - 1 )
            {
                if ( i != idDiapo )
                {
                    idDiapo = i;
                    if ( jsDiapo[idDiapo] > 0 )
                    {
                        showDiapositive(jsidDiapo[idDiapo]);
                    }
                }
            }
		}
	}
	
	function playerReady(obj)
	{
		thisMovie(swf).addModelListener("STATE","buffered");
		thisMovie(swf).addModelListener("TIME","timeTick");
	}

	
	function buffered(obj)
	{
		isLoaded=true;
		if (obj.newstate == "PLAYING" )
		{
			thisMovie(swf).removeModelListener("STATE","buffered");
			if ( timage > 0 )
				gotoTime(timage);
		}
	}
	
	// these functions is called by the JavascriptView object of the player.
	function getUpdate(typ,pr1,pr2){
		
		//if(typ == "time"){currentPosition = pr1; pr2 == undefined ? null: currentRemaining = Math.round(pr2);}
		//else if(typ == "volume"){currentVolume = pr1;} 
		//else if(typ == "item"){currentItem = pr1; setTimeout("function(){getItemData(currentItem)}",100)}
		//else if(typ == "state"){currentState = pr1;}
		//else if(typ == "load"){currentLoad = pr1;}
		if(typ == "state"){currentState = pr1;}
		else if(typ == "item"){currentItem = pr1;}
		
		//Debug_Smile(pr1);
	}

	function Debug_Smile(idx){
		/* var objet = thisMovie(swf).itemData(idx);
		var tmp = document.getElementById("left-column_biz"); 
		var html = '';
		
		html += "<font style='color:#00f'><br />***************************************************<br />";
		html += "<i><b>[DEBUG FLASH PLAYER]</b></i><br />";
		/*	
		for(var i in objet) { 
			html += "<font style='color:orange'>"+i+"</font>: "+objet[i]+"<br />";
		}
		
		html += "<font style='color:orange'>objet['<b>sequenceType</b>'] :: </font>"+(objet['sequenceType']?objet['sequenceType']:'')+"<br />";
		html += "<font style='color:orange'>objet['<b>idSequence</b>'] :: </font>"+(objet['idSequence']?objet['idSequence']:'')+"<br />";
		html += "<font style='color:orange'>objet['<b>start</b>'] :: </font>"+(objet['start']?objet['start']:'')+"<br />";
		html += "<font style='color:orange'>objet['<b>duration</b>'] :: </font>"+(objet['duration']?objet['duration']:'')+"<br />";
		
		html += "<br />";

		html += "<font style='color:orange'>objet['<b>fileSave</b>'] :: </font>"+(objet['fileSave']?objet['fileSave']:'')+"<br />";
		html += "<font style='color:orange'>objet['<b>idSave</b>'] :: </font>"+(objet['idSave']?objet['idSave']:'')+"<br />";

		html += "<br />";
		
		html += "<font style='color:orange'>objet['<b>file</b>'] :: </font>"+(objet['file']?objet['file']:'')+"<br />";
		html += "<font style='color:orange'>objet['<b>id</b>'] :: </font>"+(objet['id']?objet['id']:'')+"<br />";

		html += "<br />";

		html += "<font style='color:orange'>objet['<b>fileHD</b>'] :: </font>"+(objet['fileHD']?objet['fileHD']:'')+"<br />";
		html += "<font style='color:orange'>objet['<b>idHD</b>'] :: </font>"+(objet['idHD']?objet['idHD']:'')+"<br />";
		html += "<font style='color:orange'>objet['<b>btHDVisible</b>'] :: </font>"+(objet['btHDVisible']?objet['btHDVisible']:'')+"<br />";
		
		html += "<i><b>[FIN DEBUG FLASH PLAYER]</b></i><br />";
		html += "***************************************************<br /></font>";
		tmp.innerHTML = html;			*/
	}	
	
	function getLength(swf){return(thisMovie(swf).player.getPlaylist()[0].duration);}

	function gotoTime(time){
		if ( time == 0 )
			time = 1;
		if ( !isLoaded )
		{
			sendEvent('PLAY',"true");
			timage=time;
		}
		else
		{
			sendEvent('SEEK',time);
			timage=0;
		}
	}
	
	function sendEvent(typ,prm){
		thisMovie(swf).sendEvent(typ,prm); 
	}

	function getTimestamp(){return currentPosition;}	 

	// Flash -> JS
	function updateDiapo(id){showDiapositive(id);}

	function updateSequence(id){
		if(!id){
		}else{
			change_sequences("sequence_"+id);
			// thisMovie(swf).itemData(currentItem)['idSequence'] = id;
		}
	}

	function itemData(swf,idx){var obj = thisMovie(swf).itemData(idx);}
	
	function gotoSequence(id){
		if( id === false ){
		}else{
			change_sequences("sequence_"+id);
			// thisMovie(swf).itemData(currentItem)['idSequence'] = id;
		}
	}	

	function stopMedia()  // necessite xiti.js
	{ 
		if(!xtdata) return;

		if(xtdata[3]=="play" || xtdata[3]=="pause")  // on est en cours de lecture ou pause
		{
		    //var i = new Image();i.src= 'http://myrecorder.free.fr/tmp/xiti.php';

			xt_med(	
				xtdata[0],xtdata[1],xtdata[2],
				"stop",
				xtdata[4],xtdata[5],xtdata[6],xtdata[7]); 
		}
	}

