﻿if (typeof (niveau)=="undefined") niveau='../';

//1. Partie paramétrable
//2. Partie commune toutes chartes
//3. Partie visuelle commune chartes semblables
//4. Partie visuelle spécifique

//////////////////////////////// 1. Partie paramétrable

var charte_nomSite='Info-Bible';
var charte_baseHref='http://www.info-bible.org/';
var charte_baseUtil='/util/';

if (location.host=='localhost') 
	var charte_racineServeurWeb='d:document'; 
else 
	var charte_racineServeurWeb='../..'; 
var charte_emailHref=niveau+'pages/contact.htm';
var charte_emailText="Contact";
var charte_classeOutilsAdministration='cache'; // 'cache' => masqués, '' => visibles

//Onglets
var charte_dossiers=new Array('Accueil','Bible','Histoire','Etude','Conférences','FAQ','Articles');

charte_plan=new Array();
charte_plan['Accueil']=new Array('index.htm','Accueil','pages/nouveau.htm','Nouveaut&eacute;s','outils/plan.htm','Plan du site','pages/bestof.htm','Présentation');
charte_plan['Bible']=new Array('bible/index.htm','Sommaire','lsg/INDEX.html','Bible Segond','../visio/index.htm?url=aide.htm','Bible multilingue','pages/gratuit.htm','Livres gratuits','bible/telechar.htm','télécharger la Bible');
charte_plan['Histoire']=new Array('histoire/index.htm','Sommaire histoire','histoire/jesus.htm','Historicité Jésus','histoire/resurrection.htm','Historicité résurrection','histoire/histoire.htm','Histoire de la Bible','histoire/manuscrits.htm','Manuscrits','histoire/reforme/index.htm','Protestantisme','histoire/vaudois/index.htm','Vaudois');
charte_plan['Etude']=new Array('bible/etude.htm','Sommaire','credo/index.htm','CREDO', 'cinq/index.htm','Cours Biblique');
charte_plan['Conférences']=new Array('conferences/index.htm','Conférences','ppt/index.htm?url=SyFier.htm','La Bible peut on s\'y fier');
charte_plan['FAQ']=new Array('faq/index.htm','FAQ Bible', 'question/index.htm','Questions qui reviennent toujours' );
charte_plan['Articles']=new Array('articles/index.htm','Sommaire','articles/anges.htm','Les anges','legrand/index.htm','Fernand Legrand','temoin/index.htm','Témoignages');
charte_plan['Questions']=new Array('question/index.htm','Questions qui reviennent toujours' );


//Sous-dossiers
charte_plan['Fernand Legrand']=new Array('legrand/index.htm','Fernand Legrand','legrand/liste.htm','Textes','legrand/mp3.htm','mp3','legrand/commande.htm','Commander' );

charte_plan['Prédications']=new Array('legrand/index.htm','Fernand Legrand','perrier/index.htm','Yves Perrier','legrand/1.htm','Album 1','legrand/2.htm','Album 2','legrand/3.htm','Album 3'); //,'legrand/4.htm','Album 4','legrand/5.htm','Album 5','legrand/6.htm','Album 6'
charte_plan['LA BIBLE']=new Array('lsg/INDEX.html','Bible Segond','lsg/Aide.htm','Aide','bible/telechar.htm','Télécharger Bible');
charte_plan['Témoignages']=new Array('temoin/index.htm','Sommaire témoignages');
charte_plan['Israël']=new Array('israel/index.htm','Sommaire Israël');
charte_plan['CREDO']=new Array('credo/index.htm','CREDO','credo/1.htm','1 La Bible','credo/2.htm','2 Dieu, l\'homme','credo/3.htm','3 La vie chrétienne','credo/4.htm','4 L\'église','credo/5.htm','5 L\'avenir','credo/6.htm','6 Divers');
charte_plan['Cours Biblique']=new Array('cinq/index.htm','Sommaire','cinq/5mn5pts.htm','A lire!','cinq/bible.htm','Cours 1: la Bible','pages/gratuit.htm','Livres gratuits');
charte_plan['Protestantisme']=new Array('histoire/reforme/index.htm','Protestantisme','histoire/reforme/martin-luther.htm','Luther','histoire/reforme/calvin.htm','Calvin','histoire/reforme/confession-rochelle.htm','Confession de foi');
charte_plan['Vaudois']=new Array('histoire/vaudois/index.htm','Sommaire','histoire/vaudois/noms-vaudois.htm','Noms Vaudois', 'livres/epopee.vaudoise/index.htm','Epopée vaudoise', 'livres/Histoire.Eglise.Vaudoise.1/index.htm', 'Histoire des Vaudois de Monastier', 'histoire/vaudois/tome1.htm','Première partie','histoire/vaudois/tome2.htm','Seconde partie','histoire/vaudois/vaudois.htm','Réflexions sur les Vaudois');
charte_plan['Catholique']=new Array('histoire/catholique/index.htm','Sommaire','histoire/catholique/catholique.htm','Catholique', 'histoire/reforme/indulgences.htm','indulgences', 'histoire/vaudois/prostituee.htm','prostituée','histoire/catholique/peres-de-l-eglise.htm','Citations Pères de l\'Eglise');

//Permet de retrouver l'onglet associé à un sous dossier 
//Pour chaque sous dossier on donne le nom du dossier parent
charte_parent=new Array();
charte_parent['LA BIBLE']='Bible';
charte_parent['CREDO']='Etude';
charte_parent['Fernand Legrand']='Articles';
charte_parent['Prédications']='Articles';
charte_parent['Témoignages']='Articles';
charte_parent['Israël']='Articles';
charte_parent['Cours Biblique']='Etude';
charte_parent['Questions']='FAQ';
charte_parent['Protestantisme']='Histoire';
charte_parent['Vaudois']='Histoire';
charte_parent['Catholique']='Histoire';


////////////////////////////// 2. Partie commune toutes chartes

//Variables transmises par la page
var dossier; //onglet
var rubrique; // Texte associé au bandeau bleu
var niveau;
var retour; // url proposée pour suite
var sommaire;


//var charte_chemin=location.href; //sans le http:// et le ?search attention aux \ et au / ...
var charte_chemin=location.pathname;
charte_chemin=charte_chemin.replace(/\\/g , "/"); 
//Nom du fichier sans extension
//charte_fichier=charte_chemin.substring(fichier.lastIndexOf('/')+1,fichier.lastIndexOf('.'));


// Standardisation JavaScript

function charte_standard() {
	if (!document.styleSheets[0].addRule) {
		document.styleSheets[0].addRule = new Function('element','regle', 'this.insertRule(element +" {"+ regle +"}",this.cssRules.length )');
	}
}
if (!document.getElementById && document.all) document.getElementById = new Function('id', 'return document.all[id]') 

//Valeurs par défaut 

if (typeof (dossier)=="undefined" && (typeof (rubrique)=="undefined")) dossier=charte_nomSite;
if (typeof (rubrique)=="undefined" && dossier=='Accueil') rubrique=charte_nomSite;
if (typeof (rubrique)=="undefined") rubrique=dossier;
if (typeof (dossier)=="undefined") dossier=rubrique;
if (typeof (niveau)=="undefined") niveau='../';
if (typeof (sommaire)=="undefined") {
	if (charte_chemin.substring(charte_chemin.length-9,charte_chemin.length-4)=='index') sommaire=true;	
	else sommaire=false;
} 

if (typeof (retour)=="undefined") {
	if (sommaire) retour='../index.htm';
	else retour='index.htm';
}

var charte_ongletCourant=dossier;
//tq on a affaire à un sous-dossier avec onglet<>dossier on remonte d'un cran
while (charte_parent[charte_ongletCourant]) {
	charte_ongletCourant=charte_parent[charte_ongletCourant];
}



var etat_revele=0;
function charte_revele() {
	charte_standard();
	if (etat_revele==0)
		document.styleSheets[0].addRule(".cache","display:inline");
	else 
		document.styleSheets[0].addRule(".cache","display:none");
	etat_revele=1-etat_revele;
}

var etat_aide=0;
function charte_aide() {
	charte_standard();
	if (etat_aide==0)
		document.styleSheets[0].addRule(".aide","display:inline");
	else 
		document.styleSheets[0].addRule(".aide","display:none");
	etat_aide=1-etat_aide;
}

charte_baseVisio=niveau+'../../visio/visiocssfinale/';
function bible(p_ref,p_type,p_version) {
	var lb_dupliquerRef=true,lb_icone=true;
	if (p_type==null) p_type='';
	if (p_type.indexOf('i')!=-1) {lb_dupliquerRef=false;} //Seulement l'icône
	if (p_type.indexOf('r')!=-1) {lb_icone=false;} //Seulement la référence
	

//http://bible.gospelcom.net/passage/?search=jean+3.16&version=32;
if (location.protocol.substring(0,4)=='http') 
	document.write('<A href="http://visionneuse.free.fr/index.htm?xsl=on&ref='+escape(p_ref));
//		document.write('<A href="http://bible.gospelcom.net/passage/?version=32&search='+escape(p_ref));
else {
	document.write('<A href="'+charte_baseVisio+'index.htm?ref='+escape(p_ref));
	if (p_version!=null) document.write('&version='+p_version) ;
}
	document.write('" target="bible" CLASS="ref">');
	
	if (lb_dupliquerRef) document.write(p_ref);
	if (lb_icone) document.write('<IMG src="'+niveau+'charte/bible.gif" class="ref" align=middle border=0 ALT="'+p_ref+'">');
	document.write('</A>')
}


//////////////////////////////// 3. Charte semblables


function ecrire(p_adresse) {
	p_adresse=p_adresse.replace(/¤/,'@');
	location.href='mailto:'+p_adresse;
}

//Ecrit les onglets
function charte_onglets() {
	var ls_classe;
	document.writeln ('<nofollow><table cellspacing=0 cellpadding=1 > ');
	document.writeln (' <tr align=center valign=middle> ');

	for (i=0;i<charte_dossiers.length;i++) {
		l_urlonglet=niveau+charte_plan[charte_dossiers[i]][0];
		if (charte_ongletCourant==charte_dossiers[i]) ls_classe='ongletactif'; else ls_classe='ongletinactif';
		document.write('<TD width=80 class="'+ls_classe+'" onclick="location.href=\''+l_urlonglet+'\';return false"><a class="'+ls_classe+'" TARGET=_TOP href="');
		document.write(l_urlonglet);
		document.write('">');
		document.write(charte_dossiers[i]);
		document.write('</a><td width=2>');
	}
	document.writeln (' <tr height=2>');
	for (i=0;i<charte_dossiers.length;i++) 
		document.writeln ('<td bgcolor=gray><td>');

	document.writeln (' </table></nofollow>'); 
}

//Ecrit les liens transversaux
function charte_liensTransversaux() {
	if (!charte_plan[dossier]) return;
	document.writeln('<div style="margin-bottom:0">');

	var ls_classe;

	for (j=0;j<charte_plan[dossier].length / 2 ; j++) {
	if (charte_chemin.substring(charte_chemin.length-charte_plan[dossier][2*j].length)==charte_plan[dossier][2*j]) ls_classe='lientransversalactif'; else ls_classe='lientransversalinactif';
		document.write('[<a class='+ls_classe+' href="'+niveau);
		document.write(charte_plan[dossier][2*j]);
		document.write('">');
		document.write(charte_plan[dossier][2*j+1]);
		document.write('</a>] ');
	}
	document.writeln('</div>');

}

//////////////////////////////// 4. spécifique site IB


var liens;
if (typeof (liens)=="undefined") liens='[<a href="http://www.info-bible.org">info-bible.org</a>] [<a href="http://www.info-sectes.org">info-sectes.org</a>] ';

function charte_entete() {
// Meta
document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
document.writeln('<META HTTP-EQUIV="Page-Exit" content="revealTrans(Duration=1.0,Transition=21)">');
//document.writeln('<META HTTP-EQUIV="Page-Exit" content="blendTrans(Duration=2.0)">');
//SPECIFIQUE
document.writeln('<LINK REL="SHORTCUT ICON" href="'+charte_baseHref+'favicon.ico">');

// haut
document.writeln('<div class="navigation"><div align="center">'); 
document.writeln('<a name=haut />');
//Onglets
charte_onglets();

//Liens transversaux
charte_liensTransversaux();

//Barre rubrique
document.writeln('<br><table cellpadding="0" cellspacing="0" style="table-layout:fixed" width="100%"> ');
document.writeln('<TR>');
document.writeln('<TD WIDTH=30><A HREF="'+niveau+'index.htm" TARGET="_top"><IMG SRC="'+niveau+'charte/logo.gif" ALT="retour page d\'accueil" BORDER=0 WIDTH=30 HEIGHT=30></A></TD>');
document.writeln('<TD bgcolor=#003399 CLASS="rubrique" ondblclick="charte_revele()"><FONT COLOR=white>&nbsp;'+rubrique+'</FONT></TD>');
document.writeln('<TD bgcolor=#003399 ALIGN=right VALIGN=middle>');

document.writeln('<FORM ACTION="http://search.freefind.com/find.html" METHOD="GET" STYLE="display:inline">');
//SPÉCIFIQUE
document.writeln('<INPUT TYPE="HIDDEN" NAME="id" SIZE="-1" VALUE="9718030">');
document.writeln('<INPUT TYPE="HIDDEN" NAME="pid" SIZE="-1" VALUE="r">');
document.writeln('<INPUT TYPE="HIDDEN" NAME="mode" SIZE="-1" VALUE="ALL">&nbsp;');
document.writeln('<INPUT TYPE="TEXT" NAME="query" SIZE=15 STYLE="font-family:arial;font-size:10">');
document.writeln('<INPUT TYPE="HIDDEN" NAME="lang" VALUE="fr" >');
document.writeln('<INPUT TYPE="SUBMIT" VALUE="Chercher!" STYLE="font-family:arial;font-size:10">');
document.writeln('<input type="HIDDEN" name="t" value="s">');
document.writeln('</FORM>');
document.writeln('</TD></TR></TABLE>');


document.writeln('</div>');

//if (retour==null) document.writeln('<p><A HREF='+niveau+'index.htm><FONT SIZE=1>Retour à la page d\'accueil</FONT></A>');
//else if (retour!='') document.writeln('<p><A HREF="'+retour+'"><FONT SIZE=1>Retour au sommaire</FONT></A>');
//Mettre retour='' pour supprimer la ligne!
//corps

document.writeln('</div><div class=page>');
}


charte_entete();