function placementHeight(id,top,bottom) {
  var bodyHeight = 0;
  var myHeight = 0;
  var e = document.getElementById(id);

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    bodyHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    bodyHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    bodyHeight = document.body.clientHeight;
  }

  myHeight = bodyHeight - top - bottom ;

  e.style.top    = top+"px";
  e.style.height = myHeight+"px";

  if (detectIeMac()){
    document.getElementById('footer').style.top = (myHeight+top+15)+"px";
  }
}

function detectIeMac() {

  var my_agent = navigator.userAgent.toLowerCase();
  var my_mac   = my_agent.indexOf("mac");
  var my_nav   = my_agent.indexOf("msie");

  if (my_mac != -1 && my_nav != -1) {
    return true
  } else return false
}

function newsInscription(text1,text2) {
  if (document.getElementById("inscription").innerHTML == text1){
    document.getElementById("inscription").innerHTML = text2;}
  else{ document.getElementById("inscription").innerHTML = text1;}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function montre(id1, id2, imageoff, imageone, exceptionid, imageoffexception) {

  var e = document.getElementById(id1);
  if (document.getElementById(id2)){
    var d = document.getElementById(id2);
  }

  for (var i = 1; i<=10; i++) {
    if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
    if (document.getElementById('menu'+i)) {
      document.getElementById('menu'+i).style.background='url('+imageoff+')';
      document.getElementById('menu'+i).style.filter = 'alpha(opacity=100,style=0)';
      if(detectIeMac()) document.getElementById('menu'+i).style.paddingTop='0';
    }
  }
  if (document.getElementById(exceptionid)) {
    document.getElementById(exceptionid).style.background='url('+imageoffexception+')';
  }
  if (d) {
    d.style.display='block';
  }
  if (e) {
    e.style.background='url('+imageone+')';
    e.style.backgroundPosition='left bottom';
    e.style.filter = 'alpha(opacity=90,style=0)';
  }

}

function popupGal(popup_name,parametres,url,title,fermer,type,erreure) {
  var popup_name;
  var parametres;
  var url;
  var title;
  var fermer;
  var type;
  var erreur;

  var posHeight = parametres.search(",height");
  var posMenubar = parametres.search(",menubar");

  var width = (parametres.substring(6, posHeight));
  var height = parametres.substring(posHeight + 8, posMenubar);

  pop = window.open("",popup_name,parametres);

  pop.document.write("<html lang=\"fr\">\n");
  pop.document.write("<head>\n");
  pop.document.write("<Title>");
  pop.document.write(title);
  pop.document.write("</Title>\n");
  pop.document.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n");
  pop.document.write("<link rel=\"StyleSheet\" href=\"principal.css\" type=\"text/css\">\n");
  pop.document.write("</head>\n");
  pop.document.write("<body>\n");
  if (type == "GAL_IMAGES") {
      pop.document.write("<a href=\"");
      pop.document.write("#");
      pop.document.write("\" onclick=\"");
      pop.document.write("self.close();return false;");
      pop.document.write("\" title=\""+fermer+"\" width='"+width+"' height='"+height+"'>\n");
      pop.document.write("<img src="+url+" alt=\"\" title=\"\" />\n");
      pop.document.write("</a>\n");
  } else {
      pop.document.write("<div>\n");
      pop.document.write("  <object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" standby=\"Chargement de QuickTime ActiveX\" width=\""+width+"\" height=\""+height+"\">\n");
      pop.document.write("    <param name=\"src\" value=\""+url+"\" />\n");
      pop.document.write("    <param name=\"controller\" value=\"true\" />\n");
      pop.document.write("    <param name=\"autoplay\" value=\"true\" />\n");
      pop.document.write("    <param name=\"type\" value=\"video/quicktime\" />\n");
      pop.document.write("    <param name=\"height\" value=\""+height+"\" />\n");
      pop.document.write("    <param name=\"width\" value=\""+width+"\" />\n");
      pop.document.write("    <param name=\"scale\" value=\"tofit\" />\n");
      pop.document.write("    <object type=\"video/quicktime\" data=\""+url+"\" width=\""+width+"\" height=\""+height+"\" class=\"mov\">\n");
      pop.document.write("      <param name=\"controller\" value=\"true\" />\n");
      pop.document.write("      <param name=\"pluginspage\" value=\"http://www.apple.com/quicktime/download/index.html\">\n");
      pop.document.write("      <param name=\"autoplay\" value=\"true\" />\n");
      pop.document.write("      <param name=\"type\" value=\"video/quicktime\" />\n");
      pop.document.write("      <param name=\"height\" value=\""+height+"\" />\n");
      pop.document.write("      <param name=\"width\" value=\""+width+"\" />\n");
      pop.document.write("      <param name=\"scale\" value=\"tofit\" />\n");
      pop.document.write("      <param name=\"src\" value=\""+url+"\" />\n");
      pop.document.write("      <p>"+erreure+"<p>\n");
      pop.document.write("    </object>\n");
      pop.document.write("  </object>\n");
      pop.document.write("</div>\n");
  }
  pop.document.write("</BODY>\n");
  pop.document.write("</HTML>\n");
  pop.document.close();
}

function repositionnement(conteneur){
  if(detectIeMac()){
    document.getElementById(conteneur).style.marginTop='-240px';
  }
}