//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='l\'islam en questions';
var charte_baseHref='http://pages.ifrance.com';
var charte_baseRep='D:\\document\\internet\\pages\\';
var charte_emailHref='mai'+'lto:moussa'+'&#64;'+'no-log.org';
var charte_emailText="Moussa";

var charte_dossiers=new Array('accueil','livres','infos','faq','fetes','langues','voie','contact');
var charte_libelles=new Array('Accueil','Livres','Monde','FAQ','Religion','Langues','J&eacute;sus','Contact');

charte_plan=new Array();
charte_plan['accueil']=new Array('index.htm','Accueil');
charte_plan['livres']=new Array('livres/index.htm','Bibliothèque','livres/messie/index.htm','Le Messie','livres/coranbib/index.htm','Le Coran et la Bible');
charte_plan['infos']=new Array('infos/index.htm','Sommaire','cartes/index.htm','Cartes');
charte_plan['faq']=new Array('faq/index.htm','Sommaire');
charte_plan['langues']=new Array('langues/index.htm','Sommaire langues','visio/index.htm','la Bible multilingue','langues/arabe/index.htm','Arabe','langues/kabyle/index.htm','Kabyle','langues/tamajaq/index.htm','Touareg');
charte_plan['voie']=new Array('voie/index.htm','Sommaire','voie/cb.htm','Cours gratuit','voie/cb/Index.html','Cours interactif');
charte_plan['fetes']=new Array('fetes/index.htm','Sommaire');
charte_plan['contact']=new Array('contact/index.htm','Sommaire');

/// suite

var english;

if (typeof(english)=="undefined") english=false;



////////////////////////////// 2. Partie commune toutes chartes

//Variables transmises par la page
var dossier; //onglet
var rubrique; // Texte associé au lien retour
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 / ...

// 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") 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 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;
}



function charte_edit(p_racine) {
	var l_racine='';
	if (typeof (p_racine)!="undefined") l_racine='&racine='+p_racine;
	if (location.pathname.substring(location.pathname.length-4)=='.htm') 
		location.href="/util/prive/fp2.php?fichier="+escape(location.pathname)+l_racine;
}


function charte_upload(p_racine) {
	var l_racine='';
	if (typeof (p_racine)!="undefined") l_racine='&racine='+p_racine;
	l_chemin=location.pathname.substring(0,location.pathname.lastIndexOf('/'));
	location.href="/util/prive/upload.php?repertoire="+escape(l_chemin)+l_racine;
}

function ecrire(p_adresse) {
	p_adresse=p_adresse.replace(/¤/,'@');
	location.href='mailto:'+p_adresse;
}

//////////////////////////////// 3. Partie visuelle commune chartes semblables



function charte_onglets() {
//Barre de navigation haut

	document.writeln (' <TABLE STYLE="table-layout:fixed" WIDTH=100% CELLSPACING=0 CELLPADDING=5 BORDER=0> ');
	document.writeln (' <TR ALIGN=CENTER VALIGN=top> ');
	document.writeln (' <TD WIDTH=15% CLASS="'+charte_libelles[0]+'"><A HREF='+charte_baseHref+'/index.htm><IMG SRC='+niveau+'charte/logo.gif BORDER=0 HEIGHT=30 WIDTH=30 ALT="Retour à la page d\'accueil"></A><br><FONT SIZE=-2><A HREF='+niveau+'index.htm>Page d\'accueil</A></FONT>');
	document.writeln (' <TD WIDTH=10%> ');
	//document.writeln (' <TD WIDTH=10% CLASS="reservation"><A HREF='+niveau+'reservation/index.htm><IMG SRC='+niveau+'charte/reservation.gif BORDER=0 HEIGHT=30 WIDTH=30 ALT=""></A> ');

	var l_n=charte_libelles.length;
	for (i=1;i<l_n-1;i++) {
		document.writeln ('<TD WIDTH=10% CLASS="'+charte_dossiers[i]+'"><A HREF='+niveau+charte_dossiers[i]+'/index.htm><IMG SRC='+niveau+'charte/'+charte_dossiers[i]+'.gif BORDER=0 HEIGHT=30 WIDTH=30 ALT="'+charte_libelles[i]+'"><br><FONT SIZE=-2>'+charte_libelles[i]+'</A></FONT>');
	}

	document.writeln ('<TD WIDTH=10%>');
	document.writeln ('<TD WIDTH=15% CLASS="'+charte_dossiers[l_n -1]+'">')
		document.writeln ('<A HREF='+niveau+charte_dossiers[l_n -1]+'/index.htm><IMG SRC='+niveau+'charte/'+charte_dossiers[l_n -1]+'.gif BORDER=0 HEIGHT=30 WIDTH=30 ALT="'+charte_libelles[l_n -1]+'"><br><FONT SIZE=-2>'+charte_libelles[l_n -1]+'</A></FONT>');
	document.writeln ('</TABLE>');

	//Met en valeur l'icône dossier courante
	document.writeln (' <STYLE TYPE="text/CSS"><!-- .'+ dossier +' {background-color :orange;border-style:groove} A.'+dossier+':link {text-decoration:none} --></STYLE> ');

}


function charte_entete() {
	charte_headers();

	document.writeln ('</head><body>');
	document.writeln ('<div class="navigation"><nofollow>');
	document.writeln ('<a name="haut"></a>');
	charte_onglets();
	charte_outils();
	document.writeln ('</nofollow></div><div class="page">'); 
	
//Mise du texte dans un cadre coloré avec variantes suivant si sommaire ou pas
	if (niveau=='') ; //Page d'accueil
	else if (sommaire && niveau=='../' && retour=='../index.htm') {//Page principale (sommaire niveau 1)
		rubrique='accueil';
		document.writeln (' <STYLE TYPE="text/CSS"><!-- .page {background-color :orange} --></STYLE> ');
	}
	else if (sommaire) //Sous rubrique
		document.writeln (' <STYLE TYPE="text/CSS"><!-- .page {background-color :lightgreen} --></STYLE> ');
	else //page quelconque
		document.writeln (' <STYLE TYPE="text/CSS"><!-- .page {background-color :aquamarine} --></STYLE> ');


}

//////////////////////////////// 4. Partie visuelle spécifique


function charte_headers() {
	//document.writeln (' <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ');
	document.writeln (' <meta name="revisit-after" content="10 days"> ');
	document.writeln (' <link rel="SHORTCUT ICON" href="'+niveau+'charte/favicon.ico">');
//	document.writeln (' <META HTTP-EQUIV="Page-Exit" content="revealTrans(Duration=1.0,Transition=23)"> '); 
}


function charte_outils() {

	document.writeln ('<HR ondblclick="charte_revele()"><table width=100%><tr>'); 

	//Retour sommaire si pas sommaire d'un premier niveau
	document.writeln ('<td width=33%>'); 
	if (niveau!='' && (sommaire==false || niveau!='../')) 
		document.writeln (' <A HREF="'+retour+'">'+rubrique+'</A>'); 


	///// Outils de Traduction 
	document.writeln ('<td width=33% align=center><FONT SIZE="1">');
	document.writeln ('<span class=cache>[<a href="javascript:charte_upload()">Poster</A>] [<a href="javascript:charte_edit()">Edit</A>]</span>'); 

//Lien vers page en anglais
	if (english)
	{
		var fichier=location.pathname;
		var indice_pages=fichier.indexOf('pages');
		fichier=fichier.substring(0,indice_pages+5)+'/english/'+fichier.substring(indice_pages+6,fichier.length);
		document.writeln(' <FONT SIZE="1">[<a href='+fichier+'>English</A>]</FONT>');
	}
	else
	{
		var fichier="http://trans.voila.fr/ano?anolg=65544&anourl="+escape(document.location);
		document.writeln(' <FONT SIZE="1">[<a href='+fichier+'>English*</A>]</FONT>');
	}

		
	document.writeln(' <FONT SIZE="1"> [<a href=http://www.maarifa.org/>Arabe</A>]</FONT>');


	document.writeln ('</FONT></TD>');

	//Navigation
	document.writeln ('<td width=33% align=right>'); 


	document.writeln('<a href="#bas"><img src="'+niveau+'charte/bas.gif" alt="bas" border="0" width="16" height="15"></a>');
	document.writeln ('</table>');

}

charte_entete();