﻿
/* PiedPage() insertion via une fonction javascripte pour éviter de répéter le pied de page sur chaque pages ( compense la perte de l'inclusion de php)*/
/* cette fonction comprend le "petit menu", le copyright et l'information de mise à jour */
function PiedPage()
{   
document.write( '<table class=\"tablepiedpage\">'   );
document.write(     '<tr><td><a href=\"../index.htm\" >Accueil</a></td><th>~~</th>'                );
document.write(         '<td><a href=\"../imprimantes3d/imprimantes3d.htm\" >Imprimantes 3D</a></td><th>~~</th>'   );
document.write(         '<td><a href=\"../materiaux/materiaux.htm\" >Matériaux</a></td><th>~~</th>'              );
document.write(         '<td><a href=\"../applications/applications.htm\" >Applications</a></td><th>~~</th>'           );      
document.write(         '<td><a href=\"../contacts/contacts.php\" >Contacts</a></td><th>~~</th>'          );        
document.write(         '<td><a href=\"../plan.htm\" >Plan du site</a></td></tr>'                );
document.write( '</table>'                          );
document.write( '© 2008 MG2 Systems.&nbsp;'         );
/*document.write( '<script type=\"text/javascript\" language=\"javascript\">FormatageDate(document.lastModified);</script>'  ); */            
}

/* FormatageDate() sert à calculer  et afficher la date de dernière mise à jour */
function FormatageDate (DateModif)
{   TabMois=new Array ("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");
    var Ladate=new Date(DateModif);
    document.write('Dernière mise à jour le '+Ladate.getDate()+ ' '+TabMois[Ladate.getMonth()]+' '+Ladate.getFullYear() );
}
/*****-----------------------------------****/

/* EntetePage()même remarque que pour PiedPage ( éviter de tout changer sur chaque page si modif )*/
function EntetePage()
{
document.write(     '<span class=\"mg2color\">MG2</span><span class=\"sytemscolor\">&nbsp;Systems</span>'     );
document.write(     '<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'                        );
document.write(     'Distributeur officiel du constructeur&nbsp;'                                               );
document.write(     '<a href=\"http://www.2objet.com/\"  target=\"_blank\"><b>Objet</b></a>.'                 );
}

/* newMini() est une fonction utilisée pour le diaporama uniquement    
 sources :
http://tecfa.unige.ch/themes/FAQ-FL/diaporama_javascript/diaporama_javascr-tech.html */    
        
thisImg = 1
imgCt = 14  // nombre d'images mini pour faire au plus simple
function newMini(direction)
{   if (document.images)
    {   thisImg = thisImg + direction
            if (thisImg < 1) { thisImg = imgCt }
                if (thisImg > imgCt) { thisImg=1 }
    document.miniature.src = "images/imagesDiapo/mini" + thisImg + ".jpg"
    }
}
/*****-----------------------------------****/

/* AppelPOP() adapte une fenetre popup au forma de l'image du diaporama ( cf tp15 ) */
/* ici spécifique au diaporama à cause des préfixes mini et maxi */
function AppelPOP(mon_URL,titre,mon_image)
{
    var urlImg="images/imagesDiapo/maxi" + thisImg + ".jpg";    
    var fenetrepop=window.open(mon_URL,titre,'resizable=yes,toolbar=no,location=no');
    fenetrepop.document.write(      '<html><head><title>'+titre+'</title>'  );
    fenetrepop.document.write(      "</head><body>"                         );
    fenetrepop.document.write(      '<a ><img src=\"'+urlImg+'\" alt=\"'+thisImg+'\" /></a>');
   /* fenetrepop.resizeTo(fenetrepop.document.images[0].width+30,fenetrepop.document.images[0].height+105);*/
    fenetrepop.document.write(      "</body></html>"                        ); 
}

/*****-----------------------------------****/

/* AppelPOPdétail() adapte une fenetre popup au forma de l'image */
/*  cette fois si plus général*/
function AppelPOPdétail(mon_URL,titre,mon_image)
{
        var fenetrepop=window.open(mon_URL,titre,'resizable=yes,toolbar=no,location=no'); 
        fenetrepop.document.write(      '<html><head><title>'+titre+'</title>'  );
        fenetrepop.document.write(      "</head><body>"                         );
        fenetrepop.document.write(      '<a ><img src=\"'+mon_image+'\" alt=\"'+titre+'\" /></a>');
        /*fenetrepop.window.resizeTo(fenetrepop.document.images[0].width+30,fenetrepop.document.images[0].height+105);*/
        fenetrepop.document.write(      "</body></html>"                        );

}

/*****-----------------------------------****/


   