// champs obligatoires
function checkrequiredfields() 
{
  for(i=0; i < checkrequiredfields.arguments.length; i++)
  {
    if (document.main.elements[checkrequiredfields.arguments[i]].value == "") 
    {
      alert("Mandatory field ");
      document.main.elements[checkrequiredfields.arguments[i]].focus();
      return false;
    }
  }
  return true;
}


// menu 
sfHover = function() 
{
  if (document.getElementById("menu")) 
  {
    var ellt = document.getElementById("menu").getElementsByTagName("li");
    for (var i=0; i<ellt.length; i++) 
    {
      ellt[i].onmouseover=function() 
      {
        this.className+=" sfhover";
      }
      ellt[i].onmouseout=function() 
      {
        this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
      }
    }
  }
}
if (window.attachEvent) 
{
    window.attachEvent("onload", sfHover);
}

function getSwf(id, src, width, height, color) 
{
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" id="' + id + '" align="middle">\n');
  document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
  document.write('<param name="movie" value="' + src + '" />\n');
  document.write('<param name="quality" value="high" />\n');
  document.write('<param name="wmode" value="transparent" />\n');
  document.write('<param name="bgcolor" value="' + color + '" />\n');
  document.write('<embed src="' + src + '" quality="high" wmode="transparent" bgcolor="' + color + '" width="' + width + '" height="' + height + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
  document.write('</object>\n');
}

function newsletter_inscription()
{
  document.inscription_newsletter.isposted.value = 1;
  document.inscription_newsletter.submit();
}


function getElementsByClassName(className) {
  className = " " + className + " ";
  var a = [];
  var els = document.getElementsByTagName("*");
  for ( var i = 0, j = els.length ; i < j ; i++ ) {
    if ((" "+els.item(i).className+" ").indexOf(className) != -1)
      a.push(els.item(i));
  }
  return a;
}

