/* Auteur: Pascal Bouchard */
/* Date de création: 20-09-02 */


/*POPPAGE
Ouvre une page (site ou photo) de taille pré-définie en pop-up
Source du script:
http://www.multimania.lycos.fr/webmaster/tips/988896993/	
*/
function poppage(page)
{
	var winTxt = "";
	winTxt = window.open(page,"poptxt","top=5,left=5,width=500,height=380,menubar=1,toolbar=0,directories=0,status=1,scrollbars=1,resizable=1");
}


/*POPPHOTO 100% AJUSTABLE
Ouvre une photo dans une page-fille virtuelle s'ajustant automatiquement
à la taille de la photo par un script intégré à la page-mère.
Source du script:
http://javascript.internet.com/page-details/auto-resizable-pop-up.html
Modifié par Pascal Bouchard
*/
function popphoto(img){
  photo1= new Image();
  photo1.src=(img);
  Controle(img);
}
function Controle(img){
  if((photo1.width!=0)&&(photo1.height!=0)){
    voirPhoto(img);
  }
  else{
    fonction="Controle('"+img+"')";
    intervale=setTimeout(fonction,20);
  }
}

function voirPhoto(img){
  largeur=photo1.width+30;
  hauteur=photo1.height+105;
  dimension="width="+largeur+",height="+hauteur;
  fenetre=window.open("","",dimension);
  texte = "<" + "HTML" + ">";
  texte += "<" + "TITLE" + ">" + "Mitan.ca - Images" + "<" + "/TITLE" + "><" + "BODY" + ">";
  texte += "<" + "CENTER" + "><" + "IMG SRC='"+img+"' BORDER=0" + ">";
  texte += "<" + "FORM" + "><" + "INPUT TYPE='BUTTON' VALUE='Fermer la fenêtre'" + " onClick='self.close()'" + ">";
  texte += "<" + "/FORM" + "><" + "span STYLE='color:#444444; font-family: arial; font-size:8pt;'" + ">" + "© Copyright 2002-2006 " + "<" + "a title='Envoyer un courriel'href='mailto:pascal@mitan.ca'" + ">" + "Pascal Bouchard" + "<" + "/a" + "><" + "br" + ">" + " Tous droits réservés " + "<" + "a title='Mitan.ca' href='http://www.mitan.ca'" + ">" + "Mitan.ca" + "<" + "/a" + "><" + "/span" + ">";
  texte += "<" + "/CENTER" + "><" + "/body" + "><" + "/HTML" + ">";
  fenetre.document.write(texte);
  fenetre.document.focus();
  fenetre.document.close();
}


/*AFFICHENOTE
Par un script intégré à la page-mère, ouvre une page-fille
pré-ajustée contenant 2 photos et un texte.
Source du script:
Modifié par Pascal Bouchard à partir de 
http://www.globetrotter.net/gt/usagers/ritchie/menugene.html
*/
var fenetreNote;
var fenetreNotePutX=1;
var fenetreNotePutY=1;
function afficheNote(titre, image1, image2, entete1, entete2, message, couleurFond, fond, couleurTexte, typePolice, tailleCaracteres) {
  fenetreNote = window.open('','Note','menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,' + 'width=845' + ',height=520');
  texte = '<' + 'HTML' + '><' + 'HEAD' + '><' + 'LINK href="http://www.mitan.ca/codes/mitan.css" rel="stylesheet"' + '><' + 'TITLE' + '>' + titre + '<' + '/TITLE' + '><' + '/HEAD' + '><' + 'BODY BACKGROUND=' + '"' + fond + '"' + ' BGCOLOR=' + '"' + couleurFond + '">';
  texte += '<' + 'TABLE' + '><' + 'TR' + '><' + 'TD VALIGN="top"' + '><' + 'CENTER' + '>';
  texte += '<' + 'img align="center" border="0" hspace="6" src="' + image1 + '"><' + 'br' + '>';
  texte += '<' + 'span class="copyright"' + '>' + '© Copyright 2002-2011 ' + '<' + 'a title="Envoyer un courriel" href="mailto:pascal@mitan.ca"' + '>' + 'Pascal Bouchard' + '<' + '/a' + '>' + ' Tous droits réservés ' + '<' + 'a title="Mitan.ca" href="http://www.mitan.ca"' + '>' + 'Mitan.ca' + '<' + '/a' + '><' + '/span' + '>';
  texte += '<' + 'TD VALIGN="top"' + '><' + 'CENTER' + '><' + 'img src="' + image2 + '"' + '><' + 'br' + '><' + 'br' + '>';
  texte += '<' + 'span STYLE="color:#9c2203; font-family: arial; font-size:10pt;"' + '><' + 'b' + '>' + entete1 + '<' + 'br' + '>';
  texte += '' + entete2 + '<' + '/b' + '' + '><' + '/span' + '><' + 'br' + '><' + 'HR width="90%" color="#0099CC" noshade size="1"' + '>';
  texte +='<' + 'span STYLE="font-family:' + typePolice + ';';
  texte += ' font-size:' + tailleCaracteres +  'pt;';
  texte += ' color:' + couleurTexte +';">';
  texte += message + '<' + '/span' + '><' + 'br' + '><' + 'HR width="90%" color="#0099CC" noshade size="1"' + '>';
  texte += '<' + 'FORM' + '><' + 'INPUT TYPE="BUTTON" VALUE="Fermer la fenêtre" onClick="self.close()"' + '><' + '/FORM' + '>';
  texte += '<' + '/CENTER' + '><' + '/TD' + '><' + '/TR' + '><' + '/TABLE' + '><' + '/BODY' + '><' + '/HTML' + '>';
  fenetreNote.moveTo(fenetreNotePutX,fenetreNotePutY);
  fenetreNote.document.write(texte);
  fenetreNote.focus();
  fenetreNote.document.close();
  return false;
}

/*POPNOTE
Un script, intégré à la page-mère, ouvre une page-fille virtuelle
contenant un gif ou une photo, une barre verticale et un texte sur
fond noir.
Source du script:
Modifié par Pascal Bouchard à partir de AFFICHENOTE et de 
http://www.globetrotter.net/gt/usagers/ritchie/menugene.html
*/
var fenetrePOP;
var fenetrePOPPutX=1;
var fenetrePOPPutY=1;

function popNote(titre, image1, image2, entete, message, couleurFond, fond, couleurColonne, couleurEntete, couleurTexte, typePolice, tailleCaracteres) {
  fenetrePOP = window.open('','Note','menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,' + 'width=640' + ',height=480');
  texte = '<' + 'HTML' + '><' + 'HEAD' + '><' + 'TITLE' + '>' + titre + '<' + '/TITLE' + '><' + '/HEAD' + '><' + 'BODY BACKGROUND=' + '"' + fond + '"' + ' BGCOLOR=' + '"' + couleurFond + '">';
  texte += '<' + 'TABLE cellSpacing=10 cellPadding=0 width=100% border=0 colspan="2"' +'>';
  texte += '<' + 'TBODY' +'><' + 'TR'+'><' +'TD vAlign=bottom width=12 bgColor="' + couleurColonne + '"' +'>';
  texte += '<' + 'IMG height=1 src="images/dot_blank.gif" width=12 height=1 border=0' +'><' + '/TD' +'>';
  texte += '<' + 'TD' +'><' + 'IMG src="' + image1 + '"' +'><' + 'IMG src="' + image2 + '"' +'>'+'&nbsp;&nbsp;&nbsp;';
  texte += '<' + 'font face="Verdana, Geneva, Arial, Helvetica" size=+1 color="' + couleurEntete + '"' + '>' + entete + '<' + '/font' +'><' + 'br' +'>';
  texte += '<' + 'span STYLE="font-family:' + typePolice + ';' + ' font-size:' + tailleCaracteres +  'pt;' + ' color:' + couleurTexte +';">';
  texte += '<'+ 'br' +'>' + message + '<' + 'br' +'><' + 'br' +'>';
  texte += '<' + 'span class="copyright"' + '>' + '© Copyright 2002-2011 ' + '<' + 'a title="Envoyer un courriel" href="mailto:pascal@mitan.ca"' + '>' + 'Pascal Bouchard' + '<' + '/a' + '>' + ' Tous droits réservés ' + '<' + 'a title="Mitan.ca" href="http://www.mitan.ca"' + '>' + 'Mitan.ca' + '<' + '/a' + '><' + '/span' + '>';
  texte += '<' + 'br' +'><' + '/TD' +'><' + '/TR' +'><' + '/TBODY' +'><' + '/TABLE' +'><' + '/BODY' + '><' + '/HTML' + '>';
  fenetrePOP.moveTo(fenetrePOPPutX,fenetrePOPPutY);
  fenetrePOP.document.write(texte);
  fenetrePOP.focus();
  fenetrePOP.document.close();
  return false;
}


/*POPPHOTOXL
Un script, intégré à la page-mère, ouvre une page-fille virtuelle
contenant un titre et un texte sur fond paramétrable au-dessus 
d'une ou 2 photos flanqué à gauche d'une barre verticale de
couleur. IDÉAL POUR LES GRANDES PHOTOS.
Source du script:
Modifié par Pascal Bouchard à partir de POPNOTE et de 
http://www.globetrotter.net/gt/usagers/ritchie/menugene.html
*/
var fenetrePOP;
var fenetrePOPPutX=1;
var fenetrePOPPutY=1;

function popPhotoXL(titre, image1, image2, entete, message, couleurFond, fond, couleurColonne, couleurEntete, couleurTexte, typePolice, tailleCaracteres) {
  fenetrePOP = window.open('','Note','menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,' + 'width=720' + ',height=540');
  texte = '<' + 'HTML' + '><' + 'HEAD' + '><' + 'TITLE' + '>' + titre + '<' + '/TITLE' + '><' + '/HEAD' + '><' + 'BODY BACKGROUND=' + '"' + fond + '"' + ' BGCOLOR=' + '"' + couleurFond + '">';
  texte += '<' + 'TABLE cellSpacing=10 cellPadding=0 width=100% border=0 colspan="2"' +'>';
  texte += '<' + 'TBODY' +'><' + 'TR'+'><' +'TD vAlign=bottom width=12 bgColor="' + couleurColonne + '"' +'>';
  texte += '<' + 'IMG height=1 src="images/dot_blank.gif" width=12 height=1 border=0' +'><' + '/TD' +'>';
   texte += '<' + 'TD' +'><' + 'font face="Verdana, Geneva, Arial, Helvetica" size=+1 color="' + couleurEntete + '"' + '>' + entete + '<' + '/font' +'><' + 'br' +'>';
  texte += '<' + 'span STYLE="font-family:' + typePolice + ';' + ' font-size:' + tailleCaracteres +  'pt;' + ' color:' + couleurTexte +';">';
  texte += '<'+ 'br' +'>' + message + '<' + 'br' +'><' + 'br' +'>';
  texte += '<' + 'IMG src="' + image1 + '"' +'><' + 'br' +'><' + 'IMG src="' + image2 + '"' +'>'+'&nbsp;&nbsp;&nbsp;';
   texte += '<'+ 'br' +'>';
 texte += '<' + 'span class="copyright"' + '>' + '© Copyright 2002-2011 ' + '<' + 'a title="Envoyer un courriel" href="mailto:pascal@mitan.ca"' + '>' + 'Pascal Bouchard' + '<' + '/a' + '>' + ' Tous droits réservés ' + '<' + 'a title="Mitan.ca" href="http://www.mitan.ca"' + '>' + 'Mitan.ca' + '<' + '/a' + '><' + '/span' + '>';
  texte += '<' + 'br' +'><' + 'br' +'><' + 'br' +'><' + '/TD' +'><' + '/TR' +'><' + '/TBODY' +'><' + '/TABLE' +'><' + '/BODY' + '><' + '/HTML' + '>';
  fenetrePOP.moveTo(fenetrePOPPutX,fenetrePOPPutY);
  fenetrePOP.document.write(texte);
  fenetrePOP.focus();
  fenetrePOP.document.close();
  return false;
}


/*BORDERIT
Met une bordure autour d'une photo au passage du curseur
Source du script:
Highlight Image Script II- © Dynamic Drive (www.dynamicdrive.com)
*/
function borderit(which,color){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
which.style.borderColor=color;
}
}


/*TABLEAU
Affiche la date sous cette forme: 13 février 2003
Source du script:
http://www.multimania.lycos.fr/webmaster/tips/983377679/
*/
function Tableau(n) { 
this.length=n; 
return this; } 
function DateModif() { 
NomMois=new Tableau(12); 
NomMois[1]="janvier";
NomMois[2]="février"; 
NomMois[3]="mars"; 
NomMois[4]="avril"; 
NomMois[5]="mai"; 
NomMois[6]="juin"; 
NomMois[7]="juillet"; 
NomMois[8]="août";
NomMois[9]="septembre"; 
NomMois[10]="octobre"; 
NomMois[11]="novembre"; 
NomMois[12]="décembre";
Date=new Date(document.lastModified); 
var Mois=NomMois[Date.getMonth()+1]; 
var Annee=Date.getFullYear();
return Date.getDate()+" "+Mois+" "+Annee; 
}
		

