var Cms4dLayoutControl = {
	cw:0
	,ch:0
	,top_container:null
	,top_container_h:0
	,left_col:null
	,left_col_h:0
	,footer_container:null
	,footer_container_h:0
	,layout_ok:false
	,testintervalms:500
	,GetClientSize:function()
	{
		this.cw = 0;
		this.ch = 0;
		if(typeof(window.innerWidth) == 'number')
		{
			//alle ausser IE
			this.cw = window.innerWidth;
			this.ch = window.innerHeight;
		}
		else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		{
			//IE 6 und höher, Kompatibilitätsmodus
			this.cw = document.documentElement.clientWidth;
			this.ch = document.documentElement.clientHeight;
		}
		else if(document.body && (document.body.clientWidth || document.body.clientHeight))
		{
			//IE 4 o. höher, nicht im Kompatibilitätsmodus
			this.cw = document.body.clientWidth;
			this.ch = document.body.clientHeight;
		}
	}
	,DoLayout:function()
	{
		clearTimeout(this.timerid);

		this.GetClientSize();
		if(this.ch > 0)
		{

			//Die Layoutanpassung wird nur durchgeführt, wenn alle Container im DOM gefunden wurden.
			if(this.top_container == null || this.left_col == null || this.footer_container == null)
			{
				this.top_container = document.getElementById('top_container');
				this.left_col = document.getElementById('left_col');
				this.footer_container = document.getElementById('footer_container');
				if(this.top_container != null && this.left_col != null && this.footer_container != null)
				{
					this.layout_ok = true;
				}
			}
			if(this.layout_ok == true)
			{
				this.top_container_h = this.top_container.offsetHeight;
				this.footer_container_h = this.footer_container.offsetHeight;
				this.left_col_h = this.ch - this.top_container_h - this.footer_container_h;

				//Zuweisung von Werten < 1 bei height vermeiden !
				if(this.left_col_h > 0)
				{
					this.left_col.style.height = this.left_col_h + 'px';
				}
			}

			//Nächstes Interval starten
			this.timerid = setTimeout('Cms4dLayoutControl.DoLayout()', this.testintervalms);
		}
	}
	//Erste Prüfung sofort einleiten, danach steuert sich diese über den timer selbst.
	,timerid:setTimeout('Cms4dLayoutControl.DoLayout()', 1)
}