var intValue = 0;

function openList() {
	lang = document.getElementById('lang_options');
		lang.style.visibility="visible";
		lang.style.display="block";
}

function hide() {
	intValue=setTimeout('hideFunk()', 500);
}

function hideFunk() {
	lang.style.visibility="hidden";
	lang.style.display="none";
}
	
function ct() {
//	alert(intValue);
	intValue=window.clearTimeout(intValue);
//	alert(intValue);
}


function getWindowHeight() {
  var windowHeight = 0;
	
  if (typeof(window.innerHeight) == 'number')
    windowHeight = window.innerHeight;
	
  else {
		
    if (document.documentElement && document.documentElement.clientHeight)
      windowHeight = document.documentElement.clientHeight;
		
    else {
      if (document.body && document.body.clientHeight)
        windowHeight = document.body.clientHeight; }; };
				
  return windowHeight;
};




function setDiv() {

	//don't do anything if both elements are not found
	if ( !(document.getElementById('contentbox')) || !(document.getElementById('sidebox')) ) return;

	var aitoRightTeaser = document.getElementById('aitoRightTeaser');
	if(aitoRightTeaser) {
		aitoRightTeaserHeight = aitoRightTeaser.clientHeight;
	}

	var sideboxAdditionalHeight = 31;
	if (aitoRightTeaser) {
		sideboxAdditionalHeight += 10;
	} else {
		var aitoRightTeaserHeight = 273;
		sideboxAdditionalHeight += aitoRightTeaserHeight;
	}

	var cb = document.getElementById('contentbox').clientHeight;
	var sb = document.getElementById('sidebox').clientHeight;

	if (!aitoRightTeaser){ //if no teaser on top of sidebar, deduct teaser height from sidebar height
		sb -= aitoRightTeaserHeight;
	}

	if (cb < sb) {
		var difference = sb - cb;
		document.getElementById('contentbox').style.height = cb + difference - 41 + 'px'; // Set div height to window height
//		console.log("cb less than sb");
	} else if (cb > sb) {
		var difference = cb - sb;
		document.getElementById('sidebox').style.height = sb + difference + sideboxAdditionalHeight + 'px'; // Set div height to window height
//		console.log("cb more than sb");
	}
}


