/********************************************************************************/
/*                   PARAMETRES DE CONFIGURATION A RENSEIGNER                   */
/********************************************************************************/

/*------------------------------------------------------------------------------*/
/*                     parametres pour la popup d'impression                    */
/*                             fonction "impression()"                          */

var hRefSite="http://www.sg.cnrs.fr/drhchercheurs/concoursch/";
var urlStyles=hRefSite + "styles/styles.css";
var paramsPopup="toolbar=yes,location=no,scrollbars=yes,directories=,status=yes,menubar=yes,resizable=yes,width=700,height=600,left=0,top=0";
var url_espaceur_bas = hRefSite + "images/charte/popup/espaceur-bas.gif";
var url_espaceur_haut = hRefSite + "images/charte/popup/espaceur-haut.gif";
var url_img_centre_haut = hRefSite + "images/charte/popup/img-centre-haut.gif";
var url_img_droite_haut = hRefSite + "images/charte/popup/img-droite-haut.gif";
var url_img_titre = hRefSite + "images/charte/popup/img-titre.gif";
var url_logo_cnrs_bas = hRefSite + "images/charte/popup/logo-cnrs-bas.gif";
var url_logo_cnrs_haut = hRefSite + "images/charte/popup/logo-cnrs-haut.gif";
// images version anglaise
var url_img_droite_haut_en = hRefSite + "images/charte/popup-en/img-droite-haut.gif";
var url_img_titre_en = hRefSite + "images/charte/popup-en/img-titre.gif";


/*-------------   FIN DES PARAMETRES DE CONFIGURATION A RENSEIGNER   --------------*/


/*-----------------------------------------------------------------------------------------
fonction JS qui ouvre une popup et y ecrit un bandeau d'images puis le contenu de la page 
HTML qui l'appelle situe dans la balise DIV dont l'id est "ZonePrint"
------------------------------------------------------------------------------------------*/
function impression()
{

/*----- ouverture de la popup -----*/
win=window.open("about:blank", "print", paramsPopup);

win.document.open();

win.document.write('<html><head><title>Popup pour impression de fichier</title>');
win.document.write('<link rel="stylesheet" type="text/css" href="' + urlStyles + '">');

// ajouter ici si besoin est d'autres feuilles de styles ...

// insertion outils.js (notamment routine openBrWindow) dans la popup
win.document.write('<script language="JavaScript" src="' + hRefSite + 'z-outils/outils.js"></script>');

win.document.write('</head>');

win.document.write('<body marginheight="0" marginwidth="0" style="background-color:#FFFFFF;">');


/*----- affichage du bandeau d'images -----*/
// 2 images changent selon la version (francaise "-fr" ou anglaise "-en" de la page)

var url_page_courante = window.location.href;
var index_suf = url_page_courante.lastIndexOf('-en.');

win.document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%">');
win.document.write('<tr>');
win.document.write('<td width="150">');
win.document.write('<img border="0" src="' + url_logo_cnrs_haut + '" width="150" height="36"></td>');
win.document.write('<td width="200">');
win.document.write('<img border="0" src="' + url_img_centre_haut + '" width="200" height="36"></td>');
win.document.write('<td width="100%"><img border="0" src="' + url_espaceur_haut + '" width="100%" height="36"></td>');
win.document.write('<td width="122">');
win.document.write('<map name="FPMap0">');
win.document.write('<area href="javascript:window.close();" shape="rect" coords="6, 5, 117, 25">');
win.document.write('</map>');
if (index_suf > 0)
   win.document.write('<img border="0" src="' + url_img_droite_haut_en + '" usemap="#FPMap0" width="122" height="36"></td>');
else
   win.document.write('<img border="0" src="' + url_img_droite_haut + '" usemap="#FPMap0" width="122" height="36"></td>');
win.document.write('</tr>');
win.document.write('</table>');

win.document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%">');
win.document.write('<tr>');
win.document.write('<td width="150">');
win.document.write('<img border="0" src="' + url_logo_cnrs_bas + '" width="150" height="46"></td>');
win.document.write('<td width="100%"><img border="0" src="' + url_espaceur_bas + '" width="100%" height="46"></td>');
if (index_suf > 0)
   win.document.write('<td><img border="0" src="' + url_img_titre_en + '"></td>');
else
   win.document.write('<td><img border="0" src="' + url_img_titre + '"></td>');
win.document.write('</tr>');
win.document.write('</table>');

win.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
win.document.write('<tr>');
win.document.write('<td class="Xtextcourant" style="background-color:#FFFFFF;">');

/*-----    affichage de la zone contenue dans le layer "ZonePrint"     -----*/
/*----- (code dependant de la compatibilite du navigateur avec le DOM) -----*/

if (document.getElementById)  /* IE >= 5 / Netscape >= 6 / Mozilla >= 1.6 / Opera >= 7 */

  win.document.write(document.getElementById("ZonePrint").innerHTML);
	
else	/* Netscape 4 ou autre navigateur obsolete */ 
  {
    win.close();
    alert("Cette fonctionnalité ne marche pas avec cette version de navigateur.");
  }
  
win.document.write('</td></tr></table>');

// annulation de tous les liens internes contenus dans la popup (sauf le "fermer la fenetre")
win.document.write('<script>');
win.document.write('for (var i=0; i < document.links.length; i++) '); 
win.document.write('{ ');
win.document.write(' if ((document.links[i].href != "javascript:window.close();") && (document.links[i].target != "_blank") && (document.links[i].target != "_BLANK")) ');
win.document.write('   document.links[i].href="javascript:{}"; ');
win.document.write(' } ');
win.document.write('</script>');

win.document.write('</body></html>');

win.document.close();
}

/*-----------------------------------------------------------------------------------------
fonction JS qui ouvre une popup avec les parametres qu'on lui donne
------------------------------------------------------------------------------------------*/
function MM_openBrWindow(theURL,winName,features) 
{
  window.open(theURL,winName,features);
}

/*-----------------------------------------------------------------------------------------
fonctions JS qui permettent de permuter une page en version Francaise (-fr.xxx) en Anglaise 
(-en.xxx) et vice versa. le suffixe peut etre "htm", "html", "php", etc... ; il peut
egalement etre suivi d'une ancre (#xxx) pourvu qu'elle soit la meme dans les 2 versions
------------------------------------------------------------------------------------------*/
function change_version_fr_en()
{
 var url_page_courante = window.location.href;
 var index_suf = url_page_courante.lastIndexOf('-fr.');
 var url_new_page = url_page_courante.substring(0, index_suf);
 url_new_page = url_new_page + '-en.' + url_page_courante.substring(index_suf+4);
 window.document.location = url_new_page;
}

function change_version_en_fr()
{
 var url_page_courante = window.location.href;
 var index_suf = url_page_courante.lastIndexOf('-en.');
 var url_new_page = url_page_courante.substring(0, index_suf);
 url_new_page = url_new_page + '-fr.' + url_page_courante.substring(index_suf+4);
 window.document.location = url_new_page;
}
