var ResizeIframe = {    
  wrapperId : "tinc_content",
                
  resize : function ( oDoc, sId ) 
  {
    // Images which are delivered by tinc jobs need to be routed over the proxy for the content modules
    var imgs = iframeDoc.getElementsByTagName( "img" );
    for ( var i = 0; i < imgs.length; i++ )
    {
      if ( imgs[i].src.indexOf( "/tinc" ) != -1 && imgs[i].src.indexOf( "/spicon") == -1 ) 
      {
        imgs[i].src = '/xml/wfxdirect/proxy' + top.application.getUserApplication().getJSessionId() + '?' + imgs[i].src.substring( imgs[i].src.indexOf( '?' ) + 1 );
      }
    }
    
    if ( window.addEventListener )
      {
        var iframeDoc = oDoc.getElementById( sId ).contentDocument;
        var pv = iframeDoc.defaultView.getComputedStyle( iframeDoc.body, "" ).getPropertyValue;
        var height = iframeDoc.body.clientHeight
        + parseInt( iframeDoc.defaultView.getComputedStyle( iframeDoc.body, "" ).getPropertyValue( "margin-top" ) )
        + parseInt( iframeDoc.defaultView.getComputedStyle( iframeDoc.body, "" ).getPropertyValue( "margin-bottom" ) )
        + parseInt( iframeDoc.defaultView.getComputedStyle( iframeDoc.body, "" ).getPropertyValue( "padding-top" ) )
        + parseInt( iframeDoc.defaultView.getComputedStyle( iframeDoc.body, "" ).getPropertyValue( "padding-bottom" ) );
      } else if ( window.attachEvent ) {
      var iframeDoc = oDoc.frames[ sId ].document;
      var wrapper = iframeDoc.getElementById( this.wrapperId );
      wrapper.style.height = "0px"; 
      var bodystyle = iframeDoc.body.style;
      var height = wrapper.offsetHeight + wrapper.offsetTop + 1;
    }
    oDoc.getElementById( sId ).setAttribute("height", height);    
  }
};

