// Variable globale 
var Cliquez='\nCliquez pour afficher&nbsp;';

// 1- Lien encapsulé avec références décrites au cas par cas dans la page du timbre
function Ref_Lien ( Body, CoulBord, Ref_Site )
{
 var Corpus='<BODY>';
 
 if (Body!='')
 Corpus=Body;
 
 Couleurs_Bord='';
 if (CoulBord !='')
 Couleurs_Bord='BORDERCOLOR="' + CoulBord + '" BORDERCOLORLIGHT="' + CoulBord + '" BORDERCOLORDARK="' + CoulBord +'"';
 var LgBord=' BORDER="1" ';
 if (CoulBord =='0') LgBord=' BORDER="0" ';
 
 if (Ref_Site=='')
 {
  Corpus='<BODY BACKGROUND="../Images/Fond_Bleu.gif" BGCOLOR="#404080" TEXT="#FF0000" LINK="#4AFF6A" VLINK="#00EC06" ALINK="#C7FE47">';
  Ref='<B>Ce lien va être bientôt référencé, travail en cours...</B>';
 }
 else 
 Ref=Ref_Site;
 
 parent.DroiteBas.document.clear();
 parent.DroiteBas.document.close();
 parent.DroiteBas.document.open();
 parent.DroiteBas.document.writeln ('<HTML>\n');
 parent.DroiteBas.document.writeln ( Corpus );
 parent.DroiteBas.document.writeln ('\n<DIV ALIGN="Center">');
 parent.DroiteBas.document.writeln ('<TABLE ALIGN="Center" '+LgBord+ Couleurs_Bord + ' CELLSPACING="0" CELLPADDING="0" HEIGHT="100%" WIDTH="100%">');
 parent.DroiteBas.document.writeln (' <TR>');
 parent.DroiteBas.document.writeln ('  <TD>');
 parent.DroiteBas.document.writeln ('   <TABLE ALIGN="Center" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="100%" WIDTH="100%">');
 parent.DroiteBas.document.writeln ('    <TR>');
 parent.DroiteBas.document.writeln ('     <TD>');
 parent.DroiteBas.document.writeln ('      <IMG SRC="../Images/Vide.gif" BORDER="0" NAME="AfficheTimbre" ALIGN="Middle">');// Cette inserion est nécessaire dans le cas où s'affiche le cadre de références du lien alors que la liste des timbres est toujours présente, évite une erreur JavaScript...
 parent.DroiteBas.document.writeln ('     </TD>');
 parent.DroiteBas.document.writeln ('     <TD ALIGN="Center">');
 parent.DroiteBas.document.writeln ('      <FONT FACE="Arial,Helvetica" SIZE="3">'+ Ref + '</FONT>');
 parent.DroiteBas.document.writeln ('     </TD>');
 parent.DroiteBas.document.writeln ('    </TR>');
 parent.DroiteBas.document.writeln ('   </TABLE>');
 parent.DroiteBas.document.writeln ('  </TD>');
 parent.DroiteBas.document.writeln (' </TR>');
 parent.DroiteBas.document.writeln ('</TABLE>');
 parent.DroiteBas.document.writeln ('</DIV>\n');
 parent.DroiteBas.document.writeln ('</BODY>');
 parent.DroiteBas.document.write   ('</HTML>');
 parent.DroiteBas.document.close();
}

// 2 - Lien avec références décrites dans un fichier de références ( Dossier ../Liens ) 
//                                                                                      
// URL_Lien : la page de lien affichée en frame Droite                                  
// URLRef   : la référence au site du lien affichée en frame DroiteBas                  

function Fichier_Lien(URL_Lien,URLRef)
{  
 parent.Droite.location.href=URL_Lien;
 parent.DroiteBas.location.href=URLRef;
}

// 3 - Lien dans une fenêtre autonome avec références décrites au cas par cas dans le bas de la fenêtre
function Fenetre_Lien(URL_Lien,Body,CoulBord,Ref_Site)
{
 var Index_Lien=
  '<HTML>'
 +'<HEAD>'
 +'  <TITLE>Phil-Ouest : Lien externe</TITLE>'
 +'</HEAD>'
 +'<FRAMESET ROWS="*,52" BORDER="0" BORDERSPACING="0" FRAMEBORDER="0" FRAMESPACING="0" NORESIZE>'
 +'  <FRAME SRC='+URL_Lien+' NAME="Haut" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="auto" FRAMEBORDER="0" FRAMECOLOR="#00FFFF" BORDERCOLOR="#00FFFF">'
 +'  <FRAME SRC="../Vide.html" NAME="Bas" SCROLLING="auto">'
 +'</FRAMESET>'
 +'</HTML>';
 
 Page_lien=window.open('','URL_Lien','resizable=yes,toolbar=yes,width=620,height=600,directories=yes,status=yes,location=yes,scrollbars=yes,menubar=yes,left=300,top=20');
 Page_lien.document.open ();
 Page_lien.document.write ( Index_Lien );
 
 var CorpusFL='<BODY>';
 
 if (Body!='')
 CorpusFL=Body;
 
 Couleurs_Bord='';
 if (CoulBord !='')
 Couleurs_Bord='BORDERCOLOR="' + CoulBord + '" BORDERCOLORLIGHT="' + CoulBord + '" BORDERCOLORDARK="' + CoulBord +'"';
 
 if (Ref_Site=='')
 {
  CorpusFL='<BODY BACKGROUND="../Images/Fond_Bleu.gif" BGCOLOR="#404080" TEXT="#FF0000" LINK="#4AFF6A" VLINK="#00EC06" ALINK="#C7FE47">';
  Ref='<B>Ce lien va être bientôt référencé, travail en cours...</B>';
 }
 else 
 Ref=Ref_Site;
 
 Page_lien.parent.Bas.document.clear();
 Page_lien.parent.Bas.document.close();
 Page_lien.parent.Bas.document.open();
 Page_lien.parent.Bas.document.writeln ('<HTML>\n');
 Page_lien.parent.Bas.document.writeln ( CorpusFL );
 Page_lien.parent.Bas.document.writeln ('\n<DIV ALIGN="Center">' );
 Page_lien.parent.Bas.document.writeln ('<TABLE ALIGN="Center" BORDER=1 '+ Couleurs_Bord + ' CELLSPACING="0" CELLPADDING="0" HEIGHT="100%" WIDTH="100%">' );
 Page_lien.parent.Bas.document.writeln (' <TR>' );
 Page_lien.parent.Bas.document.writeln ('  <TD ALIGN="Center">' );
 Page_lien.parent.Bas.document.writeln ('   <FONT FACE="Arial,Helvetica" SIZE="3">'+ Ref + '</FONT>');
 Page_lien.parent.Bas.document.writeln ('  </TD>' );
 Page_lien.parent.Bas.document.writeln (' </TR>'  );
 Page_lien.parent.Bas.document.writeln ('</TABLE>');
 Page_lien.parent.Bas.document.writeln ('</DIV>\n'  );
 Page_lien.parent.Bas.document.writeln ('</BODY>' );
 Page_lien.parent.Bas.document.write   ('</HTML>' );
 Page_lien.parent.Bas.document.close();
}


// 3 - Lien externe dans une fenêtre autonome 
function Fenetre_Lien_externe(Nom,URL_Lien)
{
 Page_lien_externe=window.open(URL_Lien,Nom,"resizable=yes,toolbar=yes,width=700,height=640,directories=yes,status=yes,location=yes,scrollbars=yes,menubar=yes,left=325,top=0");
 //parent.Droite.location.href=URL_Lien;
}

/* 4 - Liens internes avec un autre timbre, une série thématique ou d'émission */
/*         La variable No permet de choisir la petite vignette cliquable       */

var pt='';
var pt0='../Images/Timbre0.gif';
var pt1='../Images/Timbre1.gif';
var pt2='../Images/Timbre2.gif';
var pt3='../Images/Timbre3.gif';
var pt4='../Images/Timbre4.gif';
var pt5='../Images/Timbre5.gif';
var pt6='../Images/Timbre6.gif';

var Suffixe_fichier;
var Annee_Timbre='';
var Artiste_Timbre='';
var NoCeres_Timbre='';
var NoYT_Timbre='';
var Sous_titre_Timbre='';
var Commentaires_Timbre='';

/*======================== Début de la table des liens (obligatoire) ========================*/
function Debut_Table_Liens ()
{
//document.writeln ('<P>');
document.writeln ('<DIV ALIGN="Center">');
document.writeln ('<TABLE BORDER="0">');
}

/* Ligne de commentaire à insérer dans le tableau des liens */
function Ligne_commentaire(Ligne_comment)
{
document.writeln (' <TR>');
document.writeln ('  <TD COLSPAN="2" VALIGN="Middle" ALIGN="left">');
document.writeln ('   <FONT COLOR="#FFFF66" FACE="Arial" SIZE="2"><B><DIV STYLE="color:#FFFF66; font-family:Arial,Helvetica; font-size:12px; text-decoration:none;">'+Ligne_comment+'&nbsp;</DIV></B></FONT>');
document.writeln ('  </TD>');
document.writeln (' </TR>');
}

/* Lien vers un timbre avec indication du cadre d'affichage  : à Droite(Cadre=D) ou a Gauche (Cadre=G)*/
function Lien_timbre (Coul, Rep_timbre, Nom_timbre, Libelle_timbre, Cadre , No)
{
 var Cible='Gauche';
 if (Cadre!='G') Cible='Droite';
 if (No=='1') pt=pt1;
 if (No=='2') pt=pt2;
 if (No=='3') pt=pt3;
 if (No=='4') pt=pt4;
 if (No=='5') pt=pt5;
 if (No=='6') pt=pt6;
 
 var Parametres;
// Les variables Suffixe_fichier, Annee_Timbre, NoCeres_Timbre, NoYT_Timbre et Artiste_Timbre sont globales et définies plus haut, 
 
 document.writeln ('<TR>');

 if ((Suffixe_fichier=='.jpg')||(Suffixe_fichier=='.gif'))/* Lien vers un timbre n'ayant pas de fichier html, image jpg ou gif orpheline */
 {
  Parametres='Rep_Dep='+Rep_timbre+'&Nom_fichier_timbre='+Nom_timbre+Suffixe_fichier+'&Yvert_timbre='+NoYT_Timbre+'&Ceres_timbre='+NoCeres_Timbre+'&Titre_timbre='+Libelle_timbre+'&Annee_timbre='+Annee_Timbre+'&Sous_titre_timbre='+Sous_titre_Timbre+'&Comment_timbre='+Commentaires_Timbre+'&Artiste_timbre='+Artiste_Timbre;
  document.writeln (' <TD VALIGN="Middle" ALIGN="Right">');
  document.writeln ('  <A CLASS="Lien" HREF="../DO/Pseudo_Timbre.html?'+Parametres+'" TARGET="'+Cible+'" onMouseOver="document.images.'+Nom_timbre+'.src=\''+pt0+'\'; window.status=\''+Libelle_timbre+'\'; return true" onMouseOut="document.images.'+Nom_timbre+'.src=\''+pt+'\'; window.status=Titre; return true"><FONT COLOR="'+Coul+'" FACE="Arial" SIZE="2"><B><DIV STYLE="color:'+Coul+'; font-family:Arial,Helvetica; font-size:12px; text-decoration:none;">'+Libelle_timbre+'&nbsp;</DIV></B></FONT></A>');
  document.writeln (' </TD>');
  document.writeln (' <TD ALIGN="Center">');
  document.writeln ('  <A HREF="../DO/Pseudo_Timbre.html?'+Parametres+'" TARGET="'+Cible+'" onMouseOver="document.images.'+Nom_timbre+'.src=\''+pt0+'\'; window.status=\''+Libelle_timbre+'\'; return true" onMouseOut="document.images.'+Nom_timbre+'.src=\''+pt+'\'; window.status=Titre; return true">');
 }
 else /* Lien vers un timbre ayant un fichier html */
 {
  document.writeln (' <TD VALIGN="Middle" ALIGN="Right">'); /* Lien vers un timbre ayant un fichier html */
  document.writeln ('  <A CLASS="Lien" HREF="'+Rep_timbre+Nom_timbre+'.html" TARGET="'+Cible+'" onMouseOver="document.images.'+Nom_timbre+'.src=\''+pt0+'\'; window.status=\''+Libelle_timbre+'\'; return true" onMouseOut="document.images.'+Nom_timbre+'.src=\''+pt+'\'; window.status=Titre; return true"><FONT COLOR="'+Coul+'" FACE="Arial" SIZE="2"><B><DIV STYLE="color:'+Coul+'; font-family:Arial,Helvetica; font-size:12px; text-decoration:none;">'+Libelle_timbre+'&nbsp;</DIV></B></FONT></A>');
  document.writeln (' </TD>');
  document.writeln (' <TD ALIGN="Center">');
  document.writeln ('  <A HREF="'+Rep_timbre+Nom_timbre+'.html" TARGET="'+Cible+'" onMouseOver="document.images.'+Nom_timbre+'.src=\''+pt0+'\'; window.status=\''+Libelle_timbre+'\'; return true" onMouseOut="document.images.'+Nom_timbre+'.src=\''+pt+'\'; window.status=Titre; return true">');
 }
 document.writeln ('  <IMG SRC="'+pt+'" BORDER="0" WIDTH="13" HEIGHT="20" NAME="'+Nom_timbre+'" ALT="&nbsp;'+Libelle_timbre+Cliquez+'"></A>');
 document.writeln (' </TD>');
 document.writeln ('</TR>');
}
/* Lien vers un timbre  affiché à gauche */
function Lien_un_timbre (Rep_timbre, Nom_timbre, Libelle_timbre, No)
{
 Lien_timbre ('#A5D2FF', Rep_timbre, Nom_timbre, Libelle_timbre, 'G', No);
}

/* Lien vers un timbre d'autre type, peut être affiché à droite comme à gauche */
function Lien_autre_timbre (Rep_timbre, Nom_timbre, Libelle_timbre, Cadre, No)
{
 Lien_timbre ('#00C888', Rep_timbre, Nom_timbre, Libelle_timbre, Cadre , No);
}

/* Lien vers une série thématique de l'Ouest */
function Lien_un_theme (Rep_theme, Nom_theme, Libelle_theme, No)
{
 if (No=='1') pt=pt1;
 if (No=='2') pt=pt2;
 if (No=='3') pt=pt3;
 if (No=='4') pt=pt4;
 if (No=='5') pt=pt5;
 if (No=='6') pt=pt6;
 document.writeln (' <TR>'); 
 document.writeln ('  <TD VALIGN="Middle" ALIGN="Right">'); 
 document.writeln ('   <A CLASS="Lien" HREF="'+Rep_theme+Nom_theme+'.html" TARGET="Droite" onMouseOver="document.images.'+Nom_theme+'.src=\''+pt0+'\'; window.status=\''+Libelle_theme+'\'; return true" onMouseOut="document.images.'+Nom_theme+'.src=\''+pt+'\'; window.status=Titre; return true"><FONT COLOR="#FFFFFF" FACE="Arial" SIZE="2"><B><DIV STYLE="color:#FFFFFF; font-family:Arial,Helvetica; font-size:12px; text-decoration:none;">'+Libelle_theme+'&nbsp;</DIV></B></FONT></A>');
 document.writeln ('  </TD>');  
 document.writeln ('  <TD ALIGN="Center">'); 
 document.writeln ('   <A HREF="'+Rep_theme+Nom_theme+'.html" TARGET="Droite" onMouseOver="document.images.'+Nom_theme+'.src=\''+pt0+'\'; window.status=\''+Libelle_theme+'\'; return true" onMouseOut="document.images.'+Nom_theme+'.src=\''+pt+'\'; window.status=Titre; return true">');
 document.writeln ('   <IMG SRC="'+pt+'" BORDER="0" WIDTH="13" HEIGHT="20" NAME="'+Nom_theme+'" ALT="&nbsp;'+Libelle_theme+Cliquez+'"></A>');
 document.writeln ('  </TD>');
 document.writeln (' </TR>');
}

/* Lien vers une série de timbres ayant un lien (ou non) avec ceux de l'Ouest */
function Lien_une_serie (Rep_serie, Nom_serie, Libelle_serie, No)
{
 if (No=='1') pt=pt1;
 if (No=='2') pt=pt2;
 if (No=='3') pt=pt3;
 if (No=='4') pt=pt4;
 if (No=='5') pt=pt5;
 if (No=='6') pt=pt6;
 document.writeln (' <TR>');
 document.writeln ('  <TD VALIGN="Middle" ALIGN="Right">');
 document.writeln ('   <A CLASS="Lien" HREF="'+Rep_serie+Nom_serie+'.html" TARGET="Droite" onMouseOver="document.images.'+Nom_serie+'.src=\''+pt0+'\'; window.status=\''+Libelle_serie+'\'; return true" onMouseOut="document.images.'+Nom_serie+'.src=\''+pt+'\'; window.status=Titre; return true"><FONT COLOR="#00C888" FACE="Arial" SIZE="2"><B><DIV STYLE="color:#00C888; font-family:Arial,Helvetica; font-size:12px; text-decoration:none;">'+Libelle_serie+'&nbsp;</DIV></B></FONT></A>');
 document.writeln ('  </TD>');
 document.writeln ('  <TD ALIGN="Center">');
 document.writeln ('   <A HREF="'+Rep_serie+Nom_serie+'.html" TARGET="Droite" onMouseOver="document.images.'+Nom_serie+'.src=\''+pt0+'\'; window.status=\''+Libelle_serie+'\'; return true" onMouseOut="document.images.'+Nom_serie+'.src=\''+pt+'\'; window.status=Titre; return true">');
 document.writeln ('   <IMG SRC="'+pt+'" BORDER="0" WIDTH="13" HEIGHT="20" NAME="'+Nom_serie+'" ALT="&nbsp;'+Libelle_serie+Cliquez+'"></A>');
 document.writeln ('  </TD>');
 document.writeln (' </TR>');
}
/* Lien divers avec indication du cadre d'affichage: Cadre_Divers='D' ou 'G' */
function Lien_divers (Rep_divers, Nom_divers, Libelle_divers, Cadre_Divers, No )
{
 if (No=='1') pt=pt1;
 if (No=='2') pt=pt2;
 if (No=='3') pt=pt3;
 if (No=='4') pt=pt4;
 if (No=='5') pt=pt5;
 if (No=='6') pt=pt6;
 if (Cadre_Divers=='G') Cadre_Divers='Gauche';
 if (Cadre_Divers=='D') Cadre_Divers='Droite';
 
 document.writeln (' <TR>');
 document.writeln ('  <TD VALIGN="Middle" ALIGN="Right">');
 document.writeln ('   <A CLASS="Lien" HREF="'+Rep_divers+Nom_divers+'.html" TARGET="Droite" onMouseOver="document.images.'+Nom_divers+'.src=\''+pt0+'\'; window.status=\''+Libelle_divers+'\'; return true" onMouseOut="document.images.'+Nom_divers+'.src=\''+pt+'\'; window.status=Titre; return true"><FONT COLOR="#77E4AB" FACE="Arial" SIZE="2"><B><DIV STYLE="color:#77E4AB; font-family:Arial,Helvetica; font-size:12px; text-decoration:none;">'+Libelle_divers+'&nbsp;</DIV></B></FONT></A>');
 document.writeln ('  </TD>');
 document.writeln ('  <TD ALIGN="Center">');
 document.writeln ('   <A HREF="'+Rep_divers+Nom_divers+'.html" TARGET="'+Cadre_Divers+'" onMouseOver="document.images.'+Nom_divers+'.src=\''+pt0+'\'; window.status=\''+Libelle_divers+'\'; return true" onMouseOut="document.images.'+Nom_divers+'.src=\''+pt+'\'; window.status=Titre; return true">');
 document.writeln ('   <IMG SRC="'+pt+'" BORDER="0" WIDTH="13" HEIGHT="20" NAME="'+Nom_divers+'" ALT="&nbsp;'+Libelle_divers+Cliquez+'"></A>');
 document.writeln ('  </TD>');
 document.writeln (' </TR>');
}
/* Fin de la table des liens (obligatoire) */
function Fin_Table_Liens ()
{
 document.writeln ('</TABLE>');
 document.writeln ('</DIV>');
 //document.writeln ('</P>');
}
