﻿<!--
//window.onload=afficheMenu();

function afficheMenu(id)
{
  imageOpacity(id); // rend l'image au dessus du menu visible
  var menu = $(id);
  
  if($("menuAvBac") != null)
  {
    $("menuAvBac").style.display='none';
  }
  if($("menuApBac") != null)
  {
  $("menuApBac").style.display='none';
  }
  if($("menuService") != null)
  {
  $("menuService").style.display='none';
  }
  if($("menuActualite") != null)
  {
  $("menuActualite").style.display='none';
  }  
  if (menu)
  {  
     menu.style.display='block';
  }
}

function afficheImage(titre,url,couleur)
{
    $(titre).style.backgroundImage="url(http://www.enseignement-prive.fr/pictures/"+url+")";
    $(titre).style.color=couleur;
}

function menuSelectionner(id)
{
  (id == 'menuActualite') 
    ? afficheImage('lienActualite',"menu-actu-orange.gif",'#FFFFFF')
    : afficheImage('lienActualite','menu-bar.gif','#FFFFFF');

  (id == 'menuApBac') 
    ? afficheImage('lienApBac',"menu-bac-orange.gif",'#FFFFFF')
    : afficheImage('lienApBac','menu-bar.gif','#FFFFFF');

  (id == 'menuService') 
    ? afficheImage('lienService',"menu-info-orange.gif",'#FFFFFF')
    : afficheImage('lienService','menu-bar.gif','#FFFFFF');

  (id == 'menuAvBac') 
    ? afficheImage('lienAvBac',"menu-bac-orange.gif",'#FFFFFF')
    : afficheImage('lienAvBac','menu-bar.gif','#FFFFFF');

}



function imageOpacity(id) // affiche l'image
{
  var ie = (document.all) ? 1 :0;
  if (ie)  // pour IE
  {
    (id =='menuAccueil' || id =='menuService')  
      ? $("img-accueil-info").filters.alpha.opacity = 70
      : $("img-accueil-info").filters.alpha.opacity = 100;
    (id == 'menuAvBac') 
      ? $("img-avBac").filters.alpha.opacity = 70
      : $("img-avBac").filters.alpha.opacity=100;
    (id == 'menuApBac') 
      ? $("img-apBac").filters.alpha.opacity = 70
      : $("img-apBac").filters.alpha.opacity= 100;
    (id == 'menuActu') 
      ? $("img-actu").filters.alpha.opacity = 70
      : $("img-actu").filters.alpha.opacity = 100;
    (id == 'menuRecherche') 
      ? $("img-recherche").filters.alpha.opacity = 70
      : $("img-recherche").filters.alpha.opacity = 100;
  }
  else
  {
    (id =='menuAccueil' || id =='menuService') 
      ? $("img-accueil-info").style.opacity='0.7'
      : $("img-accueil-info").style.opacity='1';
    (id == 'menuAvBac') 
      ? $("img-avBac").style.opacity='0.7'
      : $("img-avBac").style.opacity='1';
    (id == 'menuApBac') 
      ? $("img-apBac").style.opacity='0.7'
      : $("img-apBac").style.opacity='1';
    (id == 'menuActualite') 
      ? $("img-actu").style.opacity='0.7'
      : $("img-actu").style.opacity='1';
    (id == 'menuRecherche') 
      ? $("img-recherche").style.opacity='0.7'
      : $("img-recherche").style.opacity='1';
  }
  menuSelectionner(id)
}

function vider(){
    if($('champ_rech') != null)
    {
      $('champ_rech').value="";
    }
}

// option complementaire
function afficheOption(element,image)
{
  Effect.toggle(element,'blind');
  if(image && image.length > 1)
  {
    if($(image).src == "http://www.enseignement-prive.fr/pictures/caret-d-orange.gif")
    {
      $(image).src = "http://www.enseignement-prive.fr/pictures/caret-t-orange.gif";
    }
    else
    {
      $(image).src = "http://www.enseignement-prive.fr/pictures/caret-d-orange.gif";
    }
  }
}


function unCheckAll(element,title)
{
  var lesOptions = $(element).getElementsByClassName("cadreOption");
  for(var i = 0;i<lesOptions.length;i++)
  {
    var cadreOption = lesOptions[i];
    for(var j=1;j<cadreOption.childNodes.length;j++)
    {
      var option = cadreOption.childNodes[j].id;
      if(option && option[0] == title)
      {
        unCheck(option);
      }
    }
  }
}  

function effaceOption(element)
{
  $(element).value='';
}  

function disparaisOption($element,$elementParent)
{
  //pour les select=> vide
  if($element=="optionLanguesection_eur")
  {
    element = $('section_eur');
    effaceOption(element);
  }
  if($element=="optionLanguesection_inter")
  {
    element = $('section_inter');
    effaceOption(element);
  }
  if($element=="optionLangueLV3")
  {
    element = $('LV3');
    effaceOption(element);
  }
  if($element=="optionLangueLR")
  {
    element = $('LR');
    effaceOption(element);
  }
  if($element=="optionLangueLA")
  {
    element = $('LA');
    effaceOption(element);
  }
  if($element=="optionSport")
  {
    element = $('section_sport_web');
    effaceOption(element);
  }
  if($element=="optionDeterminationseconde_generale_et_technologique")
  {
    element = $('optionSectionseconde_generale_et_technologique');
    effaceOption(element);
  }
  if($element=="coche") // le checkbox option complementaire
  {
     if($('section_eur')!=null)
     { 
       effaceOption($('section_eur'));
     }
     if($('section_inter')!=null)
     { 
       effaceOption($('section_inter'));
     }
     if($('LV3')!=null)
     { 
       effaceOption($('LV3'));
     }
     if($('LA')!=null)
     { 
       effaceOption($('LA'));
     }
     if($('LR')!=null)
     { 
       effaceOption($('LR'));
     }
     if($('section_sport_web')!=null)
     { 
       effaceOption($('section_sport_web'));
     }
     if($('poptionDetermination1')!=null)
     { 
       effaceOption($('optionSectionseconde_generale_et_technologique'));
     }
     unCheckAll($element,'p');
  }
  Effect.SwitchOff($element);
  unCheck($elementParent);  
}

function cacheOption(element)
{
  if($(element))
  {
    $(element).style.display='none';
  }
}

function unCheck(element)
{
  $(element).checked=false;
}  


function isCheck($element,$elementOpen)
{
  if($($element).checked==true)
  {
    afficheOption($elementOpen);
  }
  if($($element).checked==false)
  {
    disparaisOption($elementOpen,$element);
  }
}

function agrandirPolice()
{
  if(($('maintext').style.fontSize =='0.9em') || ($('maintext').style.fontSize == ''))
  {
     $('maintext').style.fontSize = '1.2em';
  }
  else
  {
     $('maintext').style.fontSize = '0.9em';
  }
}


function majInfoPratique(page,site,cycle)
{
  new Ajax.Updater('infoPratique','http://www.enseignement-prive.fr/clude/majInfoPratique.php',
  {
    method:'post',
    parameters:$H({page:page,cycle:cycle,site:site})
  });
}

-->
