/*--------------------*/
/* Variables globales */
/*--------------------*/
var str_nav = navigator.appName;
var boo_ie = (str_nav == 'Microsoft Internet Explorer') ? 1:0;
var boo_ns = (str_nav == 'Netscape') ? 1:0;

var int_racine = 0;
var int_icone = 0;

var int_menu_ir = 1;
var int_menu_pr = 2;
var int_menu_work = 3;
var int_menu_news = 4;
var int_menu_partner = 5;
var int_menu_expert = 6;
var int_menu_company = 7;
var int_menu_contact = 8;
var int_menu_home = 9;
var int_menu_about = 10;

var int_style_normal = 1;
var int_style_actif = 2;
var int_style_inactif = 3;

var int_type_1 = 1;
var int_type_2 = 2;
var int_type_3 = 3;
var int_type_4 = 4;

var boo_cp =  window.location.href.indexOf('/pr.asp?', 0) > -1;
var boo_news =  window.location.href.indexOf('/news.asp', 0) > -1;
var boo_hugin_news =  window.location.href.indexOf('/hugin_news.asp', 0) > -1;
var boo_content =  window.location.href.indexOf('/content/', 0) > -1;
var boo_speaker = window.location.href.indexOf('/seminars/speaker.asp?id_speaker=', 0) > -1;
var boo_seminar = window.location.href.indexOf('/seminars/', 0) > -1;
var boo_seminar_prev = window.location.href.indexOf('/seminaire_prev.asp', 0) > -1;
var boo_directive = window.location.href.indexOf('/directive_test.asp', 0) > -1;
var boo_default = !(boo_cp || boo_news || boo_hugin_news || boo_content || boo_speaker || boo_seminar || boo_seminar_prev || boo_directive);
var boo_prev = window.location.href.indexOf('_prev.asp?', 0) > -1;

var str_header = '<div class="baseline" style="height:30px"><b>Create value through communication</b></div>';

var str_fond_ir = '';
var str_fond_pr = '';
var str_fond_seminar = '';

if ((boo_prev) || (boo_content) || (boo_seminar) || (boo_seminar_prev))
    {
        str_fond_ir = '<img src=\'../images/commun/menu_ir_descr.gif\'/>';
        str_fond_pr = '<img src=\'../images/commun/menu_pr_descr.gif\'/>';
        str_fond_seminar = '<img src=\'../images/commun/frame_grey_light.jpg\'/>';
    }
else
    {
        str_fond_ir = '<img src=\'images/commun/menu_ir_descr.gif\'/>';
        str_fond_pr = '<img src=\'images/commun/menu_pr_descr.gif\'/>';
        str_fond_seminar = '<img src=\'images/commun/frame_grey_light.jpg\'/>';
    }


/*---------------------------------------------------------------------------*/
/* Fonction de coche/décoche de toutes les cases d'un même nom               */
/* Nom : coche_langue						                                 */
/* Entrées :                                                                 */
/*      - str_obj_all : nom de l'objet déclanchant l'évènement               */
/*      - str_obj : nom des objets dont les instances doivent être modifiées */
/*---------------------------------------------------------------------------*/
function coche(str_obj_all, str_obj)
{
    for (var int_cnt = 0; int_cnt < document.all(str_obj).length; int_cnt++)
    {
        document.all(str_obj)[int_cnt].checked = document.all(str_obj_all).checked;
    }
}


/*----------------------------------------------*/
/* Fonction de sélection du mode suppression    */
/* Nom : del						            */
/* Entrées :                                    */
/*      - str_form : nom du formulaire          */
/*      - str_obj  : nom de l'objet à supprimer */
/*----------------------------------------------*/
function del(str_form, str_obj)
{
    if (window.confirm('Do you really want to delete the selected ' + str_obj + ' ?')) 
        {
            document.all('mode').value = 'del';
            if (str_form == 'source') document.forms[str_form].onsubmit();
            document.forms[str_form].submit();
            return true;
        }
    else
        {
            return false;
        }
}


/*------------------------------------------------------------------------*/
/* Fonction de sélection du mode modification et de la l'objet à modifier */
/* Nom : mod						                                      */
/* Entrées :                                                              */
/*      - str_form : nom du formulaire                                    */
/*      - str_obj  : nom de l'objet à modifier                            */
/*------------------------------------------------------------------------*/
function mod(str_form, str_obj)
{
    document.all('mode').value = str_obj;
    if (str_form == 'source') document.forms[str_form].onsubmit();
    document.forms[str_form].submit();
}


/*------------------------------------------------------------------------*/
/* Fonction de sélection du mode modification et de la l'objet à modifier */
/* Nom : mod_zone						                                  */
/* Entrées :                                                              */
/*      - str_form : nom du formulaire                                    */
/*      - str_obj  : nom de l'objet à modifier                            */
/*------------------------------------------------------------------------*/
function mod_zone(str_form, str_obj)
{
    document.all('mode_zone').value = str_obj;
    if (str_form == 'source') document.forms[str_form].onsubmit();
    document.forms[str_form].submit();
}


/*------------------------------------------------------------------------*/
/* Fonction de sélection du mode modification et de la l'objet à modifier */
/* Nom : add						                                      */
/* Entrées :                                                              */
/*      - str_form : nom du formulaire                                    */
/*------------------------------------------------------------------------*/
function add(str_form)
{
    document.all('mode').value = 'add';
    if (str_form == 'source') document.forms[str_form].onsubmit();
    document.forms[str_form].submit();
}


/*-----------------------------------------*/
/* Fonction de prévisualisation du contenu */
/* Nom : preview						   */
/*-----------------------------------------*/
function preview()
{
    document.write(window.opener.rtf_contenu.getHTMLBody());
}


/*-------------------------------------------------------------*/
/* Fonction de remplacement d'un textarea par un rich text box */
/* Nom     : rtf						                       */
/* Entrées :                                                   */
/*      - rtf_edit : objet rich text box                       */
/*      - str_nom  : nom du nom du textarea à remplacer        */
/*-------------------------------------------------------------*/
function rtf(rtf_edit, str_txt)
{
    rtf_edit.cmdAssetManager="modalDialogShow('../../editor/assetmanager/assetmanager.asp',640,445);";
    rtf_edit.width = '100%';
    rtf_edit.height = '100%';
    rtf_edit.btnForm = false;
    rtf_edit.btnStrikethrough = true;
    rtf_edit.btnSuperscript = true;
    rtf_edit.btnSubscript = true;
    rtf_edit.btnLTR = true;
    rtf_edit.btnRTL = true;
    rtf_edit.btnStyles = true;
    rtf_edit.btnClearAll = true;
    rtf_edit.btnMedia = true;
    rtf_edit.btnFlash = true;
    rtf_edit.btnPasteText = true;
    rtf_edit.btnSpellCheck = true;
    rtf_edit.css='../commun/css/styles.css';
    rtf_edit.REPLACE(str_txt);
}


/*--------------------------------------------------*/
/* Fonction de modification du contenu d'une balise */
/* Nom : change_content						        */
/* Entrées :                                        */
/*      - var_id   : id de la balise à modifier     */
/*      - str_html : nouveau contenu de la balise   */
/*--------------------------------------------------*/
function change_content(var_id, str_html)
{
    if (typeof(var_id) != 'object')
        {
            if ((str_html != '') && document.getElementById(var_id) != null) document.getElementById(var_id).innerHTML = str_html;
        }
    else
        {
            if (str_html != '') var_id.innerHTML = str_html;
        }
}


/*------------------------------------------*/
/* Fonction de cache du d'une balise        */
/* Nom : hide						        */
/* Entrées :                                */
/*      - var_id : id de la balise à cacher */
/*------------------------------------------*/
function hide(var_id)
{
    if (typeof(var_id) != 'object')
        {
            if ((var_id != 'connect') && (var_id != 'comm') && (document.getElementById(var_id) != null)) document.getElementById(var_id).innerHTML = '';
            if (document.getElementById(var_id) != null) document.getElementById(var_id).style.display = 'none';
        }
    else
        {
            if ((var_id != 'connect') && (var_id != 'comm') && (document.getElementById(var_id) != null)) var_id.innerHTML = '';
            if (document.getElementById(var_id) != null) var_id.style.display = 'none';
        }
}


/*--------------------------------------------*/
/* Fonction de montre du contenu d'une balise */
/* Nom : show						          */
/* Entrées :                                  */
/*      - var_id : id de la balise à montrer  */
/*--------------------------------------------*/
function show(var_id)
{
    if (typeof(var_id) != 'object')
        {
            document.getElementById(var_id).style.display = 'block';
        }
    else
        {
            var_id.style.display = 'block';
        }
}


/*--------------------------------------------------------*/
/* Fonction de récupération de la visibilité d'une balise */
/* Nom : getVisibility				                      */
/* Entrées :                                              */
/*      - var_id : id de la balise à tester               */
/*--------------------------------------------------------*/
function getVisibility(var_id)
{
    if (typeof(var_id) != 'object')
        {
            return document.getElementById(var_id).style.display;
        }
    else
        {
            return var_id.style.display;
        }
}


/*----------------------------------------------------------*/
/* Fonction de décalage des div par rapport à 'description' */
/* Nom : collapse_desc						                */
/*----------------------------------------------------------*/
function collapse_desc()
{
    if (getVisibility('description') == 'block')
        {
            if (boo_ie)
                {
                    document.getElementById('menu2').style.top = document.getElementById('menu1').offsetTop + 70;
                    document.getElementById('menu1').style.top = document.getElementById('description').offsetTop;
                    hide('description');
                }
            else
                {
                    document.getElementById('menu2').style.top = document.getElementById('menu1').offsetTop + 70 + 'px';
                    document.getElementById('menu1').style.top = document.getElementById('description').offsetTop + 'px';
                    hide('description');
                }
        }
}


/*--------------------------------------------------------*/
/* Fonction de calage des div par rapport à 'description' */
/* Nom : expand_descr						              */
/*--------------------------------------------------------*/
function expand_desc()
{
    if (boo_ie)
        {
            document.getElementById('menu1').style.top = document.getElementById('description').offsetTop + document.getElementById('description').offsetHeight;
            document.getElementById('menu2').style.top = document.getElementById('menu1').offsetTop + document.getElementById('menu1').offsetHeight;
            show('description');
        }
    else
        {
            document.getElementById('menu1').style.top = document.getElementById('description').offsetTop + document.getElementById('description').offsetHeight;
            document.getElementById('menu2').style.top = document.getElementById('menu1').offsetTop + document.getElementById('menu1').offsetHeight;
            show('description');
        }
}


/*------------------------------------------------------*/
/* Fonction de décalage des div par rapport à 'connect' */
/* Nom : collapse_connect						        */
/*------------------------------------------------------*/
function collapse_connect()
{
    if (getVisibility('connect') == 'block')
        {
            if (boo_ie)
                {   
                    show('path2');
                    document.getElementById('path1').style.top = document.getElementById('connect').offsetTop;
                    hide('connect');
                }
            else
                {
                    document.getElementById('path1').style.top = document.getElementById('connect').offsetTop + 'px';
                    hide('connect');
                    show('path2');
                }
        }
}


/*----------------------------------------------------*/
/* Fonction de calage des div par rapport à 'connect' */
/* Nom : expand_connect						          */
/*----------------------------------------------------*/
function expand_connect()
{
    if (getVisibility('connect') == 'none')
        {
            if (boo_ie)
                {   
                    show('connect');
                    document.getElementById('path1').style.top = document.getElementById('connect').offsetTop + document.getElementById('connect').offsetHeight;
                    hide('path2');
                }
            else
                {
                    show('connect');
                    document.getElementById('path1').style.top = document.getElementById('connect').offsetTop + document.getElementById('connect').offsetHeight;
                    hide('path2');
                }
        }
}


/*-----------------------------*/
/* Afficahge du site version 1 */
/* Nom : site1				   */
/*-----------------------------*/
function site1()
{
    if (boo_default) 
        {
            show('hg');
            show('hd');
            show('bg');
            show('bd');
            hide('bgmenu');
            hide('bdmenu');
            show('comm');
            show('sp1');
            show('sp2');
            show('sp3');
            show('sp4');
        }
        
    hide('connect');  
    expand_connect();
            
    if (boo_default) 
        {
            hide('titre');
            hide('icone');
            hide('description');
            hide('menu1');
            hide('menu2');
            hide('preview');
        }
}


/*-----------------------------*/
/* Afficahge du site version 2 */
/* Nom : site2				   */
/*-----------------------------*/
function site2()
{
    if (boo_default) 
        {
            hide('hg');
            hide('hd');
            hide('bg');
            hide('bd');
            hide('bgmenu');
            hide('bdmenu');
            hide('comm');
            hide('sp1');
            hide('sp2');
            hide('sp3');
            hide('sp4');
            show('titre');
            show('icone');
            expand_desc();
        }
        
    collapse_connect();  
          
    if (boo_default) 
        {
            show('menu1');
            show('menu2');
            show('preview');
        }
}


/*-------------------------------------------*/
/* Fonction d'affichage d'un élément de menu */
/* Nom : display						     */
/* Entrées :                                 */
/*      - int_pere      : id du menu père    */
/*      - str_cible     : élément cible      */
/*      - int_menu      : id du menu         */
/*      - int_style     : id_du style        */
/*      - str_event     : évènement          */
/* Sortie  : str_source : source du menu     */
/*-------------------------------------------*/
function display(int_pere, str_cible, int_menu, int_style, str_event)
{
    var str_source = '';

    //Parcours des fils
    for (var int_cnt = 0; int_cnt < arr_pere[int_menu - 1][int_style - 1].length; int_cnt++)
        {
            if (arr_pere[int_menu - 1][int_style - 1][int_cnt] == int_pere)
            {
                //Test menu niveau 1 => grisé / suppr video
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] == int_type_2)
                    {
                        if (int_menu == int_menu_ir)
                            {
                                change_content('hd', arr_contenu[int_menu_pr - 1][int_style_inactif - 1][int_racine]);
                                FadeById('pr_fade');
                                change_content('bd', arr_description[int_menu_pr - 1][int_style_inactif - 1][int_racine]);
                                change_content('bg', str_fond_ir);
                                show('bgmenu');
                                str_cible = 'menu1';
                            }
                        else if (int_menu == int_menu_pr)
                            {
                                change_content('hg', arr_contenu[int_menu_ir - 1][int_style_inactif - 1][int_racine]);
                                FadeById('ir_fade');
                                change_content('bg', arr_description[int_menu_ir - 1][int_style_inactif - 1][int_racine]);
                                change_content('bd', str_fond_pr);
                                show('bdmenu');
                                str_cible = 'menu1';
                            }
                        else if ((int_menu == int_menu_work) || (int_menu == int_menu_news) || (int_menu == int_menu_partner) || (int_menu == int_menu_expert))
                            {
                                change_content('video', str_fond_seminar);
                            }
                    }

                //Test menu niveau 2 => titre + icône
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] == int_type_3)
                    {
                        site2();
                        change_content('path2', get_path(arr_pere[int_menu - 1][int_style - 1][index(int_menu, int_style, int_pere)], int_menu, int_style));
                        no_style(document.getElementById('path_tag'));
                        if (int_menu == int_menu_ir)
                            {
                                expand_desc();
                                change_content('titre', arr_titre[int_menu_ir - 1][int_style_normal - 1][int_racine] + '<br/>' + arr_titre[int_menu_ir - 1][int_style_normal - 1][index(int_menu_ir, int_style_normal, int_pere)]);
                                change_content('description', arr_description[int_menu_ir - 1][int_style_normal - 1][index(int_menu_ir, int_style_normal, int_pere)]);
                                change_content('icone', '<div style="cursor:pointer" onclick="init_site();"><span id="ir_icone" onmouseover="if (int_icone != ' + int_menu_ir + ') {int_icone = ' + int_menu_ir + '; change_content(\'ir_icone\',\'' + addslashes(arr_icone[int_menu_ir - 1][int_style_normal - 1][int_racine]) + '\'); change_content(\'pr_icone\',\'' + addslashes(arr_icone[int_menu_pr - 1][int_style_inactif - 1][int_racine]) + '\');}">' + arr_icone[int_menu_ir - 1][int_style_normal - 1][int_racine] + '</span><span id="pr_icone" onmouseover="if (int_icone != ' + int_menu_pr + ') {int_icone = ' + int_menu_pr + '; change_content(\'ir_icone\',\'' + addslashes(arr_icone[int_menu_ir - 1][int_style_inactif - 1][int_racine]) + '\'); change_content(\'pr_icone\',\'' + addslashes(arr_icone[int_menu_pr - 1][int_style_normal - 1][int_racine]) + '\');}">' + arr_icone[int_menu_pr - 1][int_style_inactif - 1][int_racine]) + '</span></div>';
                            }
                        else if (int_menu == int_menu_pr)
                            {
                                expand_desc();
                                change_content('titre', arr_titre[int_menu_pr - 1][int_style_normal - 1][int_racine] + '<br/>' + arr_titre[int_menu_pr - 1][int_style_normal - 1][index(int_menu_pr, int_style_normal, int_pere)]);
                                change_content('description', arr_description[int_menu_pr - 1][int_style_normal - 1][index(int_menu_pr, int_style_normal, int_pere)]);
                                change_content('icone', '<div style="cursor:pointer" onclick="init_site();"><span id="ir_icone" onmouseover="if (int_icone != ' + int_menu_ir + ') {int_icone = ' + int_menu_ir + '; change_content(\'ir_icone\',\'' + addslashes(arr_icone[int_menu_ir - 1][int_style_normal - 1][int_racine]) + '\'); change_content(\'pr_icone\',\'' + addslashes(arr_icone[int_menu_pr - 1][int_style_inactif - 1][int_racine]) + '\');}">' + arr_icone[int_menu_ir - 1][int_style_inactif - 1][int_racine] + '</span><span id="pr_icone" onmouseover="if (int_icone != ' + int_menu_pr + ') {int_icone = ' + int_menu_pr + '; change_content(\'ir_icone\',\'' + addslashes(arr_icone[int_menu_ir - 1][int_style_inactif - 1][int_racine]) + '\'); change_content(\'pr_icone\',\'' + addslashes(arr_icone[int_menu_pr - 1][int_style_normal - 1][int_racine]) + '\');}">' + arr_icone[int_menu_pr - 1][int_style_normal - 1][int_racine]) + '</span></div>';
                            }
                        str_cible = 'menu2';
                    }

                //Génération code source
                str_source = str_source + '<div style="cursor:pointer" id="' + arr_id[int_menu - 1][int_style - 1][int_cnt] + '" ' + str_event + '="';
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] == int_type_3) str_source = str_source + 'change_content(\'menu2\', \'&nbsp;\'); ';
                str_source = str_source + 'arr_change[ ' + int_cnt + '] = true; change_content(\'' + str_cible + '\', display(' + arr_id[int_menu - 1][int_style - 1][int_cnt] + ', \'' + str_cible + '\', ' + int_menu + ', ' + int_style + ', ' + '\'onclick\'' + '))';

                // Test feuille
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] >= int_type_3)
                    {
                        str_source = str_source + '; change_content(\'preview\', \'' + addslashes(arr_titre[int_menu - 1][int_style_normal - 1][int_cnt] + '<br/><br/>' + arr_description[int_menu - 1][int_style_normal - 1][int_cnt]) + '\');';
                    }
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] > int_type_3)
                    {
                        str_source = str_source + ' collapse_desc()';
                    }
                str_source = str_source + '"';

                //Rollover
                if ((arr_type[int_menu - 1][int_style - 1][int_cnt] >= int_type_2) || (int_menu == int_menu_work) || (int_menu == int_menu_news) || (int_menu == int_menu_partner) || (int_menu == int_menu_expert))
                    {   
                        str_source = str_source + ' onmouseover="if (arr_change[' + int_cnt + ']) {init_fils(' + int_menu + ', ' + int_style + ', ' + int_pere + '); change_content(\'' + arr_id[int_menu - 1][int_style - 1][int_cnt] + '\', \'' + addslashes(arr_contenu[int_menu - 1][int_style_actif - 1][int_cnt]) + '\'); arr_change[' + int_cnt + '] = false}"';

                        //str_source = str_source + ' onmouseout="arr_change[ ' + int_cnt + '] = true;"';
                        //str_source = str_source + ' onmouseout="arr_change[ ' + int_cnt + '] = true; init_fils(' + int_menu + ', ' + int_style + ', ' + int_pere + '); change_content(\'' + arr_id[int_menu - 1][int_style - 1][int_cnt] + '\', \'' + addslashes(arr_contenu[int_menu - 1][int_style_normal - 1][int_cnt]) + '\');"';
                        str_source = str_source + ' onmouseout="if (!arr_change[' + int_cnt + ']) {init_fils(' + int_menu + ', ' + int_style + ', ' + int_pere + '); arr_change[ ' + int_cnt + '] = true;}"';

                      }
                str_source = str_source + '>' + arr_contenu[int_menu - 1][int_style - 1][int_cnt] + '</div>';
            }
        }
    return str_source;
}


/*-----------------------------------------------------*/
/* Fonction d'affichage d'un élément de menu avec span */
/* Nom : display_span						           */
/* Entrées :                                           */
/*      - int_pere      : id du menu père              */
/*      - str_cible     : élément cible                */
/*      - int_menu      : id du menu                   */
/*      - int_style     : id_du style                  */
/*      - str_event     : évènement                    */
/* Sortie  : str_source : source du menu               */
/*-----------------------------------------------------*/
function display_span(int_pere, str_cible, int_menu, int_style, str_event)
{
    var str_source = '';

    //Parcours des fils
    for (var int_cnt = 0; int_cnt < arr_pere[int_menu - 1][int_style - 1].length; int_cnt++)
        {
            if (arr_pere[int_menu - 1][int_style - 1][int_cnt] == int_pere)
            {
                //Test menu niveau 1 => grisé
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] == int_type_2)
                    {
                        if (boo_default) expand_desc();
                        collapse_connect();
                        if (int_menu == int_menu_ir)
                            {
                                change_content('hd', arr_contenu[int_menu_pr - 1][int_style_inactif - 1][int_racine]);
                                change_content('bd', arr_description[int_menu_pr - 1][int_style_inactif - 1][int_racine]);
                                change_content('bg', str_fond_ir);
                                show('bgmenu');
                            }
                        else if (int_menu == int_menu_pr)
                            {
                                change_content('hg', arr_contenu[int_menu_ir - 1][int_style_inactif - 1][int_racine]);
                                change_content('bg', arr_description[int_menu_ir - 1][int_style_inactif - 1][int_racine]);
                                change_content('bd', str_fond_pr);
                                show('bdmenu');
                            }
                        else if ((int_menu == int_menu_company) || (int_menu == int_menu_contact))
                            {
                                hide('sp4');
                            }
                        str_cible = 'menu1';
                    }

                //Test menu niveau 2 => titre + icône
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] == int_type_3)
                    {
                        site2();
                        change_content('path2', get_path(arr_pere[int_menu - 1][int_style - 1][index(int_menu, int_style, int_pere)], int_menu, int_style));
                        no_style(document.getElementById('path_tag'));
                        if (int_menu == int_menu_ir)
                            {
                                expand_desc();
                                change_content('titre', arr_titre[int_menu_ir - 1][int_style_normal - 1][int_racine] + '<br/>' + arr_titre[int_menu_ir - 1][int_style_normal - 1][index(int_menu_ir, int_style_normal, int_pere)]);
                                change_content('description', arr_description[int_menu_ir - 1][int_style_normal - 1][index(int_menu_ir, int_style_normal, int_pere)]);
                                change_content('icone', '<span style="cursor:pointer" onclick="init_site();">' + arr_icone[int_menu_ir - 1][int_style_normal - 1][int_racine] + arr_icone[int_menu_pr - 1][int_style_inactif - 1][int_racine]) + '</span>';
                            }
                        else if (int_menu == int_menu_pr)
                            {
                                expand_desc();
                                change_content('titre', arr_titre[int_menu_pr - 1][int_style_normal - 1][int_racine] + '<br/>' + arr_titre[int_menu_pr - 1][int_style_normal - 1][index(int_menu_pr, int_style_normal, int_pere)]);
                                change_content('description', arr_description[int_menu_pr - 1][int_style_normal - 1][index(int_menu_pr, int_style_normal, int_pere)]);
                                change_content('icone', '<span style="cursor:pointer" onclick="init_site();">' + arr_icone[int_menu_pr - 1][int_style_normal - 1][int_racine] + arr_icone[int_menu_ir - 1][int_style_inactif - 1][int_racine]) + '</span>';
                            }
                        str_cible = 'menu2';
                    }

                //Génération code source
                str_source = str_source + '<span style="cursor:pointer" id="' + arr_id[int_menu - 1][int_style - 1][int_cnt] + '" ' + str_event + '="arr_change[ ' + int_cnt + '] = true; change_content(\'' + str_cible + '\', display_span(' + arr_id[int_menu - 1][int_style - 1][int_cnt] + ', \'' + str_cible + '\', ' + int_menu + ', ' + int_style + ', ' + '\'onclick\'' + '))';
                
                // Test feuille
                if (arr_type[int_menu - 1][int_style - 1][int_cnt] >= int_type_4)
                    {
                        str_source = str_source + '; change_content(\'preview\', \'' + addslashes(arr_titre[int_menu - 1][int_style_normal - 1][int_cnt] + '<br/><br/>' + arr_description[int_menu - 1][int_style_normal - 1][int_cnt]) + '\'); collapse_desc()';
                    }
                str_source = str_source + '"';
                
                //Rollover
                if ((arr_type[int_menu - 1][int_style - 1][int_cnt] >= int_type_2) ||(int_menu == int_menu_work) || (int_menu == int_menu_news) || (int_menu == int_menu_partner) || (int_menu == int_menu_expert) || (int_menu == int_menu_home) || (int_menu == int_menu_company) || (int_menu == int_menu_contact) || (int_menu == int_menu_about))
                    {   
                        str_source = str_source + ' onmouseover="if (arr_change[' + int_cnt + ']) {init_fils(' + int_menu + ', ' + int_style + ', ' + int_pere + '); change_content(\'' + arr_id[int_menu - 1][int_style - 1][int_cnt] + '\', \'' + addslashes(arr_contenu[int_menu - 1][int_style_actif - 1][int_cnt]) + '\'); arr_change[' + int_cnt + '] = false}"';
                        str_source = str_source + ' onmouseout="arr_change[ ' + int_cnt + '] = true;"'
                    }
                str_source = str_source + '>' + arr_contenu[int_menu - 1][int_style - 1][int_cnt] + '</span>';
            }
        }
    return str_source;
}


/*-------------------------------------------------*/
/* Fonction qui retourne le "chemin" d'un noeud    */
/* Nom : get_path						           */
/* Entrées :                                       */
/*      - int_pere : id du pere du noeud à traiter */
/* Sortie :                                        */
/*      - le "chemin"                              */
/*-------------------------------------------------*/
function get_path(int_pere, int_menu, int_style)
{
    var str_path = '';
    for (var int_cnt = 0; int_cnt < arr_pere[int_menu - 1][int_style - 1].length; int_cnt++)
    {
        if (arr_pere[int_menu - 1][int_style - 1][int_cnt] == int_pere)
        {
            str_path = str_path + '<span';
            str_path = str_path + ' onmouseover="this.className=\'pathover\'"';
            str_path = str_path + ' onmouseout="this.className=\'path\'"'
            str_path = str_path + ' onclick="hide(\'menu2\'); hide(\'preview\'); change_content(\'menu1\', display(' + arr_id[int_menu - 1][int_style - 1][int_cnt] + ', \'menu2\', ' + int_menu + ', ' + int_style + ', \'onclick\'))">' + arr_contenu[int_menu - 1][int_style - 1][int_cnt] + '</span> | ';
        }
    }
    str_path = str_path.substr(0, str_path.length - 3);
    str_path = '<span class="path" style="cursor:pointer" id="path_tag">' + str_path + '</span>'
    return str_path;
}


/*--------------------------------------*/
/* Fonction d'initialisation du contenu */
/* Nom : init_site						*/
/*--------------------------------------*/
function init_site()
{
    site1();
    if (boo_default)
        {
            show('connect');
            //Racines
            change_content('hg', display(int_racine, 'bgmenu', int_menu_ir, int_style_normal, 'onmouseover'));
            change_content('hd', display(int_racine, 'bdmenu', int_menu_pr, int_style_normal, 'onmouseover'));
            change_content('bg', arr_description[int_menu_ir - 1][int_style_normal - 1][int_racine]);
            change_content('bd', arr_description[int_menu_pr - 1][int_style_normal - 1][int_racine]);
        }
    
    change_content('newsmenu', display(int_racine, 'videomenu', int_menu_work, int_style_normal, 'onclick') + display(int_racine, 'videomenu', int_menu_news, int_style_normal, 'onclick') + display(int_racine, 'videomenu', int_menu_partner, int_style_normal, 'onclick') + display(int_racine, 'videomenu', int_menu_expert, int_style_normal, 'onclick'));
    change_content('path1', str_header + display_span(int_racine, 'path2', int_menu_home, int_style_normal, 'onclick') + '<span class="path"> | </span>' + display_span(int_racine, 'path2', int_menu_company, int_style_normal, 'onclick') + '<span class="path"> | </span>' + display_span(int_racine, 'path2', int_menu_contact, int_style_normal, 'onclick'));
    
    if ((boo_seminar) || (boo_seminar_prev))
        change_content('video', str_fond_seminar);
    else
    {
        change_content('videomenu', '&nbsp;');
    }   
}


/*---------------------------------------------------------*/
/* Fonction de remplacement des quotes par backslash-quote */
/* Nom : addslashes						                   */
/* Entrées :                                               */
/*      - str_chaine : chaîne à traiter                    */
/* Sortie                                                  */
/*      - str_chaine : chaîne traitée                      */
/*---------------------------------------------------------*/
function addslashes(str_chaine)
{
    str_chaine = str_chaine.replace(/\\/g, "\\\\");
    str_chaine = str_chaine.replace(/\'/g, "\\'");
    //str_chaine = str_chaine.replace(/\"/g, "\\\"");
    return str_chaine;
}


/*----------------------------------------------------*/
/* Fonction de formatage d'une chaîne pour la preview */
/* Nom : format						                  */
/* Entrées :                                          */
/*      - str_chaine : chaîne à traiter               */
/* Sortie                                             */
/*      - str_chaine : chaîne traitée                 */
/*----------------------------------------------------*/
function format(str_chaine)
{
    str_chaine = str_chaine.replace(/\r\n/g, '');
    str_chaine = str_chaine.replace(/"/g, "'");
    return str_chaine;
}
        

/*-------------------------------------------------*/
/* Fonction d'initialisation des fils d'un élément */
/* Nom : init_fils						           */
/* Entrées :                                       */
/*      - int_menu : id menu                       */
/*      - int_style : id_style                     */
/*      - int_pere : id_noeud                      */
/*-------------------------------------------------*/
function init_fils(int_menu, int_style, int_pere)
{
    if (arr_type[int_menu - 1][int_style - 1][int_pere] == int_type_1)
        {
            init_grey(int_style, int_pere);
            init_header(int_style, int_pere);
        }

    //Parcours des fils
    for (var int_cnt = 0; int_cnt < arr_pere[int_menu - 1][int_style - 1].length; int_cnt++)
        {        
            if (arr_pere[int_menu - 1][int_style - 1][int_cnt] == int_pere)
            {
                change_content(arr_id[int_menu - 1][int_style - 1][int_cnt], arr_contenu[int_menu - 1][int_style_normal - 1][int_cnt]);
            }
        }
}


/*---------------------------------------------------*/
/* Fonction d'initialisation des éléments gris (...) */
/* Nom : init_grey					                 */
/* Entrées :                                         */
/*      - int_style : id_style                       */
/*      - int_pere : id_noeud                        */
/*---------------------------------------------------*/
function init_grey(int_style, int_pere)
{
    change_content(arr_id[int_menu_news - 1][int_style - 1][int_pere], arr_contenu[int_menu_news - 1][int_style_normal - 1][int_pere]);
    change_content(arr_id[int_menu_work - 1][int_style - 1][int_pere], arr_contenu[int_menu_work - 1][int_style_normal - 1][int_pere]);
    change_content(arr_id[int_menu_partner - 1][int_style - 1][int_pere], arr_contenu[int_menu_partner - 1][int_style_normal - 1][int_pere]);
    change_content(arr_id[int_menu_expert - 1][int_style - 1][int_pere], arr_contenu[int_menu_expert - 1][int_style_normal - 1][int_pere]);
}


/*-------------------------------------------*/
/* Fonction d'initialisation du header (...) */
/* Nom : init_header					     */
/* Entrées :                                 */
/*      - int_style : id_style               */
/*      - int_pere : id_noeud                */
/*-------------------------------------------*/
function init_header(int_style, int_pere)
{
    change_content(arr_id[int_menu_home - 1][int_style - 1][int_pere], arr_contenu[int_menu_home - 1][int_style_normal - 1][int_pere]);
    change_content(arr_id[int_menu_company - 1][int_style - 1][int_pere], arr_contenu[int_menu_company - 1][int_style_normal - 1][int_pere]);
    change_content(arr_id[int_menu_contact - 1][int_style - 1][int_pere], arr_contenu[int_menu_contact - 1][int_style_normal - 1][int_pere]);
    change_content(arr_id[int_menu_about - 1][int_style - 1][int_pere], arr_contenu[int_menu_about - 1][int_style_normal - 1][int_pere]);
}


/*------------------------------------------*/
/* Fonction qui retourne l'index d'un noeud */
/* Nom : index						        */
/* Entrées :                                */
/*      - int_menu : id menu                */
/*      - int_style : id_style              */
/*      - int_id : id_noeud                 */
/* Sorties :                                */
/*      - int_index : index du noeud        */
/*------------------------------------------*/
function index(int_menu, int_style, int_id)
{
    var int_index = 0;
    //Parcours des noeuds
    for (var int_cnt = 0; int_cnt < arr_id[int_menu - 1][int_style - 1].length; int_cnt++)
        {
            if (arr_id[int_menu - 1][int_style - 1][int_cnt] == int_id)
                {
                    int_index = int_cnt;
                    break;
                }
        }
    return int_index;
}


/*-----------------------------------------------------*/
/* Fonction qui sélectionne un élément du menu (admin) */
/* Nom : select_menu						           */
/* Entrées :                                           */
/*      - str_menu : id du menu à sélectionner         */
/*-----------------------------------------------------*/
function select_menu(str_menu)
{
    document.getElementById('link_langue').style.fontWeight = 'normal';
    document.getElementById('link_pays').style.fontWeight = 'normal';
    document.getElementById('link_accueil').style.fontWeight = 'normal';
    document.getElementById('link_menu').style.fontWeight = 'normal';
    document.getElementById('link_page').style.fontWeight = 'normal';
    document.getElementById('link_seminars').style.fontWeight = 'normal';
    document.getElementById(str_menu).style.fontWeight = 'bold';
}


/*-------------------------------------------------------*/
/* Fonction qui sélectionne un élément du menu (seminar) */
/* Nom : select_menu_seminar				             */
/* Entrées :                                             */
/*      - str_menu : id du menu à sélectionner           */
/*-------------------------------------------------------*/
function select_menu_seminar(str_menu)
{
    document.getElementById('link_seminar_home').style.fontWeight = 'normal';
    document.getElementById('link_topic').style.fontWeight = 'normal';
    document.getElementById('link_speaker').style.fontWeight = 'normal';
    document.getElementById('link_seminar').style.fontWeight = 'normal';
    document.getElementById(str_menu).style.fontWeight = 'bold';
}


/*------------------------------------------------------------*/
/* Fonction de demande de confirmation de changement de style */
/* Nom : change_style						                  */
/*      - str_style : id du bouton de style                   */
/*------------------------------------------------------------*/
function change_style(str_style)
{
    if (window.confirm('You\'re going to edit another style, unsaved modifications will be lost. Continue ?'))
        {
            document.style.submit();
            return true;
        }
    else
        {
            document.getElementById(str_style).checked = 'checked';
            return false;
        }
}


/*-----------------------------------------*/
/* Fonction de réinitialisation de la date */
/* Nom : init_date_focus				   */
/*      - str_date : id du champ date      */
/*-----------------------------------------*/
function init_date_focus(str_date)
{
    //if (document.getElementById(str_date).value == 'dd/mm/yyyy hh:mm:ss')
    if (document.getElementById(str_date).value == 'dd/mm/yyyy')
        {
            document.getElementById(str_date).value = '';
        }
}


/*-----------------------------------------*/
/* Fonction de réinitialisation de la date */
/* Nom : init_date_blur				       */
/*      - str_date : id du champ date      */
/*-----------------------------------------*/
function init_date_blur(str_date)
{
    if (document.getElementById(str_date).value == '')
        {
            //document.getElementById(str_date).value = 'dd/mm/yyyy hh:mm:ss';
            document.getElementById(str_date).value = 'dd/mm/yyyy';
        }
}


/*-----------------------------------------------------*/
/* Fonction de réinitialisation de la date (séminaire) */
/* Nom : init_date_focus_seminar		               */
/*      - str_date : id du champ date                  */
/*-----------------------------------------------------*/
function init_date_focus_seminar(str_date)
{
    if (document.getElementById(str_date).value == 'dd/mm/yyyy')
        {
            document.getElementById(str_date).value = '';
        }
}


/*-----------------------------------------------------*/
/* Fonction de réinitialisation de la date (séminaire) */
/* Nom : init_date_blur_seminar	                       */
/*      - str_date : id du champ date                  */
/*-----------------------------------------------------*/
function init_date_blur_seminar(str_date)
{
    if (document.getElementById(str_date).value == '')
        {
            document.getElementById(str_date).value = 'dd/mm/yyyy';
        }
}


/*------------------------------------*/
/* Fonction de suppression des styles */
/* Nom : no_style				      */
/*      - obj_tag : balise à modifier */
/*------------------------------------*/
function no_style(obj_tag)
{
    for (var int_cnt = 0; int_cnt < obj_tag.childNodes.length; int_cnt++)
    {
        if (obj_tag.childNodes[int_cnt].nodeType != 3)
        {
            if (boo_ns)
            {            
                obj_tag.childNodes[int_cnt].removeAttribute('class', false);
            }
            else if (boo_ie)
            {
                obj_tag.childNodes[int_cnt].parentNode.innerHTML = obj_tag.childNodes[int_cnt].parentNode.innerHTML.replace('class=', 'style=');
            }
            obj_tag.childNodes[int_cnt].removeAttribute('style', false);
            no_style(obj_tag.childNodes[int_cnt]);
        }
    }
}


/*------------------------------------*/
/* Fonction de suppression des styles */
/* Nom : no_style2				      */
/*      - obj_tag : balise à modifier */
/*------------------------------------*/
function no_style2(obj_tag)
{
    for (var int_cnt = 0; int_cnt < obj_tag.childNodes.length; int_cnt++)
    {
        if (obj_tag.childNodes[int_cnt].nodeType != 3)
        {
            obj_tag.childNodes[int_cnt].removeAttribute('size', false);
            obj_tag.childNodes[int_cnt].removeAttribute('face', false);
            obj_tag.childNodes[int_cnt].removeAttribute('color', false);
        }
        no_style2(obj_tag.childNodes[int_cnt]);
    }
}


/*-------------*/
/* Fondu image */
/*-------------*/
var timer = 0;
var iOpacity = 0;
var idFade = '';

function FadeById(id)
{
    idFade = id;
    timer = window.setTimeout('FadeIn()', 1);
}

function CancelFadeById()
{
    if (timer == 0) return;
    window.clearTimeout(timer);
    timer = 0;
}

function FadeIn()
{
    var elem = document.getElementById(idFade);
    if ((elem != null) && (iOpacity < 0.7))
    {
        iOpacity += 0.02;
        elem.style.opacity = 1 - iOpacity;
        elem.style.MozOpacity = 1 - iOpacity;
        elem.style.KhtmlOpacity = 1 - iOpacity;
        elem.style.filter = 'alpha(opacity=' + (100 - (iOpacity * 100)) + ')';
        if(timer != null) window.clearTimeout(timer);
        timer = window.setTimeout('FadeIn()', 1);
    }
    else
    {
        iOpacity = 0;
        CancelFadeById();
        return;
    }
}


/*----------------------------------------*/
/* Fonction de nettoyage des balises Word */
/* Nom : fixWord				          */
/*----------------------------------------*/
function fixWord()
{
    for (var i = 0; i < idSource.document.body.all.length; i++)
    {
        idSource.document.body.all[i].removeAttribute("className", "", 0);
        idSource.document.body.all[i].removeAttribute("style", "", 0);
    }
    var str = idSource.document.body.innerHTML;

    str = String(str).replace(/<\\?\?xml[^>]*>/g, "");
    str = String(str).replace(/<\/?o:p[^>]*>/g, "");
    str = String(str).replace(/<\/?u1:p[^>]*>/gi, "");
    str = String(str).replace(/<\/?v:[^>]*>/g, "");
    str = String(str).replace(/<\/?o:[^>]*>/g, "");
    str = String(str).replace(/<\/?st1:[^>]*>/g, "");
    str = String(str).replace(/<\/?w:wrap[^>]*>/gi, "");
    str = String(str).replace(/<\/?w:anchorlock[^>]*>/gi, "");

    str = String(str).replace(/&nbsp;/g, "");

    str = String(str).replace(/<\/?SPAN[^>]*>/g, "");
    str = String(str).replace(/<\/?FONT[^>]*>/g, "");
    str = String(str).replace(/<\/?STRONG[^>]*>/g, "");

    str = String(str).replace(/<\/?H1[^>]*>/g, "");
    str = String(str).replace(/<\/?H2[^>]*>/g, "");
    str = String(str).replace(/<\/?H3[^>]*>/g, "");
    str = String(str).replace(/<\/?H4[^>]*>/g, "");
    str = String(str).replace(/<\/?H5[^>]*>/g, "");
    str = String(str).replace(/<\/?H6[^>]*>/g, "");

    str = String(str).replace(/<\/?P[^>]*><\/P>/g, "");
    var reg = new RegExp(String.fromCharCode(8217), "gi");
    str = String(str).replace(reg, "'");
    return str; 
}


/*-----------------------------------------------------------*/
/* Fonction de coche des cases de réduc (register séminaire) */
/* Nom : coche_reduc				                         */
/*      - str_id : id de la balise à tester                  */
/*-----------------------------------------------------------*/
function coche_reduc(str_id)
{
    if (boo_ie)
    {
        if (document.getElementById(str_id).checked != 'checked')
        {
            if (document.getElementById('reduc').checked != 'checked') document.getElementById('reduc').checked = 'checked';
        }
    }
    else
    {
        if (document.getElementById(str_id).checked != 'true')
        {
            if (document.getElementById('reduc').checked != 'true') document.getElementById('reduc').checked = 'true';
        }
    }
}


/*-------------------------------------------------------------*/
/* Fonction de decoche des cases de réduc (register séminaire) */
/* Nom : decoche_reduc				                           */
/*      - str_id : id de la balise à tester                    */
/*-------------------------------------------------------------*/
function decoche_reduc(str_id)
{
    if (document.getElementById(str_id).checked == '')
    {
        if (document.getElementById('reduc1').checked != '') document.getElementById('reduc1').checked = '';
        if (document.getElementById('reduc2').checked != '') document.getElementById('reduc2').checked = '';
        if (document.getElementById('reduc3').checked != '') document.getElementById('reduc3').checked = '';
    }
}
