/**
 * @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 = '650px';
 if (iframeElement.name=="iframeName2") iframeElement.style.width = '780px';
   
    if(iframeWindow.document.height < iframeWindow.document.documentElement.scrollHeight )
        {
            if  	(iframeWindow.document.documentElement.scrollHeight < 500)
            {
                //console.log("entrée étape 1.2.1 : iframeWindow.document.documentElement.scrollHeight+ 5=" + iframeWindow.document.documentElement.scrollHeight +'px');
             iframeElement.style.height  ='1000px';
		     
            }
            else
            {
            //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 =" + 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';
  

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

           // iframeElement.style.width = '650px';
        if (iframeElement.name=="iframeName2") iframeElement.style.width = '865px';
    }
    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';
    

      //   iframeElement.style.width = '650px';
        if (iframeElement.name=="iframeName2") iframeElement.style.width = '780px';
    }
  }
 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 = '780px';
    }
    else
    {
  	document.getElementById('iframeName').style .height =iframeWindow.document.documentElement.scrollHeight+ 5 +'px';
  	//document.getElementById('iframeName').style.width = '650px';
  	}
  	
   
  }
     
    
  
 //console.log("sortie");
 
}
