/**
 * @author dcodron
 */
function adjustIFrameSize (iframeWindow) {
console.log("entrée code");
  if (iframeWindow.document.height) {
console.log("entrée étape 1 : iframeWindow.document.height=" + iframeWindow.document.height);
    var iframeElement = document.getElementById(iframeWindow.name);
  
   iframeElement.style.width = '572px';
 if (iframeElement.name=="iframeName2") iframeElement.style.width = '755px';
   
    if(iframeWindow.document.height < iframeWindow.document.documentElement.scrollHeight )
        {  	
        console.log("entrée étape 1.2 : iframeWindow.document.documentElement.scrollHeight+ 5=" + iframeWindow.document.documentElement.scrollHeight +'px');
         iframeElement.style.height  =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
		 document.getElementById('divDrte').style .height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
     		document.getElementById('divGche').style .height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
			
        }
		else
		{ 
		      console.log("entrée étape 1.3 : iframeWindow.document.height =" + iframeWindow.document.height + 'px');
		    iframeElement.style.height = iframeWindow.document.height + 'px';
            document.getElementById('divDrte').style .height =iframeWindow.document.height + 'px';
             document.getElementById('divGche').style .height =iframeWindow.document.height + 'px';
    
            // iframeElement.style.width = iframeWindow.document.width + 'px';
         document.getElementById('bottom').style.marginTop = iframeWindow.document.height + 'px';
    }
  }
  
  else if (document.all) {
console.log("entrée étape 2 : document.all");
    var iframeElement = document.all[iframeWindow.name];
    if (iframeWindow.document.compatMode &&
        iframeWindow.document.compatMode != 'BackCompat') 
    {
        console.log("entrée étape 2.2 : iframeWindow.document.documentElement.scrollHeight + 5 =" + iframeWindow.document.documentElement.scrollHeight  + 'px');
      iframeElement.style.height = 
      iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
       document.getElementById('divDrte').style .height =iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
      document.getElementById('divGche').style .height =iframeWindow.document.documentElement.scrollHeight + 5 + 'px';

             // iframeElement.style.width = 
            //iframeWindow.document.documentElement.scrollWidth + 5 + 'px';

            iframeElement.style.width = '570px';
        if (iframeElement.name=="iframeName2") iframeElement.style.width = '855px';
    }
    else 
    {
        console.log("entrée étape 2.3 : iframeWindow.document.body.scrollHeight + 5 + 'px'=" +iframeWindow.document.body.scrollHeight + 'px');
      iframeElement.style.height = 
        iframeWindow.document.body.scrollHeight + 5 + 'px';
    document.getElementById('divDrte').style .height =iframeWindow.document.body.scrollHeight + 5 + 'px';
    document.getElementById('divGche').style .height =iframeWindow.document.body.scrollHeight + 5 + 'px';

     // iframeElement.style.width = 
//iframeWindow.document.body.scrollWidth + 5 + 'px';

         iframeElement.style.width = '570px';
        if (iframeElement.name=="iframeName2") iframeElement.style.width = '770px';
    }
  }
 else
 {  
  var iframeElement = document.getElementById(iframeWindow.name);
  console.log("entrée étape 3 : iframeWindow.document.documentElement.scrollHeight+ 5 +'px'=" + iframeWindow.document.documentElement.scrollHeight +'px');
    if (iframeElement.name=="iframeName2"||document.getElementById('iframeName2'))
    {
        document.getElementById('iframeName2').style .height =iframeWindow.document.documentElement.scrollHeight+ 455 +'px';
    	document.getElementById('iframeName2').style.width = '770px';
    }
    else
    {
  	document.getElementById('iframeName').style .height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
  	document.getElementById('iframeName').style.width = '570px';
  	}
  	
    document.getElementById('divDrte').style .height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
    document.getElementById('divGche').style .height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
     
     document.getElementById('bottom').style.marginTop  = iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
  }
     
    
  
 console.log("sortie");
   console.log(iframeElement.name +"  "+iframeElement.style.width+" " +document.getElementById('iframeName2').style .height);
}