
/*
Function set height of aktive page to 100% if is not
*/

function setHeight() {
	var fullHeight = winHeight();
	var actualHeight = get_current_height(document.getElementById('left_column'));
	
	// > 20000 is there because of Holy grail (padding is set 20000)
	if (actualHeight < fullHeight || actualHeight > 20000) {
		headerHeight = get_current_height(document.getElementById('header'));
		footerHeight = get_current_height(document.getElementById('footer'));
		additionalHeight = get_current_height(document.getElementById('over_footer_positioner'));
		
		// 60 bellow is margin-top of left_column element. I don't know, how to get margin in javascript, Josef Nevoral 2007-01-13
		document.getElementById('left_column').style.height = (fullHeight-headerHeight-footerHeight-additionalHeight-70)+'px';
	
	}
}




// function for gettin width and height of viewport
// code from http://www.pixy.cz/blogg/clanky/js-rozmery-okna.html

function winHeight() {
   if (window.innerHeight)
      /* NN4 a kompatibilní prohlížeče */
      return window.innerHeight;
   else if
   (document.documentElement &&
   document.documentElement.clientHeight)
      /* MSIE6 v std. režimu - Opera a Mozilla
      již uspěly s window.innerHeight */
      return document.documentElement.clientHeight;
   else if
   (document.body && document.body.clientHeight)
      /* starší MSIE + MSIE6 v quirk režimu */
      return document.body.clientHeight;
   else
      return null;
}

function get_current_height($element)
	{
	var ee;
	try
		{
		var $cs=document.defaultView.getComputedStyle($element,'');
		$val=style2px($cs.getPropertyValue("height"));
		}
	catch(ee)
		{
		$val=($element.offsetHeight);
		if($val<0)$val=0;
		}
	return $val;
	}
	
function style2px(hodnota)
{
if (hodnota) return Number(hodnota.substr(0,hodnota.indexOf("px")));
else return 0
}