			function doSomething() {
			    alert("I'm done resizing for the moment");
			};

			var resizeTimer = null;
			jQuery(window).bind('resize', function() {
			    if (resizeTimer) clearTimeout(resizeTimer);
			    resizeTimer = setTimeout(doResize, 300);
			});

		    function setElements() {
				setLeftTabContainer();
				setRightTabContainer();

		    }

		    function doResize(){
		    	   setElements();
				   var newWindowWidth = getBodyWidth();
				   if(newWindowWidth < 1280){
				     setActiveStyleSheet("lowMnuBar");
				   }
				   else{
					   setActiveStyleSheet("HighMnuBar");
				   }
				}

				var windowWidth = null;

function setRightTabContainer(){
	var cSizeHT = getBodyHeight() - document.getElementById('contentxhtmlRightPanelGroupWrapingDiv2').offsetHeight;
	/*var cSizeHTT = cSizeHT - 7;*/
	var cSizeHTT = cSizeHT;
	var cSizeH = cSizeHTT - jQuery('#mainForm\\:tabs > ul.yui-nav').outerHeight();
	if(document.getElementById('mainForm:tabscnt'))
	   document.getElementById('mainForm:tabscnt').style.height = cSizeH + 'px';
//	if(document.getElementById('listInTable')) {
//		var cSizeALD =  0;
//		if(document.getElementById('aboutListDoc')) {
//			cSizeALD =  cSizeH*0.1;
//			document.getElementById('aboutListDoc').style.height = cSizeALD + 'px';
//		}
//		//TODO take into account complete height and remove -2
//	   document.getElementById('listInTable').style.height = cSizeH - cSizeALD - 2 + 'px';
//	}
	if(document.getElementById('documentGenesisContent'))
	   document.getElementById('documentGenesisContent').style.height = cSizeH + 'px';
	/*if(document.getElementById('documentTextContent'))
		   document.getElementById('documentTextContent').style.height = cSizeH + 'px';*/
	if(document.getElementById('documentTextContent')){
	   var cSizeText = cSizeH - document.getElementById('documentTextContentHeadline').offsetHeight;
	   document.getElementById('documentTextContent').style.height = cSizeText + 'px';
	}
//2in1
//	if(document.getElementById('dCurrentRemarkContent')){
//		   var cSizeRemarkC = document.getElementById('dCurrentDocRemark').offsetHeight -  document.getElementById('mainForm:otCurrentDocRemark').offsetHeight;
//		   document.getElementById('dCurrentRemarkContent').style.height = cSizeRemarkC + 'px';
//	}
	if(document.getElementById('dCurrentRemarkContentLeft')){
		   var cSizeRemarkC = document.getElementById('dCurrentDocRemarkLeft').offsetHeight -  document.getElementById('mainForm:otCurrentDocRemarkLeft').offsetHeight;
		   document.getElementById('dCurrentRemarkContentLeft').style.height = cSizeRemarkC + 'px';
	}
	if(document.getElementById('dRelatedRemarkContentRight')){
		   var cSizeRemarkC = document.getElementById('dRelatedDocRemarkRight').offsetHeight -  document.getElementById('mainForm:otRelatedDocRemarkRight').offsetHeight;
		   document.getElementById('dRelatedRemarkContentRight').style.height = cSizeRemarkC + 'px';
	}
	if(document.getElementById('aboutDocumentTab')){
	   var cSizeText = cSizeH - document.getElementById('aboutDocumentHeadline').offsetHeight;
	   document.getElementById('aboutDocumentTab').style.height = cSizeText + 'px';
	}
	if(document.getElementById('aboutActTab')){
		var cSizeText = cSizeH - document.getElementById('aboutActHeadline').offsetHeight;
		document.getElementById('aboutActTab').style.height = cSizeText + 'px';
	}

}

function setLeftTabContainer(){
	   var cSizeH = getBodyHeight();
	   document.getElementById('contentxhtmlLeftPanelGroupWrapingDiv1').style.height = cSizeH + 'px';
	}

function getBodyHeight(){

	var theHeight;
	// Window dimensions:
	if (window.innerHeight) {
	theHeight=window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
	theHeight=document.documentElement.clientHeight;
	}
	else if (document.body) {
	theHeight=document.body.clientHeight;
	}

	return theHeight;
}

function getBodyWidth(){

	   var theWidth;
		// Window dimensions:
		if (window.innerWidth) {
		theWidth=window.innerWidth;
		}
		else if (document.documentElement && document.documentElement.clientWidth) {
		theWidth=document.documentElement.clientWidth;
		}
		else if (document.body) {
		theWidth=document.body.clientWidth;
		}

		return theWidth;

	}

var refreshTimer=null;

jQuery(document).ready(function(){
	windowWidth = getBodyWidth();
	if(windowWidth<1280){
	   setActiveStyleSheet("lowMnuBar");
	}
	else{
		setActiveStyleSheet("HighMnuBar");
	}
	setElements();
	/** DEMO **/
	/* DEMO commented
	document.getElementById("mainForm:rfrshInd").value = true;
	*/
	if (refreshTimer) clearTimeout(refreshTimer);
	/* DEMO commented
	refreshTimer = setTimeout(submitRerender, 1000);
	*/
	/****/
	/*setOpenRelationsTab();*/
});

function submitRerender(){
	 iceSubmitPartial(document.getElementById("mainForm"),document.getElementById("mainForm:rfrshInd"));
}

function pageRefresh(){

	window.location.reload(true);

}