
var c4LayoutControl={LAYOUT_INTERVAL:50,RESIZE_ELEMENT_ID:'tResizeControl',ELEMENTS:{'NAVIGATION':'navigation','CONTAINER':'cont2','RHC':'cont3','LEFT':'cont1','FOOTER':'c4footer'},layoutIntervalObj:null,lastChange:0,lastWidth:0,lastHeight:0,textSizeEl:null,init:function(){c4LayoutControl.createTextSizeObject();c4LayoutControl.setLayoutMonitor();},createTextSizeObject:function(){this.textSizeEl=document.createElement('span');this.textSizeEl.id=this.RESIZE_ELEMENT_ID;this.textSizeEl.innerHTML='&nbsp;';this.textSizeEl.style.position='absolute';this.textSizeEl.style.left='-9999px';document.body.appendChild(this.textSizeEl);},setLayoutMonitor:function(){this.layoutIntervalObj=setInterval(this.getSetLayout(),this.LAYOUT_INTERVAL);},getSetLayout:function(){me=this;return function(){if(me.textSizeEl===null){return;}
if(me.getSize()!=me.lastChange){me.lastChange=me.getSize();me.setLayout();}};},getSize:function(){cH=this.textSizeEl.offsetHeight;cW=this.textSizeEl.offsetWidth;if(this.lastChange==cH){return this.textSizeEl.offsetWidth;}else{return this.textSizeEl.offsetHeight;}},setLayout:function(){var $=C4.DOM.$;var navigation=$(this.ELEMENTS.NAVIGATION);var lhc=$(this.ELEMENTS.LEFT);var container=$(this.ELEMENTS.CONTAINER);var skyscraper=$(this.ELEMENTS.SKYSCRAPER);var rhc=$(this.ELEMENTS.RHC);var footer=$(this.ELEMENTS.FOOTER);var skips=$(this.ELEMENTS.SKIPS);var topCounter=0;if(navigation){topCounter=navigation.offsetTop+navigation.offsetHeight;}
if(lhc){lhc.style.top=(topCounter)+'px';}
if(rhc){rhc.style.top=(topCounter)+'px';}
if(container){container.style.top=(topCounter)+'px';}
if(footer){belowThese=[lhc,container,rhc];for(var i=0;i<belowThese.length;i++){if(belowThese[i]===null){continue;}
topCounter=Math.max(topCounter,belowThese[i].offsetTop+belowThese[i].offsetHeight);}
footer.style.width='100%';footer.style.top=(topCounter)+'px';}}};C4.BOM.addDOMLoadEvent(c4LayoutControl.init());
