function retaille()

{
  var divNavgauche = document.getElementById('navgauche');
  var divIntLeft = document.getElementById('intleft');
  var divIntRight = document.getElementById('intright');
  

  heightdivIntLeft = divIntLeft.offsetHeight;
  heightdivIntRight = divIntRight.offsetHeight;
  heightNavgauche = divNavgauche.offsetHeight;
  
  
  if ( ((heightdivIntLeft < 380) && (heightdivIntRight < 380)) )
  {
  				document.getElementById('navgauche').style.height = 380 +'px';
  				document.getElementById('navssrub').style.height = 380 +'px';
  				document.getElementById('intright').style.height = 380 - 50 +'px';
  }
  else{
   if ( heightdivIntLeft < 380)
   	{
   		if ( heightdivIntLeft < heightdivIntRight)
   			{
   				//alert ('droit plus grand');
  				document.getElementById('navgauche').style.height = heightdivIntRight +'px';
  				document.getElementById('navssrub').style.height = heightdivIntRight +'px';
  				document.getElementById('intright').style.height = heightdivIntRight - 50 +'px';
   			}
  		else
  			{
  				//alert ('droit plus petit');
   				document.getElementById('navgauche').style.height = 380 +'px';
  				document.getElementById('navssrub').style.height = 380 +'px';
  				document.getElementById('intright').style.height = 380 - 50 +'px';
			}
	}
   else
	{
		if (heightdivIntLeft > heightdivIntRight)
			{
				//document.getElementById('contenupi').style.height = heightdivIntLeft +'px';
  				document.getElementById('navgauche').style.height = heightdivIntLeft +'px';
  				document.getElementById('navssrub').style.height = heightdivIntLeft +'px';
  				document.getElementById('intright').style.height = heightdivIntLeft - 50 +'px';
			}
			else
			{
        //document.getElementById('contenupi').style.height = heightdivIntRight +'px';
  				document.getElementById('navgauche').style.height = heightdivIntRight +'px';
  				document.getElementById('navssrub').style.height = heightdivIntRight +'px';
  				document.getElementById('intright').style.height = heightdivIntRight - 50 +'px';
      }
	}}
}


//here you place the ids of every element you want.
var ids=new Array('sr1','sr2','sr3','sr4','sr5');

function switchid(id, newclass){	
	hideallids();
	showdiv(id);
	document.getElementById('navssrub').className=newclass;
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

