// JavaScript Document
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------

function NouvWin(nUrl,nNom,w,h,nScroll)
  {
  var winl = (screen.width) ? (screen.width-w)/2 : 0;
  var wint = (screen.height) ? (screen.height-h)/2 : 0;
  var options = 'width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars='+nScroll+',resizable=no';
 // var options = 'width='+w+',height='+h+',top='+wint+',left='+winl+',scrollbars=1,resizable=no';
  ViewProduit=window.open(nUrl,nNom,options);
  if(ViewProduit.window.focus)
    {
    ViewProduit.window.focus();
    }
  };
function getWindowHeight() 
  {
  var windowHeight = 0;
  if (typeof(window.innerHeight) == 'number') 
    {
  	windowHeight = window.innerHeight;
  	}
  else 
    {
  	if (document.documentElement && document.documentElement.clientHeight) 
      {
  		windowHeight = document.documentElement.clientHeight;
  		}
  	else 
      {
  		if (document.body && document.body.clientHeight)   
        {
  			windowHeight = document.body.clientHeight;
  		  }
  	  }
    }
  return windowHeight;
  };
  
// -----------------------------------------------------------------------------
function setFooter() 
  {
  if (document.getElementById) 
    {
    var windowHeight=getWindowHeight();
    if (windowHeight>0) 
      {
      var contentElement=document.getElementById('contenu');
      var princElement=document.getElementById('principal');
      var contentHeight= contentElement.offsetHeight;

      var footerElement=document.getElementById('pied');
      var footerHeight=footerElement.offsetHeight;

      var headerElement=document.getElementById('menu');
      var headerHeight=headerElement.offsetHeight;

      var leftElement=document.getElementById('gauche');
      var leftHeight=leftElement.offsetHeight;
      
      if (windowHeight > 600) 
        {
        princElement.style.height = (windowHeight)+'px';
     		contentElement.style.height = (windowHeight - (footerHeight + headerHeight))+'px';
        footerElement.style.top = ( windowHeight - footerHeight)+'px'; 	  
 				}
			else 
        {
        princElement.style.height = '600px';
				contentElement.style.height = (leftHeight)+'px';
        footerElement.style.top = (leftHeight + headerHeight)+'px'; 	  
			  }
      }
    }
  }; 
  
    
// -----------------------------------------------------------------------------
function champsok()
  {
  if (document.formulaire.nom.value.length == 0 || document.formulaire.prenom.value.length == 0 || document.formulaire.email.value.length == 0 | document.formulaire.demande.value.length == 0)
    {
    alert("Veuillez remplir tous les champs signalés par un astérisque *.");
    return false;
    }
  return true;
  };

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
function setPosClient() 
  {
/*	if (document.getElementById) 
    {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) 
      {
			var contentElement = document.getElementById('contenu');
			var footerElement = document.getElementById('pied');


      var hauteur_gche = 461;
      var hauteur_haut = 87;
      var hauteur_bas = 52;
      
			if (windowHeight >= 600) 
        {
     		contentElement.style.height = (windowHeight - hauteur_bas - hauteur_haut).'px';
        footerElement.style.top = ( windowHeight - hauteur_bas)+'px'; 	  
 				}
			else 
        {
				contentElement.style.height = (hauteur_gche - contentPadding)+'px';
        footerElement.style.top = (hauteur_gche + hauteur_haut)+'px'; 	  
			  }
		  }
	  }
*/  };
// -----------------------------------------------------------------------------
function setPosAdmin() 
  {
/*	if (document.getElementById) 
    {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) 
      {
			var principalElement = document.getElementById('principal');
			var leftElement = document.getElementById('gauche');
			var contentElement = document.getElementById('centre');

      var hauteur_gche = windowHeight-40;
      
			if (windowHeight >= 600) 
        {
     		globalElement.style.height = windowHeight + 'px';
     		leftElement.style.height = hauteur_gche + 'px';
     		contentElement.style.height = hauteur_gche + 'px';
 				}
			else 
        {
     		globalElement.style.height = '600px';
     		leftElement.style.height = '552px';
     		contentElement.style.height = '552px';
			  }
		  }
	  }
  */};
