window.onload=function(){loadInS();};

function loadInS()
{
  // partie menu 3 case bas, prestation
  var o_dom=document.getElementById('contenuB');
  if (o_dom!==null)
  {
    var o_noeud=noeudEnfant(o_dom);
    var o_menuPrestationSel=document.getElementById('menuPreSel');
    for (i=0,n=o_noeud.length;i<n;i++)
    {
      o_noeud[i].enfant=premierEnfant(o_noeud[i]);
      o_noeud[i].tpHref=o_noeud[i].enfant.href;
      if (o_menuPrestationSel!==null && o_menuPrestationSel.href===o_noeud[i].tpHref)
      {
        o_noeud[i].className='menuPreHover';
        o_noeud[i].style.cursor='text';
        o_noeud[i].enfant.style.cursor='text';
        o_noeud[i].enfant.onclick=function()
        {
          return false;
        };
      }
      else
      {
        o_noeud[i].onclick=function()
        {
          window.location.href=this.tpHref;
        };
        o_noeud[i].onmouseover=function()
        {
          this.className='menuPreHover';
        };
        o_noeud[i].onmouseout=function()
        {
          this.className='';
        };
      }
    }
  }
  
  // offre spéciale, bouton over
  o_dom=document.getElementById('offre');
  if (o_dom!==null)
  {
    o_dom.tpHref=premierEnfant(o_dom).href;
    o_dom.onclick=function()
    {
      window.location.href=this.tpHref;
    };
    o_dom.onmouseover=function()
    {
      this.className='offreHover';
    };
    o_dom.onmouseout=function()
    {
      this.className='';
    };
  }

  // bouton over formulaire devis
  o_dom=document.getElementById('valFormDev');
  if (o_dom!==null)
  {
    o_dom=premierEnfant(o_dom);
    var s_src=o_dom.src;
    var s_newSrc=s_src.substring(0,s_src.lastIndexOf("/"));
    o_dom.onmouseover=function()
    {
      this.src=s_newSrc+'/fdValdevis.png';
    };
    o_dom.onmouseout=function()
    {
      this.src=s_src;
    };
  }

  // techno web, bouton over
  o_dom=document.getElementById('tecnoWeb');
  if (o_dom!==null)
  {
    o_dom.tpHref=premierEnfant(o_dom).href;
    o_dom.onclick=function()
    {
      window.location.href=this.tpHref;
    };
    o_dom.onmouseover=function()
    {
      this.className='tecnoWebHover';
    };
    o_dom.onmouseout=function()
    {
      this.className='';
    };
  }

  
  // anti robot mailto, création lien mailto
  o_dom=document.getElementById('antirb');
  if (o_dom!==null)
  {
    o_dom=premierEnfant(o_dom);
    var s_src=o_dom.src;
    var s_newSrc=s_src.substring(0,s_src.lastIndexOf("/"));
    o_dom.onmouseover=function()
    {
      this.src=s_newSrc+'/fdValdevis.png';
    };
    o_dom.onmouseout=function()
    {
      this.src=s_src;
    };
  }
  
  o_dom=document.getElementById('slideRef');
  if (o_dom!==null)
  {
    L=0;c='#mSelRef';d='# ';X='playerRef';b='menuRef';I=false;J=true;R=5;S=1.4;V=30;W=0;D=60;E=30;A('slideRef');
  }

}

function noeudEnfant(o_noeud)
{
  var o_noeud=o_noeud.childNodes;
  var o_nwNoeud=new Array(), j=0;
  for (i=0,n=o_noeud.length;i<n;i++)
  {
    if (typeof o_noeud[i].innerHTML!=='undefined') // gestion des blocks ou image
    {
      o_nwNoeud[j]=o_noeud[i];
      j++;
    }
  }
  return o_nwNoeud;
}

function premierEnfant(o_noeud)
{
  o_noeud=o_noeud.firstChild;
  if (o_noeud)
  {
    if (typeof o_noeud.innerHTML!=='undefined')
      return o_noeud;
    else
      return noeudSuivant(o_noeud);
  }
  else
    return false;
}

function noeudSuivant(o_noeud)
{
  o_noeud=o_noeud.nextSibling;
  if (o_noeud)
  {
    if (typeof o_noeud.innerHTML!=='undefined')
      return o_noeud;
    else
      return noeudSuivant(o_noeud);
  }
  else
    return false;
}
