// JavaScript Document
//function music(){
//window.location="mp3/fond.mp3";
//}

// Javascript FCK Editor

var FCKeditor = function( instanceName, width, height, toolbarSet, value )
{
	// Properties
	this.InstanceName	= instanceName ;
	this.Width			= width			|| '100%' ;
	this.Height			= height		|| '200' ;
	this.ToolbarSet		= toolbarSet	|| 'Default' ;
	this.Value			= value			|| '' ;
	this.BasePath		= '/fckeditor/' ;
	this.CheckBrowser	= true ;
	this.DisplayErrors	= true ;
	this.EnableSafari	= false ;		// This is a temporary property, while Safari support is under development.
	this.EnableOpera	= false ;		// This is a temporary property, while Opera support is under development.

	this.Config			= new Object() ;

	// Events
	this.OnError		= null ;	// function( source, errorNumber, errorDescription )
}

FCKeditor.prototype.Version			= '2.3.2' ;
FCKeditor.prototype.VersionBuild	= '1082' ;

FCKeditor.prototype.Create = function()
{
	document.write( this.CreateHtml() ) ;
}

FCKeditor.prototype.CreateHtml = function()
{
	// Check for errors
	if ( !this.InstanceName || this.InstanceName.length == 0 )
	{
		this._ThrowError( 701, 'You must specify an instance name.' ) ;
		return ;
	}

	var sHtml = '<div>' ;

	if ( !this.CheckBrowser || FCKeditor_IsCompatibleBrowser() )
	{
		sHtml += '<input type="hidden" id="' + this.InstanceName + '" name="' + this.InstanceName + '" value="' + this._HTMLEncode( this.Value ) + '" style="display:none" />' ;
		sHtml += this._GetConfigHtml() ;
		sHtml += this._GetIFrameHtml() ;
	}
	else
	{
		var sWidth  = this.Width.toString().indexOf('%')  > 0 ? this.Width  : this.Width  + 'px' ;
		var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ;
		sHtml += '<textarea name="' + this.InstanceName + '" rows="4" cols="40" style="width:' + sWidth + ';height:' + sHeight + '">' + this._HTMLEncode( this.Value ) + '<\/textarea>' ;
	}

	sHtml += '</div>' ;
	
	return sHtml ;
}

FCKeditor.prototype.ReplaceTextarea = function()
{
	if ( !this.CheckBrowser || FCKeditor_IsCompatibleBrowser() )
	{
		// We must check the elements firstly using the Id and then the name.
		var oTextarea = document.getElementById( this.InstanceName ) ;
		var colElementsByName = document.getElementsByName( this.InstanceName ) ;
		var i = 0;
		while ( oTextarea || i == 0 )
		{
			if ( oTextarea && oTextarea.tagName.toLowerCase() == 'textarea' )
				break ;
			oTextarea = colElementsByName[i++] ;
		}
		
		if ( !oTextarea )
		{
			alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found' ) ;
			return ;
		}

		oTextarea.style.display = 'none' ;
		this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ;
		this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ;
	}
}

FCKeditor.prototype._InsertHtmlBefore = function( html, element )
{
	if ( element.insertAdjacentHTML )	// IE
		element.insertAdjacentHTML( 'beforeBegin', html ) ;
	else								// Gecko
	{
		var oRange = document.createRange() ;
		oRange.setStartBefore( element ) ;
		var oFragment = oRange.createContextualFragment( html );
		element.parentNode.insertBefore( oFragment, element ) ;
	}
}

FCKeditor.prototype._GetConfigHtml = function()
{
	var sConfig = '' ;
	for ( var o in this.Config )
	{
		if ( sConfig.length > 0 ) sConfig += '&amp;' ;
		sConfig += escape(o) + '=' + escape( this.Config[o] ) ;
	}

	return '<input type="hidden" id="' + this.InstanceName + '___Config" value="' + sConfig + '" style="display:none" />' ;
}

FCKeditor.prototype._GetIFrameHtml = function()
{
	var sFile = 'fckeditor.html' ;
	
	try
	{
		if ( (/fcksource=true/i).test( window.top.location.search ) )
			sFile = 'fckeditor.original.html' ;
	}
	catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }

	var sLink = this.BasePath + 'editor/' + sFile + '?InstanceName=' + this.InstanceName ;
	if (this.ToolbarSet) sLink += '&amp;Toolbar=' + this.ToolbarSet ;

	return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="0" scrolling="no"></iframe>' ;
}

// Deprecated (to be removed in the 3.0).
FCKeditor.prototype._IsCompatibleBrowser = function()
{
	return FCKeditor_IsCompatibleBrowser() ;
}

FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription )
{
	this.ErrorNumber		= errorNumber ;
	this.ErrorDescription	= errorDescription ;

	if ( this.DisplayErrors )
	{
		document.write( '<div style="COLOR: #ff0000">' ) ;
		document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ;
		document.write( '</div>' ) ;
	}

	if ( typeof( this.OnError ) == 'function' )
		this.OnError( this, errorNumber, errorDescription ) ;
}

FCKeditor.prototype._HTMLEncode = function( text )
{
	if ( typeof( text ) != "string" )
		text = text.toString() ;

	text = text.replace(
		/&/g, "&amp;").replace(
		/"/g, "&quot;").replace(
		/</g, "&lt;").replace(
		/>/g, "&gt;") ;

	return text ;
}

function FCKeditor_IsCompatibleBrowser()
{
	var sAgent = navigator.userAgent.toLowerCase() ;

	// Internet Explorer
	if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
	{
		var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
		return ( sBrowserVersion >= 5.5 ) ;
	}

	// Gecko (Opera 9 tries to behave like Gecko at this point).
	if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 && !( typeof(opera) == 'object' && opera.postError ) )
		return true ;

	// Opera
	if ( this.EnableOpera && navigator.appName == 'Opera' && parseInt( navigator.appVersion ) >= 9 )
			return true ;

	// Safari
	if ( this.EnableSafari && sAgent.indexOf( 'safari' ) != -1 )
		return ( sAgent.match( /safari\/(\d+)/ )[1] >= 312 ) ;	// Build must be at least 312 (1.3)

	return false ;
}

// fin de FCK --------------------------------------------------------------------------------------

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function EmailLink(){
	window.location = "mailto:"+"?subject=Site de Take Five Orchestra" + "&body=Je te recommande le site de "+document.title+" "+window.location;
	}

var menuimg = new Array(40);
	menuimg[1] = new Image();
	menuimg[1].src = "images/nav/acceuil_03.gif";
	menuimg[2] = new Image();
	menuimg[2].src = "images/nav/acceuil_04.gif";
	menuimg[3] = new Image();
	menuimg[3].src = "images/nav/acceuil_05.gif";
	menuimg[4] = new Image();
	menuimg[4].src = "images/nav/acceuil_06.gif";
	menuimg[5] = new Image();
	menuimg[5].src = "images/nav/acceuil_07.gif";
	menuimg[6] = new Image();
	menuimg[6].src = "images/nav/acceuil_08.gif";
	menuimg[7] = new Image();
	menuimg[7].src = "images/nav/acceuil_09.gif";
	menuimg[8] = new Image();
	menuimg[8].src = "images/nav/acceuil_10.gif";
	menuimg[9] = new Image();
	menuimg[9].src = "images/nav/acceuil_11.gif";
	menuimg[10] = new Image();
	menuimg[10].src = "images/nav/acceuil_12.gif";
	menuimg[11] = new Image();
	menuimg[11].src = "images/nav/son.gif";
	menuimg[12] = new Image();
	menuimg[12].src = "images/nav/recok.gif";
	menuimg[13] = new Image();
	menuimg[13].src = "images/nav/acceuil_03on.gif";
	menuimg[14] = new Image();
	menuimg[14].src = "images/nav/acceuil_04on.gif";
	menuimg[15] = new Image();
	menuimg[15].src = "images/nav/acceuil_05on.gif";
	menuimg[16] = new Image();
	menuimg[16].src = "images/nav/acceuil_06on.gif";
	menuimg[17] = new Image();
	menuimg[17].src = "images/nav/acceuil_07on.gif";
	menuimg[18] = new Image();
	menuimg[18].src = "images/nav/acceuil_08on.gif";
	menuimg[19] = new Image();
	menuimg[19].src = "images/nav/acceuil_09on.gif";
	menuimg[20] = new Image();
	menuimg[20].src = "images/nav/acceuil_10on.gif";
	menuimg[21] = new Image();
	menuimg[21].src = "images/nav/acceuil_11on.gif";
	menuimg[22] = new Image();
	menuimg[22].src = "images/nav/acceuil_12on.gif";
	menuimg[23] = new Image();
	menuimg[23].src = "images/nav/sonover.gif";
	menuimg[24] = new Image();
	menuimg[24].src = "images/nav/recokover.gif";
	menuimg[25] = new Image();
	menuimg[25].src = "images/caseimg/info.gif";
	menuimg[26] = new Image();
	menuimg[26].src = "images/caseimg/infoover.gif";
	menuimg[27] = new Image();
	menuimg[27].src = "images/caseimg/case3_11.jpg";
	menuimg[28] = new Image();
	menuimg[28].src = "images/caseimg/case3_11over.jpg";
	menuimg[29] = new Image();
	menuimg[29].src = "images/nav/abo.jpg";
	menuimg[30] = new Image();
	menuimg[30].src = "images/nav/aboover.jpg";
	// photomaton
	menuimg[31] = new Image();
	menuimg[31].src = "images/present/musiciens/emilio.jpg";
	menuimg[32] = new Image();
	menuimg[32].src = "images/present/musiciens/ferneld.jpg";
	menuimg[33] = new Image();
	menuimg[33].src = "images/present/musiciens/pierre.jpg";
	menuimg[34] = new Image();
	menuimg[34].src = "images/present/musiciens/raphael.jpg";
	menuimg[35] = new Image();
	menuimg[35].src = "images/present/musiciens/francois.jpg";
	menuimg[36] = new Image();
	menuimg[36].src = "images/present/musiciens/ventzislav.jpg";
	menuimg[37] = new Image();
	menuimg[37].src = "images/present/musiciens/mouniette.jpg";
	menuimg[38] = new Image();
	menuimg[38].src = "images/present/musiciens/faith.jpg";
	menuimg[39] = new Image();
	menuimg[39].src = "images/present/musiciens/florian.jpg";
		
	function changebout(a,b){
		if (document.images != null) {
			document[a].src=menuimg[b].src;
		}
	}
	
	function checkmailami(){
   // check email
   var aString = document.mailami.emailami.value.toLowerCase();
   if (aString == '' || aString.indexOf('.') == -1 || aString.indexOf('@') == -1 || aString.length < 5)
   {
     	document.mailami.emailami.value = "mail non valide";
		return false;
   } 
   window.open("modules/pop.htm","popup","toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=350,height=100,left=350,top=300");
   return true;
}
	function checkmailnews(){
   var aString = document.mailnews.emailnews.value.toLowerCase();
   if (aString == '' || aString.indexOf('.') == -1 || aString.indexOf('@') == -1 || aString.length < 5)
   {
     	document.mailnews.emailnews.value = "mail non valide";
		return false;
   } 
   window.open("modules/pop.htm","popup","toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=350,height=100,left=358,top=293");
   return true;
}
	function popattente(){
   ff=window.open("modules/popattente.htm","popup","toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=350,height=100,left=361,top=297");
   ff.focus();
}
// popup foto
/*
IE5=NN4=NN6=false
if (document.all)
  IE5=true;
else if (document.getElementById)
  NN6=true;
else if (document.layers)
  NN4=true;

function autoSize()
  {
  if (IE5) self.resizeTo(document.images[0].width+10,
document.images[0].height+31);
  else if (NN6) self.sizeToContent();
  else window.resizeTo(document.images[0].width,
document.images[0].height+20);
  self.focus()
  } 
  */
	function popfoto(foto,x,y){
//	x+=30;
//	y+=55;
 ff=window.open(foto,"fotopopup","toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,left=50,top=150,width="+ x+",height="+y);
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    ff.outerWidth=x+25;
    ff.outerHeight=y+72;
   }
   else ff.resizeTo(x+30,y+55);
 }
   ff.focus();
}
	function popplayer(foto,x,y){
//	x+=30;
//	y+=55;
 fff=window.open(foto,"player","toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,left=50,top=150,width="+ x+",height="+y);
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    fff.outerWidth=x+25;
    fff.outerHeight=y+72;
   }
   else fff.resizeTo(x+30,y+55);
 }
   fff.focus();
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

