function resize()
{
   var conteneur = document.getElementById('conteneur');
   var heightConteneur = parseInt(conteneur.scrollHeight);
   var main = document.getElementById('main');
   var heightMain = parseInt(main.scrollHeight);
   var colonneGauche = document.getElementById('colonne-gauche');
   var heightColonneGauche = parseInt(colonneGauche.scrollHeight);
   var colonneGaucheBas = document.getElementById('colonne-gauche-bas');
   var heightColonneGaucheBas = parseInt(colonneGaucheBas.scrollHeight);
   var colonneDroite = document.getElementById('colonne-droite');
   var heightColonneDroite = parseInt(colonneDroite.scrollHeight);
   var colonneDroiteBas = document.getElementById('colonne-droite-bas');
   var heightColonneDroiteBas = parseInt(colonneDroiteBas.scrollHeight);
   var colonneMilieu = document.getElementById('colonne-milieu');
   var heightColonneMilieu = parseInt(colonneMilieu.scrollHeight);
	
   var colonneMilieuRepeat = document.getElementById('colonne-milieu-repeat');
   var heightColonneMilieuRepeat = parseInt(colonneMilieuRepeat.scrollHeight);
   var colonneMilieuHaut = document.getElementById('colonne-milieu-haut');
   var heightColonneMilieuHaut = parseInt(colonneMilieuHaut.scrollHeight);
   var colonneMilieuBas = document.getElementById('colonne-milieu-bas');
   var heightColonneMilieuBas = parseInt(colonneMilieuBas.scrollHeight);
   var scroller = document.getElementById('scroller');
   if( scroller != null ) var heightScroller = parseInt(scroller.scrollHeight);
   var elevUp = document.getElementById('elevUp');
   if( elevUp != null ) var heightElevUp = parseInt(elevUp.scrollHeight);
   var elevDn = document.getElementById('elevDn');
   if( elevDn != null ) var heightElevDn = parseInt(elevDn.scrollHeight);
   var scrollbarGlobal = document.getElementById('scrollbarGlobal');
   if( scrollbarGlobal != null ) var heightScrollbarGlobal = parseInt(scrollbarGlobal.scrollHeight);
   var scrollbar = document.getElementById('scrollbar');
   if( scrollbar != null ) var heightScrollbar = parseInt(scrollbar.scrollHeight);
   var scrollerMo5Shim = document.getElementById('scrollerMo5Shim');
   var container = document.getElementById('container');
   if( container != null ) var heightContainer = parseInt(container.scrollHeight);
   var content = document.getElementById('content');
   if( content != null ) var heightContent = parseInt(content.scrollHeight);
	
   var heightBody = parseInt(document.body.clientHeight);
   height = heightBody;
	
   if( heightBody < 673 )
   {
      height = 673;
   }
	
   conteneur.style.height = height + 'px';
   main.style.height = ( height - 223 ) + 'px';
   colonneGauche.style.height = ( height - 223 ) + 'px';
   colonneGaucheBas.style.height = ( height - 223 ) + 'px';
   colonneDroite.style.height = ( height - 223 ) + 'px';
   colonneDroiteBas.style.height = ( height - 223 ) + 'px';
   colonneMilieu.style.height = ( height - 223 ) + 'px';
	
	if( scrollbar != null && scrollerMo5Shim != null && container != null && content != null )
	{
		if( heightContent <= 354 ) // 354 = 673 - 319
		{
			colonneMilieuRepeat.style.height = '420px';
			colonneMilieuHaut.style.height = '420px';
			colonneMilieuBas.style.height = '380px';
			scroller.style.height = '354px';
			scrollbarGlobal.style.display = 'none';
			elevUp.style.height = '334px';
			elevDn.style.height = '334px';
			scrollerMo5Shim.style.display = 'none';
			container.className = 'no-scroller';
			container.style.height = '354px';
			content.className = 'no-scroller';
		}
		else if( heightContent <= height - 319 )
		{
		   colonneMilieuRepeat.style.height = ( heightContent + 66 ) + 'px';
		   colonneMilieuHaut.style.height = ( heightContent + 66 ) + 'px';
		   colonneMilieuBas.style.height = ( heightContent + 26 ) + 'px';
			scroller.style.height = heightContent + 'px';
			scrollbarGlobal.style.display = 'none';
			elevUp.style.height = '0px';
			elevDn.style.height = ( heightContent - 20 ) + 'px';
			scrollerMo5Shim.style.display = 'none';
			container.className = 'no-scroller';
			container.style.height = heightContent + 'px';
			content.className = 'no-scroller';
		}
		else
		{
		   colonneMilieuRepeat.style.height = ( height - 253 ) + 'px';
		   colonneMilieuHaut.style.height = ( height - 253 ) + 'px';
		   colonneMilieuBas.style.height = ( height - 293 ) + 'px';
			scroller.style.height = ( height - 319 ) + 'px';
			scrollbarGlobal.style.height = ( height - 319 ) + 'px';
			scrollbarGlobal.style.display = '';
			scrollbar.style.height = (scrollbarGlobal.scrollHeight-20) + 'px';
			elevUp.style.height = '0px';
			elevDn.style.height = ( height - 339 ) + 'px';
			scrollerMo5Shim.style.display = 'block';
			container.className = 'scroller';
			container.style.height = ( height - 319 ) + 'px';
			content.className = 'scroller';
		}
		var scroll = new Scroller('');
		scroll.init();
	}
}

function openMenu(index, cpt)
{
   var contentHeightAnimationMenu = document.getElementById('animation-menu-'+index).offsetHeight;
	
   if (contentHeightAnimationMenu != 12 && cpt+0 == contentHeightAnimationMenu)
   {
		document.getElementById('animation-menu-'+index).style.height = (contentHeightAnimationMenu+1) + 'px';
      setTimeout("openMenu('" + index + "', " + (cpt+1) + ")", 30);
   }
}

function closeMenu(index)
{
   var contentHeightAnimationMenu = document.getElementById('animation-menu-'+index).offsetHeight;
	
   if (contentHeightAnimationMenu != 0)
   {
		document.getElementById('animation-menu-'+index).style.height = (contentHeightAnimationMenu-1) + 'px';
      setTimeout("closeMenu('" + index + "')", 30);
   }
}

function openMenuLangues(index, cpt)
{
	var contentHeightAnimationMenuLangues = document.getElementById('animation-menu-langues-'+index).offsetHeight;
	
	if (contentHeightAnimationMenuLangues != 24 && cpt+16 == contentHeightAnimationMenuLangues)
   {
		document.getElementById('animation-menu-langues-'+index).style.height = (contentHeightAnimationMenuLangues+1) + 'px';
		document.getElementById('animation-menu-langues-'+index).style.marginTop = ((24-contentHeightAnimationMenuLangues)-1) + 'px';
      setTimeout("openMenuLangues('" + index + "', " + (cpt+1) + ")", 30);
   }
}

function closeMenuLangues(index)
{
   var contentHeightAnimationMenuLangues = document.getElementById('animation-menu-langues-'+index).offsetHeight;
	
   if (contentHeightAnimationMenuLangues != 16)
   {
		document.getElementById('animation-menu-langues-'+index).style.height = (contentHeightAnimationMenuLangues-1) + 'px';
		document.getElementById('animation-menu-langues-'+index).style.marginTop = ((24-contentHeightAnimationMenuLangues)+1) + 'px';
      setTimeout("closeMenuLangues('" + index + "')", 30);
   }
}

function openVignette(index, cpt)
{
	var contentHeightVignette = document.getElementById('vignette-'+index).offsetHeight;
	
	if (contentHeightVignette != 48 && cpt+0 == contentHeightVignette)
   {
		document.getElementById('vignette-'+index).style.height = (contentHeightVignette+1) + 'px';
		document.getElementById('vignette-'+index).style.marginTop = ((48-contentHeightVignette)-1) + 'px';
      setTimeout("openVignette('" + index + "', " + (cpt+1) + ")", 20);
   }
}

function containsDOM(aoContainer, aoContainee)
{
   var isParent = false;
   do
   {
      if ((isParent = aoContainer == aoContainee))
      {
         break;
      }
      aoContainee = aoContainee.parentNode;
   }
   while (aoContainee != null);
   return isParent;
}

function checkMouseEnter(aoContainer, aoEvt)
{
   if (aoContainer.contains && aoEvt.fromElement)
   {
      return !aoContainer.contains(aoEvt.fromElement);
   }
   else if (aoEvt.relatedTarget)
   {
      return !containsDOM(aoContainer, aoEvt.relatedTarget);
   }
}

function checkMouseLeave(aoContainer, aoEvt)
{
   if (aoContainer.contains && aoEvt.toElement)
   {
      return !aoContainer.contains(aoEvt.toElement);
   }
   else if (aoEvt.relatedTarget)
   {
      return !containsDOM(aoContainer, aoEvt.relatedTarget);
   }
}

