function resize()
{
   var conteneur = document.getElementById('conteneur');
   var heightConteneur = parseInt(conteneur.scrollHeight);
	
   var main = document.getElementById('main');
   var heightMain = parseInt(main.scrollHeight);
	
   var mainGauche = document.getElementById('main-gauche');
   var heightMainGauche = parseInt(mainGauche.scrollHeight);
	
   var mainDroite = document.getElementById('main-droite');
   var heightMainDroite = parseInt(mainDroite.scrollHeight);
	
   var mainMilieu = document.getElementById('main-milieu');
   var heightMainMilieu = parseInt(mainMilieu.scrollHeight);
	
   var scroller = document.getElementById('scroller');
   var heightScroller = parseInt(scroller.scrollHeight);
	
   var scrollbarGlobal = document.getElementById('scrollbarGlobal');
   if( scrollbarGlobal != null ) var heightScrollbarGlobal = parseInt(scrollbarGlobal.scrollHeight);
	
   var scrollbar = document.getElementById('scrollbar');
   if( scrollbarGlobal != null ) var heightScrollbar = parseInt(scrollbar.scrollHeight);
	
   var elevUp = document.getElementById('elevUp');
   if( scrollbarGlobal != null ) var heightElevUp = parseInt(elevUp.scrollHeight);
	
   var elevDn = document.getElementById('elevDn');
   if( scrollbarGlobal != null ) var heightElevDn = parseInt(elevDn.scrollHeight);
	
   var scrollerMo5Shim = document.getElementById('scrollerMo5Shim');
	
   var container = document.getElementById('container');
   var heightContainer = parseInt(container.scrollHeight);
	
   var content = document.getElementById('content');
   var heightContent = parseInt(content.scrollHeight);
	
   var heightBody = parseInt(document.body.clientHeight);
   height = heightBody;
	
   if( heightBody < 700 )
   {
      height = 700;
   }
	
	if( scrollbarGlobal != null )
	{
		if( heightContent <= 340 ) // 340 = 700 - ( 140 + 75 + 35*3 + 20*2 )
		{
			conteneur.style.height = '700px';
		   main.style.height = '485px';
		   mainGauche.style.height = '485px';
		   mainDroite.style.height = '485px';
		   mainMilieu.style.height = '485px';
			scroller.style.height = '340px';
			scrollbarGlobal.style.display = 'none';
			elevUp.style.height = '320px';
			elevDn.style.height = '320px';
			scrollerMo5Shim.style.display = 'none';
			container.className = 'no-scroller';
			container.style.height = '340px';
			content.className = 'no-scroller';
		}
		else if( heightContent <= height - 320 ) // 320 = 140 + 75 + 35*3
		{
			conteneur.style.height = ( heightContent + 320 ) + 'px';
		   main.style.height = ( heightContent + 105 ) + 'px';
		   mainGauche.style.height = ( heightContent + 105 ) + 'px';
		   mainDroite.style.height = ( heightContent + 105 ) + 'px';
		   mainMilieu.style.height = ( heightContent + 105 ) + '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
		{
			conteneur.style.height = height + 'px';
		   main.style.height = ( height - 215 ) + 'px';
		   mainGauche.style.height = ( height - 215 ) + 'px';
		   mainDroite.style.height = ( height - 215 ) + 'px';
		   mainMilieu.style.height = ( height - 215 ) + 'px';
			scroller.style.height = ( height - 360 ) + 'px';
			scrollbarGlobal.style.height = ( height - 360 ) + 'px';
			scrollbarGlobal.style.display = 'block';
			scrollbar.style.height = ( scrollbarGlobal.scrollHeight - 20 ) + 'px';
			elevUp.style.height = '0px';
			elevDn.style.height = ( height - 380 ) + 'px';
			scrollerMo5Shim.style.display = 'block';
			container.className = 'scroller';
			container.style.height = ( height - 360 ) + 'px';
			content.className = 'scroller';
		}
		
		var scroll = new Scroller('');
		scroll.init();
	}
}

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);
   }
}
