
// PAGE HEIGHT CLAC 

var originalHeight = 0;

function origCalc() {	
	
	var maxHeight = 0;
	var offersHeight = document.getElementById('offers-container').offsetHeight;
	var leftmenuHeight = document.getElementById('leftmenu-container').offsetHeight;
	var bannersHeight = document.getElementById('banner-container').offsetHeight;
	var mLinkHeight = document.getElementById('menulink').offsetHeight;
	var mKeresoHeight = document.getElementById('menukereso').offsetHeight;
	menuHeight = mLinkHeight + mKeresoHeight + 20;
	
	if(originalHeight <= 0) {
		if((maxHeight < menuHeight) && (maxHeight < offersHeight) && (maxHeight < bannersHeight)) {
			maxHeight = menuHeight;
		}
		if(maxHeight < offersHeight) {
			maxHeight = offersHeight;
		}
		if(maxHeight < bannersHeight) {
			maxHeight = bannersHeight;
		}
		
		originalHeight = maxHeight;
	}
	return(menuHeight, maxHeight);
}

function pageHeightCalc() {
	
	origCalc();

	if(menuHeight < originalHeight) {
		maxHeight = originalHeight;
	} else {
		maxHeight = menuHeight;
	}
	document.getElementById('offers-container').style.height = maxHeight - 2 + "px";
	document.getElementById('banner-container').style.height = maxHeight - 2 + "px";
	document.getElementById('leftmenu-container').style.height = maxHeight + "px";
}

