/*
'---
'--- fonctions.js - Page de fonction en Javascript
'---
'--- Par Sacha Vincent
'---     www.sachavincent.com
'---
'--- RÉVISION
'--- 2008/05/27 -SJV	Création  
*/     


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *    
 * GetReference()  - Trouve la référence pour l'objet document
 */
function GetReference(id)
{
	if(document.layers) return document.layers[id];
	if(document.all && !document.getElementById) return document.all[id];
	if(document.all && document.getElementById) return document.getElementById(id);
	if(!document.all && document.getElementById) return document.getElementById(id);
	return false;
}

function GetDetailInfo()
{
    var sPath = window.location.href;   
    var sParam = sPath.substring(sPath.lastIndexOf('#d') + 2);    
   
    if(!isNaN(sParam))
        Detail(sParam);
}
  
function Detail2(iDetail)
{
    ObjDetail1 = GetReference("detail_1");
    ObjDetail1.style.display = "none";
    ObjDetail2 = GetReference("detail_2");
    ObjDetail2.style.display = "none";
    ObjDetail3 = GetReference("detail_3");
    ObjDetail3.style.display = "none";
    
    ObjDetail = GetReference("detail_" + iDetail);
    ObjDetail.style.display = "block";
}


function Detail(iDetail)
{         
    ObjDetail = GetReference("detail_" + iDetail);    
    ObjBouton = GetReference("bouton_detail_" + iDetail);
    
    ObjDetail.style.display = "block";
    ObjBouton.style.display = "none";    
}

function FermerDetail(iDetail)
{         
    ObjDetail = GetReference("detail_" + iDetail);
    ObjBouton = GetReference("bouton_detail_" + iDetail);    
    
    ObjDetail.style.display = "none";
    ObjBouton.style.display = "block";                   
}

/*
function Detail(iDetail)
{         
    ObjDetail = GetReference("detail_" + iDetail);
    
    ObjBouton = GetReference("bouton_detail_" + iDetail);
    
    if(ObjDetail.style.display == "block")
    {
        ObjDetail.style.display = "none";
        ObjBouton.style.display = "block";
    }
    else
    {       
        ObjDetail.style.display = "block";
        ObjBouton.style.display = "none";
    }
}

function FermerDetail(iDetail)
{         
    ObjDetail = GetReference("detail_" + iDetail);
    ObjBouton = GetReference("bouton_detail_" + iDetail);
    
    if(ObjDetail.style.display == "block")
    {
        ObjDetail.style.display = "none";
        ObjBouton.style.display = "block";
    }
    else
    {       
        ObjDetail.style.display = "block";
        ObjBouton.style.display = "none";
    }
}
*/

