/*
'---
'--- framing.js - Page d'élément de framing en Javascript
'---
'--- Par Sacha Vincent
'---     www.sachavincent.com
'---
'--- RÉVISION
'--- 2008/02/26 -SJV	Création
'--- 2008/11/28 -SJV	Refonte du framing
'--- 2009/02/04 -SJV	Modification pour les images en anglais


*/

// Configuration des liens sur les logos
// Nom français, Nom anglais, lien français, liens anglais
var LienLogo0 = new Array("CER Montréal", "CER Montreal", "", "");
var LienLogo1 = new Array("Université des Nations Unies", "United Nations University", "http://www.ias.unu.edu/sub_page.aspx?catID=108&ddlID=183", "http://www.ias.unu.edu/sub_page.aspx?catID=108&ddlID=183");
var LienLogo2 = new Array("Ville de Montréal", "Montreal City", "http://ville.montreal.qc.ca/portal/page?_pageid=736,4731559&_dad=portal&_schema=PORTAL", "http://ville.montreal.qc.ca/portal/page?_pageid=4176,4738953&_dad=portal&_schema=PORTAL");
var LienLogo3 = new Array("ICI", "ICI", "http://www.unites.uqam.ca/devsav/ici/fr.htm", "http://www.unites.uqam.ca/devsav/ici/eng.htm");
var LienLogo4 = new Array("Biosphère", "Biosphere", "http://www.biosphere.ec.gc.ca/Accueil-WS3C2E8507-1_Fr.htm", "http://www.biosphere.ec.gc.ca/default.asp?lang=En&n=3C2E8507-1");

var NomPage = GetPageName(); 
var Section = GetLinkSectionName();  

//------------------------------------------------------------------------------------------------------------------------------------------------------- 
//-------------- Les menus
var ArrayMenu = new Array();
// Le premier élément n'est qu'à titre d'exemple
ArrayMenu[ArrayMenu.length] = new Array("Nom section", "Section français", "Section anglaise", "lien"); 

//-------------- Les sous-sections de menu   
var ArraySousMenu = new Array();
// Le premier élément n'est qu'à titre d'exemple
ArraySousMenu[ArraySousMenu.length] = new Array("Nom section", "Nom sous-section", "Sous-section français", "Sous-section anglaise", "lien"); 
    
//-------------- Les sous-sous-sections de menu
var ArraySousSousMenu = new Array();
// Le premier élément n'est qu'à titre d'exemple
ArraySousSousMenu[ArraySousSousMenu.length] = new Array("Nom section", "Nom sous-section", "Sous-section français", "Sous-section anglaise", "lien"); 
//-------------------------------------------------------------------------------------------------------------------------------------------------------


//------------------------------------------------------------------------------------------------------------------------------------------------------- 
//-------------- Les éléments du menu (3 niveaux)

// Accueil
ArrayMenu[ArrayMenu.length] = new Array("accueil", "Accueil", "Home", "accueil_fr.html", "accueil_en.html");

// Écocitoyenneté
ArrayMenu[ArrayMenu.length] = new Array("ecocitoyennete", "Écocitoyenneté", "Eco-citizen", "ecocitoyennete_fr.html", "ecocitoyennete_en.html");

// Particularités
ArrayMenu[ArrayMenu.length] = new Array("particularites", "Particularités", "Specifies", "chef_file_fr.html", "chef_file_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("particularites", "chef_file", "Chef de file de la francophonie", "Leader of french-speaking countries", "chef_file_fr.html", "chef_file_en.html");
                        ArraySousMenu[ArraySousMenu.length] = new Array("particularites", "territoire_riche", "Territoire riche en attraits naturels", "A region full of natural attractions", "territoire_riche_fr.html", "territoire_riche_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("particularites", "plus_50_partenaires", "Plus de 50 partenaires", "Over 50 partners", "plus_50_partenaires_fr.html", "plus_50_partenaires_en.html");
                
// Raison d'être
ArrayMenu[ArrayMenu.length] = new Array("raison", "Raison d'être", "Rationale", "mission_fr.html", "mission_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("raison", "mission", "Mission", "Mission", "mission_fr.html", "mission_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("raison", "concept", "Concept", "Concept", "concept_fr.html", "concept_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("raison", "objectifs", "Objectifs", "Objectives", "objectifs_fr.html", "objectifs_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("raison", "vision", "Vision", "Vision", "vision_fr.html", "vision_en.html");

// Origines
ArrayMenu[ArrayMenu.length] = new Array("origines", "Origines", "Premises", "premisses_fr.html", "premisses_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("origines", "premisses", "Prémisses", "Premises", "premisses_fr.html", "premisses_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("origines", "processus_elaboration", "Processus d'élaboration", "Development process", "processus_elaboration_fr.html", "processus_elaboration_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("origines", "acceptation_candidature", "Acceptation de la candidature", "Approval of the nomination", "acceptation_candidature_fr.html", "acceptation_candidature_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("origines", "mise_oeuvre", "Mise en œuvre", "Implementation", "mise_oeuvre_fr.html", "mise_oeuvre_en.html");                                                                                   

// Partenaires	        
ArrayMenu[ArrayMenu.length] = new Array("partenaires", "Partenaires", "Partners", "collectivite_montrealaise_fr.html", "collectivite_montrealaise_en.html"); 
        ArraySousMenu[ArraySousMenu.length] = new Array("partenaires", "collectivite_montrealaise", "Collectivité montréalaise", "Montreal community", "collectivite_montrealaise_fr.html", "collectivite_montrealaise_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("partenaires", "reseau_universites_quebec", "Corporation-réseau interuniversitaire", "Network of Quebec universities", "reseau_universites_quebec_fr.html", "reseau_universites_quebec_en.html");

// Projects
ArrayMenu[ArrayMenu.length] = new Array("projets", "Projets", "Projects", "projets_fr.html", "projets_en.html");             

// Organisation
ArrayMenu[ArrayMenu.length] = new Array("organisation", "Organisation", "Organization", "organigramme_fr.html", "organigramme_en.html"); 
        ArraySousMenu[ArraySousMenu.length] = new Array("organisation", "organigramme", "Organigramme", "Organizational Chart", "organigramme_fr.html", "organigramme_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("organisation", "gouvernance", "Gouvernance", "Governance", "gouvernance_fr.html", "gouvernance_en.html"); 

// Pour en savoir plus            
ArrayMenu[ArrayMenu.length] = new Array("plus", "Pour en savoir plus", "To know more", "bibliotheque_fr.html", "bibliotheque_en.html"); 
        ArraySousMenu[ArraySousMenu.length] = new Array("plus", "bibliotheque", "Bibliothèque", "Library", "bibliotheque_fr.html", "bibliotheque_en.html");
        ArraySousMenu[ArraySousMenu.length] = new Array("plus", "lexique", "Lexique", "Lexicon", "lexique_fr.html", "lexique_en.html"); 

// Contactez-nous                 
ArrayMenu[ArrayMenu.length] = new Array("contact", "Contactez-nous", "Contact us", "contact_fr.html", "contact_en.html"); 


function AfficherMenu()                 
{
    var Menu = "";       
                                        
    var SplitMenu = Math.round((ArrayMenu.length) / 2);
    
    Menu = '<table width="828" border="0" cellpadding="0" cellspacing="0" style="margin-left:0px; margin-right:0px; margin-bottom:0px; margin-top:0px">'; 
        Menu +='<tr>';
            Menu +='<td width="477" valign="top">'; 
            Menu += '&nbsp;'
            Menu +='</td>';
            Menu +='<td width="160"  valign="top">';
            
                Menu += '<table width="100%" border="0" cellpadding="1" cellspacing="0" style="margin-left:0px; margin-right:0px; margin-bottom:0px; margin-top:0px">'; 
                    for(i = 1; i < SplitMenu; i++)
                    {   
                        Menu +='<tr>'; 
                        
                        var pointeur = LangJS(1,2);
                        var pointeur2 = LangJS(3,4);                                                          
                           
                        if(GetLinkPageName(ArrayMenu[i][pointeur2]) == NomPage || Section == ArrayMenu[i][0]) 
                        {
                            Menu +='<td valign="middle" align="left" style="padding-right:5px"><a class="liens_menu_over" href="../' + ArrayMenu[i][0] + "/" + ArrayMenu[i][pointeur2] + '" title="' + ArrayMenu[i][pointeur] + '">' + ArrayMenu[i][pointeur] + '</a></td>';
                            Menu +='<td valign="bottom" align="left" width="15" style="padding-bottom:2px"><img src="../../images/pix.gif" border="0" width="5" height="8" alt="" /></td>'; 
                        }
                        else
                        {
                            Menu +='<td valign="middle" align="left" style="padding-right:5px"><a class="liens_menu" href="../' + ArrayMenu[i][0] + "/" + ArrayMenu[i][pointeur2] + '" title="' + ArrayMenu[i][pointeur] + '">' + ArrayMenu[i][pointeur] + '</a></td>';
                            Menu +='<td valign="bottom" align="left" width="15" style="padding-bottom:2px"><img src="../../images/pix.gif" border="0" width="5" height="8" alt="" /></td>'; 
                        }           
                            
                        Menu +='</tr>';
                    }
            
                Menu +='</table>';          
            
            Menu +='</td>';
            Menu +='<td width="191" valign="top">';
            
                Menu += '<table width="100%" border="0" cellpadding="1" cellspacing="0" style="margin-left:0px; margin-right:0px; margin-bottom:0px; margin-top:0px">'; 
                    for(i = SplitMenu; i < ArrayMenu.length; i++)
                    {   
                        Menu +='<tr>'; 
                        
                        var pointeur = LangJS(1,2);
                        var pointeur2 = LangJS(3,4);      
                            
                        if(GetLinkPageName(ArrayMenu[i][pointeur2]) == NomPage || Section == ArrayMenu[i][0]) 
                        {   
                            Menu +='<td valign="middle" align="left" style="padding-right:5px"><a class="liens_menu_over" href="../' + ArrayMenu[i][0] + "/" + ArrayMenu[i][pointeur2] + '" title="' + ArrayMenu[i][pointeur] + '">' + ArrayMenu[i][pointeur] + '</a></td>';
                            Menu +='<td valign="bottom" align="left" width="15" style="padding-bottom:2px"><img src="../../images/pix.gif" border="0" width="5" height="8" alt="" /></td>'; 
                        }
                        else
                        {
                            Menu +='<td valign="middle" align="left" style="padding-right:5px"><a class="liens_menu" href="../' + ArrayMenu[i][0] + "/" + ArrayMenu[i][pointeur2] + '" title="' + ArrayMenu[i][pointeur] + '">' + ArrayMenu[i][pointeur] + '</a></td>';
                            Menu +='<td valign="bottom" align="left" width="15" style="padding-bottom:2px"><img src="../../images/pix.gif" border="0" width="5" height="8" alt="" /></td>'; 
                        }           
                            
                        Menu +='</tr>';
                    }
            
                Menu +='</table>';
                
            Menu +='</td>';
        Menu +='<tr>';
    Menu +='</table>';
    
    document.write(Menu);  
              
}   


function AfficherSousMenu()                                  
{
    var SousMenu = "";   
    var SousSousMenu = ""; 
    var NomSousSection = "";
    
    var pointeur = LangJS(2,3);
    var pointeur2 = LangJS(4,5); 
    
    for(i = 1; i < ArraySousMenu.length; i++)
    { 
        if(ArraySousMenu[i][pointeur2] == NomPage)
            NomSousSection = ArraySousMenu[i][1]; 
    }
    
    for(i = 1; i < ArraySousSousMenu.length; i++)
    { 
        if(ArraySousSousMenu[i][pointeur2] == NomPage)
            NomSousSection = ArraySousSousMenu[i][1]; 
    } 
    
    
    for(i = 1; i < ArraySousMenu.length; i++)
    {   
        if(Section == ArraySousMenu[i][0])
        {
            SousMenu +='<tr>'; 
                
            if(ArraySousMenu[i][pointeur2] == NomPage || NomSousSection == ArraySousMenu[i][1]) 
            {   
                SousMenu +='<td valign="middle" align="right" style="padding-right:5px"><a class="liens_sousmenu_over" href="../' + ArraySousMenu[i][0] + "/" + ArraySousMenu[i][pointeur2] + '" title="' + ArraySousMenu[i][pointeur] + '">' + ArraySousMenu[i][pointeur] + '</a></td>';                
               
                for(j = 1; j < ArraySousSousMenu.length; j++)
                {   
                    if(NomSousSection == ArraySousSousMenu[j][1])
                    {
                        SousSousMenu +='<tr>'; 
                        
                        var pointeur = LangJS(2,3);
                        var pointeur2 = LangJS(4,5);      
                            
                        if(ArraySousSousMenu[j][pointeur2] == NomPage) 
                        {
                            SousSousMenu +='<td valign="middle" align="right" style="padding-right:5px"><a class="liens_sousmenu2_over" href="../' + ArraySousSousMenu[j][0] + "/" + ArraySousSousMenu[j][pointeur2] + '" title="' + ArraySousSousMenu[j][pointeur] + '">' + ArraySousSousMenu[j][pointeur] + '</a></td>';                            
                        }
                        else
                        {
                            SousSousMenu +='<td valign="middle" align="right" style="padding-right:5px"><a class="liens_sousmenu2" href="../' + ArraySousSousMenu[j][0] + "/" + ArraySousSousMenu[j][pointeur2] + '" title="' + ArraySousSousMenu[j][pointeur] + '">' + ArraySousSousMenu[j][pointeur] + '</a></td>';                            
                        }           
                            
                        SousSousMenu +='</tr>';
                    }
                }
            
                NomSousSection = "";
            }
            else
            {
                SousMenu +='<td valign="middle" align="right" style="padding-right:5px"><a class="liens_sousmenu" href="../' + ArraySousMenu[i][0] + "/" + ArraySousMenu[i][pointeur2] + '" title="' + ArraySousMenu[i][pointeur] + '">' + ArraySousMenu[i][pointeur] + '</a></td>';                
            }      
                
            SousMenu +='</tr>';
            
            if(SousSousMenu != "")
                SousMenu += SousSousMenu;
                
            SousSousMenu = "";
                
            
        }
    }
    
    if(SousMenu != "")
    {
        SousMenu = '<div style="height:115px;"><table width="100%" border="0" cellpadding="1" cellspacing="0" style="margin-bottom:20px; background-image:url(../../images/fond_sous_menu.jpg); background-repeat: repeat-y; background-position: top right">' + SousMenu + '</table></div>';         
        
        document.write(SousMenu); 
    }
        
}

function AfficherBasPage(iLien, iCopy)
{      
    var MenuBas = "";      
    
    MenuBas +='<table border="0" cellpadding="0" cellspacing="0">';
        MenuBas +='<tr>';
            MenuBas +='<td width="828" height="32" align="center" valign="middle" colspan="2">';
            
            if(iLien == true)
            {
                MenuBas +='<p class="liens_menu_bas">'; 
          
                for(i = 1; i < ArrayMenu.length; i++)
                {           
                    var pointeur = LangJS(1,2);
                    var pointeur2 = LangJS(3,4);  
                      
                    MenuBas +='<a class="liens_menu_bas" href="../' + ArrayMenu[i][0] + "/" + ArrayMenu[i][pointeur2] + '">' + ArrayMenu[i][pointeur] + '</a>';
                    
                    //if(i < (ArrayMenu.length-1))
                        MenuBas +='&nbsp;|&nbsp;'; 
                }
                
                MenuBas +='<a class="liens_menu_bas" href="../../' + LangJS("en/", "fr/") + Section + "/" + g_AutrePage + '">' + LangJS("English", "Français") + '</a>';
    
                MenuBas +='</p>';
            }
            else
                MenuBas +='&nbsp;';
            
            MenuBas +='</td>';
        MenuBas +='</tr>';                           
        MenuBas +='<tr>';
            MenuBas +='<td align="center" width="428" valign="bottom" rowspan="3">';
            
                MenuBas += '<table border="0" cellpadding="0" cellspacing="0">';
                    MenuBas += '<tr>';                        
                        MenuBas += '<td valign="bottom">';                            
                            MenuBas += '<a href="' +  LangJS(LienLogo2[2], LienLogo2[3]) + '" target="_blank">';
                                MenuBas += '<img src="../../images/logo/' + LangJS("montreal", "montreal_en") + '.jpg" border="0" width="130" height="49" alt="' +  LangJS(LienLogo2[0], LienLogo2[1]) + '" title="' +  LangJS(LienLogo2[0], LienLogo2[1]) + '" />';
                            MenuBas += '</a>';
                        MenuBas += '</td>';
                        MenuBas += '<td valign="bottom">';        
                            MenuBas += '<a href="' +  LangJS(LienLogo3[2], LienLogo3[3]) + '" target="_blank">';
                                MenuBas += '<img src="../../images/logo/' + LangJS("ici", "ici_en") + '.jpg" border="0" width="86" height="68" alt="' +  LangJS(LienLogo3[0], LienLogo3[1]) + '" title="' +  LangJS(LienLogo3[0], LienLogo3[1]) + '" />';
                            MenuBas += '</a>';
                        MenuBas += '</td>';
                        MenuBas += '<td valign="bottom">';      
                            MenuBas += '<a href="' +  LangJS(LienLogo4[2], LienLogo4[3]) + '" target="_blank">';
                                MenuBas += '<img src="../../images/logo/' + LangJS("biosphere", "biosphere_en") + '.jpg" border="0"  width="146" height="41" alt="' +  LangJS(LienLogo4[0], LienLogo4[1]) + '" title="' +  LangJS(LienLogo4[0], LienLogo4[1]) + '" />';
                            MenuBas += '</a>';
                        MenuBas += '</td>';
                    MenuBas += '</tr>';
                MenuBas += '</table>';    
                   
            MenuBas +='</td>';
            MenuBas +='<td height="5" align="left" width="390" valign="middle">';
                MenuBas +='<hr style="width:375px; border:1px solid #d8d9c6; margin:0px">';            
            MenuBas +='</td>';
        MenuBas +='</tr>';
        MenuBas +='<tr>';
            MenuBas +='<td height="55" align="left" valign="top">';
            if(iCopy == true)
            {
                MenuBas +='<div style="width:390px; margin-top:5px"><h4 class="liens_menu_bas">';
                    MenuBas +='© 2008, CER-Montréal - ' + LangJS("Tous droits réservés", "All rights reserved") + ' | <a class="liens_menu_bas" href="http://www.isocell.ca/" target="_blank">' + LangJS("Une réalisation de Isocell", "A Isocell Realization.") + '</a>'; 
                MenuBas +='</div></h4>';
            }
            else
                MenuBas +='&nbsp;';  
                
            MenuBas +='</td>';         
        MenuBas +='</tr>';        
    MenuBas +='</table>';     
    
    document.write(MenuBas);    
    
}

function AfficherEntete()                 
{
    var AfficherEntete = "";
    
    AfficherEntete += '<table border="0" width="828" cellpadding="0" cellspacing="0">';
        AfficherEntete += '<tr>';
            AfficherEntete += '<td valign="middle" align="left" width="228" height="104">';
                AfficherEntete += AfficherLang();
            AfficherEntete += '</td>'; 
            AfficherEntete += '<td valign="top" align="right" width="600" height="104" style="padding-right:10px">';
                AfficherEntete += '<table border="0" cellpadding="0" cellspacing="0">';
                    AfficherEntete += '<tr>';                        
                        AfficherEntete += '<td valign="bottom" height="70">';                            
                            AfficherEntete += '<img src="../../images/logo/' + LangJS("cer", "cer_en") + '.jpg" border="0" width="304" height="38" border="0" alt="' +  LangJS(LienLogo0[0], LienLogo0[1]) + '" title="' +  LangJS(LienLogo0[0], LienLogo0[1]) + '" />';                                                
                        AfficherEntete += '</td>';
                        AfficherEntete += '<td valign="bottom">';                            
                            AfficherEntete += '<a href="' +  LangJS(LienLogo1[2], LienLogo1[3]) + '" target="_blank">';
                                AfficherEntete += '<img src="../../images/logo/' + LangJS("uni_nat_unies", "uni_nat_unies_en") + '.jpg" border="0" width="170" height="60" alt="' +  LangJS(LienLogo1[0], LienLogo1[1]) + '" title="' +  LangJS(LienLogo1[0], LienLogo1[1]) + '" />';
                            AfficherEntete += '</a>';
                        AfficherEntete += '</td>';
                    AfficherEntete += '</tr>';
                AfficherEntete += '</table>';       
            AfficherEntete += '</td>';
        AfficherEntete += '</tr>';
    AfficherEntete += '</table>';    
    
    document.write(AfficherEntete);  
        
}


function AfficherLang()                 
{
    var Language = "";      
                                                                
    Language = '<div align="left" style="text-align:left; margin-left:35px; margin-right:0px; margin-bottom:0px; margin-top:0px">'; 
        Language += '<a class="liens_menu" href="../../' + LangJS("en/", "fr/") + Section + "/" + g_AutrePage + '" title="' + LangJS("English", "Français") + '">' + LangJS("ENGLISH", "FRANÇAIS") + '</a>';                    
    Language +='</div>';
    
    //document.write(Language);  
    return Language;
        
}
