
var contenusEnAccordeonVitesse = 400;
var contenusEnAccordeonTypeInterpolation = "accelerer";
function iniContenusEnAccordeon(){
var listeObj = $cn("JS_contenuEnAccordeon");
var i;
for(i=0; _DIVSection = listeObj[i]; i++){
appliquerIdGenerique(_DIVSection); 
var _DIVUnEnsemble = _DIVSection;
while(!trouverUneClasse(_DIVUnEnsemble, "contenusEnAccordeonUnEnsemble")){
_DIVUnEnsemble = _DIVUnEnsemble.parentNode;
}
if(typeof(contenusEnAccordeonLargeur) == "undefined"){
var contenusEnAccordeonLargeur = connaitreLargeur(_DIVUnEnsemble.parentNode) - 0;
}
appliquerIdGenerique(_DIVUnEnsemble);
_DIVSection.enTete = _DIVSection.getElementsByTagName("DIV")[0];
_DIVSection.style.width = contenusEnAccordeonLargeur + "px";
_DIVSection.lienDeclencheur = _DIVSection.enTete.getElementsByTagName("A")[0];
_DIVSection.lienDeclencheur.setAttribute("href", "javascript: triggerSousContenuEnAccordeon('" + _DIVSection.id + "')");
var listeObjEnfants = $id(_DIVSection.id).childNodes;
var _DIVContenu;
var j = 0;
do{
_DIVContenu = listeObjEnfants[j];
j++;
}while(!trouverUneClasse(_DIVContenu, "contenuEnAccordeonSousContenu"))
_DIVSection.sousContenu = _DIVContenu;
_DIVSection.deroule = trouverUneClasse(_DIVSection, "deroule");
_DIVSection.enroule = trouverUneClasse(_DIVSection, "enroule");
_DIVSection.enCoursDeroulement = false;
_DIVSection.enCoursEnroulement = false;
_DIVSection.unEnsemble = _DIVUnEnsemble;
_DIVSection.lierSections = trouverUneClasse(_DIVUnEnsemble, "JS_lierSection");
ajouterEvenement(_DIVSection.enTete, "mousedown", triggerSousContenuEnAccordeon);
}
}
function triggerSousContenuEnAccordeon(e){
var _DIVSection;
if(typeof(e) == "object"){
_DIVSection = $this(e);
}else{
_DIVSection = $id(e);
}
while(!trouverUneClasse(_DIVSection, "contenuEnAccordeonUneSection")){
_DIVSection = _DIVSection.parentNode;
}
if(_DIVSection.lierSections){
var listeSections = $id(_DIVSection.unEnsemble.id).childNodes;
var i;
var _DIVSectionEnCours;
var autorisation = true;
for(i=0; _DIVSectionEnCours = listeSections[i]; i++){
if(_DIVSectionEnCours.enCoursDeroulement || _DIVSectionEnCours.enCoursEnroulement){
autorisation = false;
}
}
if(autorisation){
for(i=0; _DIVSectionEnCours = listeSections[i]; i++){
if(_DIVSectionEnCours.tagName == "DIV" && _DIVSectionEnCours != _DIVSection){
if(_DIVSectionEnCours.deroule){
enroulerSousContenuEnAccordeon(_DIVSectionEnCours);
}
}else if(_DIVSectionEnCours == _DIVSection){
if(_DIVSection.deroule || _DIVSection.enCoursDeroulement){
enroulerSousContenuEnAccordeon(_DIVSection);
}else{
deroulerSousContenuEnAccordeon(_DIVSection);
}
}
}
}
}else{
if(_DIVSection.deroule || _DIVSection.enCoursDeroulement){
enroulerSousContenuEnAccordeon(_DIVSection);
}else{
deroulerSousContenuEnAccordeon(_DIVSection);
}
}
}
function enroulerSousContenuEnAccordeon(_DIVSection){
_DIVContenu = _DIVSection.sousContenu;
enroulerCreerInterpolation(_DIVSection);
}
function enroulerCreerInterpolation(_DIVSection){
_DIVContenu = _DIVSection.sousContenu;
if(!_DIVSection.enCoursDeroulement){
var contenuHauteur = connaitreHauteur(_DIVContenu);
interpolationDefinition(_DIVContenu, "height", contenusEnAccordeonTypeInterpolation, contenuHauteur, 0, contenusEnAccordeonVitesse);
_DIVContenu.interpolation.height.id = _DIVSection.id;
_DIVContenu.interpolation.height.finSeqLectureNormale = function(){
var _DIVSection = $id(this.id);
_DIVSection.deroule = false;
_DIVSection.enroule = true;
_DIVSection.enCoursDeroulement = false;
_DIVSection.enCoursEnroulement = false;
etatInitialEnroule($id(this.id));
};
_DIVSection.deroule = false;
_DIVSection.enroule = false;
_DIVSection.enCoursDeroulement = true;
_DIVSection.enCoursEnroulement = false;
_DIVContenu.interpolation.height.lecture();
}
}
function deroulerSousContenuEnAccordeon(_DIVSection){
deroulerCreerInterpolation(_DIVSection);
}
function deroulerCreerInterpolation(_DIVSection){
_DIVContenu = _DIVSection.sousContenu;
if(!_DIVSection.enCoursEnroulement){
var sectionLargeur= connaitreLargeur(_DIVSection);
_DIVContenu.style.width = sectionLargeur + "px";
_DIVContenu.style.height = "auto";
var contenuHauteur = connaitreHauteur(_DIVContenu);
_DIVContenu.style.width = "";
interpolationDefinition(_DIVContenu, "height", contenusEnAccordeonTypeInterpolation, 0, contenuHauteur, contenusEnAccordeonVitesse);
_DIVContenu.interpolation.height.id = _DIVSection.id;
_DIVContenu.interpolation.height.finSeqLectureNormale = function(){
var _DIVSection = $id(this.id);
_DIVSection.deroule = true;
_DIVSection.enroule = false;
_DIVSection.enCoursDeroulement = false;
_DIVSection.enCoursEnroulement = false;
_DIVSection.sousContenu.style.height = "auto";
};
_DIVContenu.style.height = "0";
etatInitialDeroule($id(_DIVSection.id));
_DIVContenu.interpolation.height.lecture();
_DIVSection.deroule = false;
_DIVSection.enroule = false;
_DIVSection.enCoursDeroulement = true;
_DIVSection.enCoursEnroulement = false;
}
}
function etatInitialEnroule(_DIVSection){
supprimerUneClasse(_DIVSection, "deroule");
ajouterUneClasse(_DIVSection, "enroule");
}
function etatInitialDeroule(_DIVSection){
supprimerUneClasse($id(_DIVSection.id), "enroule");
ajouterUneClasse($id(_DIVSection.id), "deroule");
}
