var cible="";

function Ie_Patch()
{
	if(document.getElementById(cible).style.display=="")
	{
		new Effect.Appear(cible, { duration: 0, from: 1, to: 1});

	}
	
}

var texte="";

function FCKeditor_OnComplete(editorInstance) 
{
    
	if(editorInstance.Name == "tool-format") 
	{
				texte=editorInstance.GetHTML();
				editorInstance.Events.AttachEvent('OnSelectionChange', Get_Texte);
    }
}

function Get_Texte(editorInstance) 
{
		texte=editorInstance.GetHTML();
}


function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function Get_Scroll_Top()
{
		var scrolltop;
						
		if(truebody().scrollTop!=document.body.scrollTop && document.body.scrollTop>truebody().scrollTop)
		{
			scrolltop=document.body.scrollTop;
		}
		else
		{
			scrolltop=truebody().scrollTop;
		}
		
		return scrolltop;
}

function getTotalHeight() {

  // firefox is ok
  var height = document.documentElement.scrollHeight;

  // now IE 7 + Opera with "min window"
  if(document.documentElement.clientHeight > height ) {
    height  = document.documentElement.clientHeight;
  }
  // last for safari
  if(document.body.scrollHeight > height) {
    height = document.body.scrollHeight;
  }
  return height;
}

function Display_Video(id)
{
		
		function Display_Video_Code()
		{
				document.getElementById('video-container-2').innerHTML='<embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/'+id+'&autoplay=1" style="width:640px;height:480px;" id="flvvideo" name="flvvideo" quality="high" width="640" height="480">'
				 document.getElementById('video').style.top=Get_Scroll_Top()+20+'px';
				 new Effect.toggle('video','appear', { duration: 1 });

		}
		
		//document.getElementById('video-fond').style.display='none';
		
				document.getElementById('div-absolute').style.height=getTotalHeight()+'px';

document.getElementById('video-fond').style.height=getTotalHeight()+'px';
		
		 new Effect.Appear('video-fond', { duration: 1, from: 0.0, to: 0.8,afterFinish:Display_Video_Code});

		
}

function Hide_Video()
{
	 
	 function Hide_Video_Code()
	 {
		 	 new Effect.Appear('video-fond', { duration: 0, from: 0.0, to: 0.0 });
			 document.getElementById('video-container-2').innerHTML="";
			 document.getElementById('div-absolute').style.height='0px';
			  document.getElementById('video-fond').style.height='0px';
	 }
	 
	 new Effect.toggle('video','appear', { duration: 1,afterFinish:Hide_Video_Code});
	 
	 

}


function View_Content(valeur)
{
		new Effect.Move("content-mvt",{x:valeur,Y: 0,mode:'absolute'});
}

