
/********************************************************************************/
/*                   PARAMETRES DE CONFIGURATION A RENSEIGNER                   */
/********************************************************************************/

/*------------------------------------------------------------------------------*/
/*                     parametres pour la popup d'impression                    */
/*                             fonction "impression()"                          */

var urlStyles1=hRefSite+"z-outils/styles/styles.css";
var urlStyles2=hRefSite+"z-outils/styles/xcharte.css";
var urlStyles3=hRefSite+"z-outils/styles/une.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 + "z-outils/images/charte/popup-impression/espaceur-bas.gif";
var url_espaceur_haut = hRefSite + "z-outils/images/charte/popup-impression/espaceur-haut.gif";
var url_img_centre_haut = hRefSite + "z-outils/images/charte/popup-impression/img-centre-haut.gif";
var url_img_droite_haut = hRefSite + "z-outils/images/charte/popup-impression/img-droite-haut.gif";
var url_img_titre = hRefSite + "z-outils/images/charte/popup-impression/img-titre.gif";
var url_logo_cnrs_bas = hRefSite + "z-outils/images/charte/popup-impression/logo-cnrs-bas.gif";
var url_logo_cnrs_haut = hRefSite + "z-outils/images/charte/popup-impression/logo-cnrs-haut.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>CNRS - Direction des systèmes d information - </title>');
win.document.write('<link rel="stylesheet" type="text/css" href="' + urlStyles1 + '">');
win.document.write('<link rel="stylesheet" type="text/css" href="' + urlStyles2 + '">');
win.document.write('<link rel="stylesheet" type="text/css" href="' + urlStyles3 + '">');
// ajouter ici si besoin est d'autres feuilles de styles ...

/* style pour l'impression : fond blanc */

win.document.write('</head>');

win.document.write('<body marginheight="0" marginwidth="0" style="background-color:#FFFFFF";>');

win.document.write('<table cellspacing="0" cellpadding="0" width="100%" class="table-avec-bordures" >');
win.document.write('<tr>');
win.document.write('<td>');
/*----- affichage du bandeau d'images -----*/
win.document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%" class="table-sans-bordures">');
win.document.write('<tr>');
win.document.write('<td width="150">');
win.document.write('<img border="0" src="' + url_logo_cnrs_haut + '" height="36"></td>');
win.document.write('<td width="200">');
win.document.write('<img border="0" src="' + url_img_centre_haut + '" 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>');
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%" class="table-sans-bordures">');
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>');
win.document.write('<td width="360"><img border="0" src="' + url_img_titre + '" height="46"></td>');
win.document.write('</tr>');
win.document.write('</table>');



win.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-sans-bordures">');
win.document.write('<tr>');
win.document.write('<td ><div class="ZonePrint" 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('</div></td></tr></table>');
win.document.write('</td></tr></table>');
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);
}

/*-------------   Fonction writemail pour éviter les spam   --------------
fonction JS qui ‚vite le spam en codant les emails.
4 parametres :
  hostname : le nom du domaine (exemple : "cnrs.fr" si le mail est "contact@cnrs.fr")
  username : le nom du user (exemple : "contact" si le mail est "contact@cnrs.fr")
  linktext : si "" (=pas renseigné, le mail est affiché 'contact@cnrs.fr')
             si renseigné : exemple "ecrivez-nous", 
							alors le lien affichera ce texte et pointera vers le mail spécifié.
  mode : 0 si c'est pour intégrer dans une partie HTML (le script écrit toute la balise du <a au </a>, 
		 1 si c'est pour l'intégrer dans une map (href="#" onClick="javascript:writemail(..,.,..,1);" )
		 
------------------------------------------------------------------------------------------*/
function writemail(hostname,username,linktext,mode) {
  if (hostname.length > 0) {
	  mail_to="mail" + "to:" + username + "@" + hostname;
	  if (mode==0) {  
		  (linktext.length > 0)?document.write("<a href=" + mail_to + ">" + linktext + "</a>"):document.write("<a href=" +  mail_to + ">" + username + ""+"@" + hostname +"" + "</a>"); 
	  }
	  else { document.location.replace(mail_to); }
  }
}
