function getAbsolutYPos( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function  overflowmenu(  menuname )
{
	if (navigator.appName=="Netscape") {
		winW = window.innerWidth;
		winH = window.innerHeight;
	}
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		winW = document.body.offsetWidth;
		winH = document.body.offsetHeight;
	}
	var menu = document.getElementById( menuname );

	menu.style.overflow = "auto";
	menu.style.height =  (winH - 20 - getAbsolutYPos(menu))+"px"  ;	
}


function checkMenuSize(){

	availableH = screen.availHeight;
	realAvailableH = parseInt(availableH*3/4);
	naviH = document.getElementById('navimain').clientHeight;
	naviPos = parseInt(document.getElementById('headerbox').clientHeight)+parseInt(document.getElementById('logobox').clientHeight);
	
	//alert(1);
	
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
	  CHECK IF AVAILABLE HEIGHT OF SCREEN IS SMALLER THAN NAVIGATION
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
	if(realAvailableH < parseInt(naviH+naviPos)) {
		//alert("test");
		document.getElementById('dynStyle').href = '/templates/loglan/css/template_css_small.css';
	}
	
}