	function iFrameHeight(iFrame, kMin)
	 {  //alert('start iFrameHeight iFrame:' + iFrame.id + ' kMin:' + eval(kMin)); 
		var h = 0;
		var kMin=390;    /* minim a posar*/
		var  hini;
		var sTxt="name:"+ iFrame.name+" " +iFrame.id;
		var bIE9 =false; 
      if (window.msPerformance != null) {bIE9 =true;}
	  if (window.performance != null) {bIE9 =true;}
	  // alert('msg01 bIE9:'+eval(bIE9));
	  if (!bIE9)
	   {if ( !document.all ) // Firefox  
				  {//alert('msg00');
				   sTxt = sTxt + ' FF ';
				   iFrame.height= kMin ;
				   hIni=iFrame.height;
				   h=iFrame.contentDocument.body.scrollHeight ;
				   sTxt = sTxt + " Firefox h:"+ eval(h) + " hIni:" + eval(hIni);
				   if (h==0)
					{h = hIni;
					 //alert("FF name:"+ iFrame.name+" " +iFrame.id+ " h:"+h);
					}
				  } 
		     else if( document.all ) // IEx  
				 {//alert("iFrameHeight IEx"+ iFrame.name);  
				  iFrame.height= kMin;
				  sTxt = sTxt + ' IEx ';
				  hIni=iFrame.height;
				  h = document.frames(iFrame.id).document.body.scrollHeight;
				  if (h==0)
					{h = hIni;
					  // alert("IE name:"+ iFrame.name+" " +iFrame.id+ " h:"+h);
					}
				  sTxt = sTxt + " IEx h:"+  eval(h)+ " hIni:" + eval(hIni);
				 }
			  if (h<kMin)
				  {h=kMin;
				   sTxt = sTxt + " minim h:"+  eval(h);
				  }
				iFrame.height= h ;
				sTxt = sTxt + "iFrame.height:" +iFrame.height;
				// alert('end MF o NoIE9 iFrameHeight ' + sTxt);
    	}
	 else    //IE9
    	   {sTxt = sTxt + ' IE9 ';
   		    hIni=iFrame.style.height;
            iFrame.style.height = kMin + 'px' ;
            var d = (iFrame.contentWindow.document || iFrame.contentDocument) ;
            var h = Math.max(d.body.offsetHeight, d.body.scrollHeight) ;
            sTxt = sTxt + " IE9 h:"+  eval(h)+ " hIni:" + eval(hIni);
            h += 20;
            iFrame.style.height = h + 'px' ;
            iFrame.setAttribute("height", h) ;
			sTxt = sTxt + "iFrame.height:" +iFrame.height;
		    //alert('end IE9 iFrameHeight ' + sTxt);
 		   }
}	 
function attachEvent(oFrame)
 {if ( oFrame.addEventListener ) { 
     oFrame.addEventListener( "load", function (){iFrameHeight(oFrame, 390);}, false );
   // alert('attachEvent addEventListener:'+oFrame.name);
  }
  else 
     if ( oFrame.attachEvent ) { 
        oFrame.attachEvent( "onload", function (){iFrameHeight(oFrame, 390);} );
   //     alert('attachEvent attachEvent:'+oFrame.name);
  } else 
        if ( oFrame.onLoad ) {
           oFrame.onload = function (){iFrameHeight(oFrame, 390);};
	//	alert('attachEvent onload:'+oFrame.name);
  }
}
	
function  iFrameWidth (iFrame, kMin, kMax, iAmpleJaOcupat){
  //alert("fer Inicial(): outerWidth iWOw :" + iWOw + " iWWImg:" + iWWImg);
 var iWOw = document.body.clientWidth + 35;
 var browserName=navigator.appName; 
 //alert("fer Inicial(): outerWidth iWOw :" + iWOw );

if (browserName=="Microsoft Internet Explorer") 
 {iWOw=iWOw-26//15; //-9;
  //alert("detected IE");
 alert("fer Inicial(): outerWidth iWOw :" + iWOw + " browserName:" + browserName);
 }

var  iPossible = iWOw  - iAmpleJaOcupat;
if (iPossible < kMin) iPossible = kMin;
if (iPossible > kMax) iPossible = kMax;
alert("fer Inicial(): iPossible:" + iPossible + " iFrame.width:" +iFrame.width);
iFrame.width=iPossible ;
 }
