/* AUTEUR: Naigeon */
/* DATE DE CREATION: 30/03/1999 */

<!-- Debut script

var tHoteMemos = new Array ;
tHoteMemos[ 0 ] = "free" ;
tHoteMemos[ 1 ] = "medieval" ;
var tHoteMax = tHoteMemos.length - 1 ;

var tHoteEtiqs = new Array ;
tHoteEtiqs[ 0 ] = "Eur free.fr" ;
tHoteEtiqs[ 1 ] = "Usa medieval.org" ;

var tUrlDeIndex = new Array ;
tUrlDeIndex[ 0 ] = "anaigeon.free.fr" ;
tUrlDeIndex[ 1 ] = "www.medieval.org" ;

var tMonRepDeIndex = new Array ;
tMonRepDeIndex[ 0 ] = "" ;
tMonRepDeIndex[ 1 ] = "emfaq/anaigeon/" ;


function fIndexDeEtiq( etiq )
{
 for( var i = 0 ; i <= tHoteMax ; i++ )
  if( tHoteEtiqs[ i ] == etiq )
   return i ;
 return -1 ;
}

function fIndexDeLocationCourante()
{
 for( var i = 0 ; i <= tHoteMax ; i++ )
  if( tUrlDeIndex[ i ] == document.location.hostname )
   return i ;
  return -1 ;
}

function fMemoLoc()
{
 var ix = fIndexDeLocationCourante() ;
 var loc = ix < 0 ? '' : tHoteMemos[ ix ] ;
 if( loc == '' )
  loc = 'free' ; // pour affichage en local
 return loc ; 
}

var tChoixEtiqs = new Array ;

function fEtiqDansChoix( etiq )
{
 for( var i = 0 ; i < tChoixEtiqs.length ; i++ )
  if( tChoixEtiqs[ i ] == etiq )
   return true ;
  return false ; 
}

var ChoixRemplis = false ;

function pRemplirChoix()
{
 if( ChoixRemplis ) return ;
 var iloc = fIndexDeLocationCourante() ; 
 for( var i = 0 ; i <= tHoteMax ; i++ )
 {
  var etiq = tHoteEtiqs[ i ] ;
  if( etiq != tHoteEtiqs[ iloc ] && ! fEtiqDansChoix( etiq ) )
   tChoixEtiqs[ tChoixEtiqs.length ] = etiq ;
 }
 ChoixRemplis = true ;
}

function fLocationDeIndex( i )
{
 var loc = 'http://' ;
 if( i >= 0 )
  loc += ( tUrlDeIndex[ i ] + '/' + tMonRepDeIndex[ i ] ) ;
 return loc ;   
}

function fListeHotes()
{
 pRemplirChoix() ;
 str = '\n<FORM>' ;
 str += '\n<SELECT NAME="ListeHotes" SIZE=1 onChange="if (form.ListeHotes.selectedIndex != 0) top.location = form.ListeHotes.options[form.ListeHotes.selectedIndex].value ;">' ;
str += '\n<OPTION SELECTED VALUE=""> mirror - site - miroir' ;
 for( var i = 0 ; i < tChoixEtiqs.length ; i++ )
 {
  var etiq = tChoixEtiqs[ i ] ;
  str += '\n<OPTION VALUE="' + fLocationDeIndex( fIndexDeEtiq( etiq ) ) + '">' + etiq ;
 }
 str += '\n</SELECT>' ;
 str += '\n</FORM>' ;
 return str ;
}

function pCompteurSelonLoc( memoLoc, idCompteur, depCompteur )
{
 if( memoLoc == 'free' || memoLoc == 'medieval' )
 document.write( '<IMG SRC="http://perso0.free.fr/cgi-bin/wwwcount.cgi?df=anaigeon'
			   + idCompteur + '.dat'
			   + '&dd=E&ft=2&st='
			   + depCompteur
			   + '" BORDER=0 ALT="compteur">' ) ; 
}

function fIdOuNumCompteur( memoLoc, nomPage)
{
 if( memoLoc == 'free' || memoLoc == 'medieval')
 {
	if( nomPage == 'accueil' ) return 0 ;
	if( nomPage == 'ma_musique' ) return 1 ;
	if( nomPage == 'pren_mus' ) return 2 ;
	if( nomPage == 'ligatures' ) return 3 ;
	if( nomPage == 'e_ligatures' ) return 4 ;
	if( nomPage == 'liens' ) return 5 ;
	if( nomPage == 'webrings' ) return 6 ;
	if( nomPage == 'mensur_intro' ) return 7 ;
	if( nomPage == 'partitions' ) return 8 ;
	if( nomPage == 'coloration' ) return 9 ;
 }
 return -1 ;
}

function pCompteurSurPage( nomPage, valDepart )
{
 var loc = fMemoLoc() ;
 id = fIdOuNumCompteur( loc, nomPage ) ;
 if( id >= 0 )
  pCompteurSelonLoc( loc, id, valDepart ) ;  
}

function fPagePrefixe_e()
// détecte une page anglaise préfixée par 'e_'
// attention : certaines pages non préfixées
// sont bilingues - de sorte que la présente
// fonction ne règle pas *tous* les problèmes.
{
 chemin = document.location.pathname ;
 return chemin.indexOf("e_") < 0 ? false : true ;
}

function pCompteurAccueilDepuis()
{
 libelleSelonLangue = fPagePrefixe_e() ? "visits since october" : "visites depuis octobre" ;
 var memoLoc = fMemoLoc() ;
 if( memoLoc == 'free' || memoLoc == 'medieval' )
  document.write( '<I> ', libelleSelonLangue, ' <FONT SIZE="2">1998</FONT></I>' ) ;
}

function fCopyright()
{
 return '<I><FONT SIZE=2 COLOR="#444444">'
 	  + 'Copyright (C) Alain Naigeon, <FONT SIZE=1>1996 - 2005</FONT>'
	  + '</FONT></I>' ;
}

function pBanniereIndex()
{
 // Si elle apparaît sur une page anglaise, préfixée par e_,
 // la bannière doit appeler e_index.html, sinon index.html
 cheminIndexFrance = fLocationDeIndex( fIndexDeLocationCourante() ) ;
 lg = cheminIndexFrance.length ;
 if( lg > 0 ) // ajout de / final si pas déjà là (compte nbci)
 {
   if( cheminIndexFrance.charAt( lg-1 ) != '/' )
    cheminIndexFrance += '/' ;   
 }
 cheminIndex = cheminIndexFrance ;
 if( fPagePrefixe_e() )
 {
   cheminIndex += 'e_' ;
 }
 cheminIndex += 'index.html' ;
 // génération du lien sous-jacent à la bannière
 document.write( '<CENTER><A HREF="' 
 			   + cheminIndex
			   + '" TARGET="_top">' 
 			   + '<IMG SRC="ban_index.gif" BORDER=0 WIDTH=468 HEIGHT=60 ALT="bannière">' 
			   + '</A><BR>'
			   + fCopyright()
			   + '</CENTER><BR>' ) ;
}

function pProposerListbotFrance()
{
 document.write( '<FONT FACE="Arial,Verdana,Helvetica,Geneva,Sans-serif" SIZE=2>' +
				 '<A HREF="souscrire_listbot.html" TARGET="new">' +
				 'Recevez les mises à jour du site !</A>' +
				 '</FONT>'
			   ) ;
}

function pProposerListbotEnglish()
{
 document.write( '<FONT FACE="Arial,Verdana,Helvetica,Geneva,Sans-serif" SIZE=2>' +
				 '<A HREF="souscrire_listbot.html" TARGET="new">' +
				 'To be informed of site updates!</A>' +
				 '</FONT>'
			   ) ;
}

function pLienVersMonMail( libelleLien, tailleFonte, sujet )
{
 document.write('<a href="mailto:anaigeon@free.fr?subject=' + sujet + '">'
              + '<FONT SIZE="' + tailleFonte + '">'
		      + libelleLien + '</FONT></a>' ) ;
}

//  Fin script -->