/**
 * @author dcodron
 */
function adjustIFrameSize (iframeWindow, MyWidth) {
console.log("entrée code");
if (MyWidth)
{
    console.log("entrée étape MyWidth : iframeWindow.document.height=" + iframeWindow.document.height);
    var iframeElement = document.getElementById(iframeWindow.name);
    iframeElement.style.height  =MyWidth + 'px';
}
else  if (iframeWindow.document.height) {
console.log("entrée étape 1 : iframeWindow.document.height=" + iframeWindow.document.height);
    var iframeElement = document.getElementById(iframeWindow.name);
    
    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';         

			
        }
		else{ 
		      console.log("entrée étape 1.3 : iframeWindow.document.height + 'px'=" + iframeWindow.document.height + 'px');
		iframeElement.style.height = 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'; 

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

    }
  }
 else{  
  console.log("entrée étape 3 : iframeWindow.document.documentElement.scrollHeight+ 5 +'px'=" + iframeWindow.document.documentElement.scrollHeight +'px');
  console.log("entrée étape 3 bis : iframeWindow.document.body.scrollHeight +'px'=" + iframeWindow.document.body.scrollHeight +'px');
  console.log("entrée étape 3 bis bis : iframeWindow.document.body.scrollHeight +'px'=" + iframeWindow.document.body.scrollHeight +'px');
  try
  {console.log("End page = " + iframeWindow.document.getElementById("EndPage").style.top +'px');}
  catch(err){}
  

  	document.getElementById('iframeName2').style.height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
     }
     
    
  
 console.log("sortie");
  
}

function adjustIFrameSize2 (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);
   
    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';		
			
        }
		else{ 
		      console.log("entrée étape 1.3 : iframeWindow.document.height + 'px'=" + iframeWindow.document.height + 'px');
		iframeElement.style.height = iframeWindow.document.height + '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';
    }
    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';

    }
  }
 else{  
  console.log("entrée étape 3 : iframeWindow.document.documentElement.scrollHeight+ 5 +'px'=" + iframeWindow.document.documentElement.scrollHeight +'px');

  	document.getElementById('iframeName2').style.height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';    
     }
     
    
  
 console.log("sortie");
  
}
