function setPageHeight(){
    // Define variables
	var menuHeight = 0;		// Variable with height on left menu
	var headHeight = 0;		// Variable with height on mainhead or hpmainhead
	var invisibleHeadHight = 0;	// If mainhead or hpmainhead are empty - compensate rightwrap
	var rightMenuHeight = 0;	// Variable with height on rightmenuarea in main-div
	var mainHeight = 0;		// Variable with height on contentarea in main-div
	var mainMaxHeight = 0;		// Highest div in main-div
	var heightMax = 0;		// Highest div on side
	// alert('setPageHeight');
	if (document.getElementById('xxx')){
	    headHeight = document.getElementById('xxx').offsetHeight;
    }
	// Set menu or toggle height
	
	 // Compare rightMenuHeight and mainHeight and set highest
     if ( headHeight > 20 || mainHeight > 20){
      if ( rightMenuHeight >= mainHeight ) { mainMaxHeight = rightMenuHeight; }
      else { mainMaxHeight = mainHeight; }
     }

     // Compare mainMaxHeight and menuHeight and set highest
     if ( mainMaxHeight > 20 || menuHeight > 20 ) {
      if( mainHeight >= menuHeight){ heightMax = mainHeight;}
      else {heightMax = menuHeight;}
     }

     // Set min height on page
     if ( heightMax < 800 ) {heightMax = 800;}
	
	if(document.getElementById('xxx')){
		menuHeight = document.getElementById('xxx').offsetHeight;
	}
  
	// If there is an item - set height
	if ( document.getElementById('xxx') ){
		document.getElementById('xxx').style.height = heightMax + headHeight + "px";
        document.getElementById('xxx').style.maxHeight = heightMax + headHeight + "px";
	}
            
}

