﻿// JScript File



ListeRepertoire=document.location.href.replace('http://','').replace(FolderRacine,'').replace('//','')
CheminPage=ListeRepertoire.substring(ListeRepertoire.indexOf('/')+1,ListeRepertoire.length)


function SelectNodeRepertoire(NodeNum)
    {
    var ListeRepertoireFunction=CheminPage;
    if(NodeNum==1)
        {
        ListeRepertoireFunction=ListeRepertoireFunction.substring(0,ListeRepertoireFunction.indexOf('/'))
        }
    else
        {
        for (i = 2; i <= NodeNum; i++)
            {
            ListeRepertoireFunction=ListeRepertoireFunction.substring(ListeRepertoireFunction.indexOf('/')+1,ListeRepertoireFunction.length);
            }
        if(ListeRepertoireFunction.indexOf('/')>0)
            {
            ListeRepertoireFunction=ListeRepertoireFunction.substring(0,ListeRepertoireFunction.indexOf('/'))
            }    
        }
    return ListeRepertoireFunction.toLowerCase();
    }
        
function afficherLelayDisplay(Id)
    {
    if(getObj(Id)!=null)
        { 
        getObj(Id).style.display='inline';
        }
    }    
    
function cacherLelayDisplay(Id)
    {
    if(getObj(Id)!=null)
        { 
        getObj(Id).style.display='none';
        }
    }      

function ResetNav()
    {
    cacherLelayDisplay('LELAY_a_la_une');
    cacherLelayDisplay('LELAY_innovation');
    cacherLelayDisplay('LELAY_competition');
    cacherLelayDisplay('LELAY_securite');
    cacherLelayDisplay('LELAY_environnement');
    cacherLelayDisplay('LELAY_saga');
    cacherLelayDisplay('LELAY_peugeotetvous');
    cacherLelayDisplay('LELAY_zoom');
    getObj('ctl00_NavRight1_BOUTRUB_a_la_une').src=getObj('ctl00_NavRight1_BOUTRUB_a_la_une').src.replace('_on','_off');
    getObj('ctl00_NavRight1_BOUTRUB_innovation').src=getObj('ctl00_NavRight1_BOUTRUB_innovation').src.replace('_on','_off');
    getObj('ctl00_NavRight1_BOUTRUB_competition').src=getObj('ctl00_NavRight1_BOUTRUB_competition').src.replace('_on','_off');
    getObj('ctl00_NavRight1_BOUTRUB_securite').src=getObj('ctl00_NavRight1_BOUTRUB_securite').src.replace('_on','_off');
    getObj('ctl00_NavRight1_BOUTRUB_environnement').src=getObj('ctl00_NavRight1_BOUTRUB_environnement').src.replace('_on','_off');
    getObj('ctl00_NavRight1_BOUTRUB_saga').src=getObj('ctl00_NavRight1_BOUTRUB_saga').src.replace('_on','_off');
    getObj('ctl00_NavRight1_BOUTRUB_peugeotetvous').src=getObj('ctl00_NavRight1_BOUTRUB_peugeotetvous').src.replace('_on','_off');
    }
    
function clickRubrique(Id,idBout)
    {
    ResetNav();
    if(getObj(Id)!=null)
        { 
        if(getObj(Id).style.display=='inline')
            {
            getObj('ctl00_NavRight1_'+idBout).src=getObj('ctl00_NavRight1_'+idBout).src.replace('_on','_off');
            cacherLelayDisplay(Id);
            }
        else
            {
            getObj('ctl00_NavRight1_'+idBout).src=getObj('ctl00_NavRight1_'+idBout).src.replace('_off','_on');
            afficherLelayDisplay(Id);
            }   
        }
    }
        
function RollNavLeftRubrique(Obj)
    {
    Obj.src=Obj.src.replace('_off','_on');
    }    
            
function DeRollNavLeftRubrique(Obj)
    {
    Obj.src=Obj.src.replace('_on','_off');
    }    
    
function RollNavLeftSousRubrique(Obj)
    {
    getObj(Obj.id.replace('CEL','ctl00_NavRight1_HREF')).style.color='#000000';
    }    

function DeRollNavLeftSousRubrique(Obj)
    {
    if(document.location.href.replace('.aspx','aspx').toLowerCase().replace('-','').replace('-','').replace('-','').replace('-','').replace('-','').replace('-','').replace('-','').replace('-','').replace('-','').replace('-','').replace('.','').replace('?','').replace('=','').replace('=','').replace('&','').replace(' ','').replace(' ','').replace(' ','').replace(' ','').replace(' ','').indexOf(Obj.id.replace('CEL_',''))<0)
        {
        getObj(Obj.id.replace('CEL','ctl00_NavRight1_HREF')).style.color='#686868';
        }
	} 
	
function ListArticle(id,rubriques)   
    {
        location.href = FolderRacine+"/Rubriques/Rubriques.aspx?id="+id+"&rubriques=" + rubriques;
    }