// Setting correct heights of div's
if (document.getElementById('bot')){setSizes()}
window.onresize = setSizes;

function setSizes() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  var windowValue = 320;
  if (document.getElementById('mid_home')){windowValue = 140;} // in case of homepage
  
  var topSize = Math.round((myHeight-windowValue)/2);
  var botSize = (myHeight-windowValue) - topSize - 1;
  
  if (topSize < 90){topSize = 90;}
  if (botSize < 180){botSize = 180;}
  
  document.getElementById('top').style.height = topSize+'px';
  document.getElementById('bot').style.height = botSize+'px';
}



// Adding hover state on div elements (IE 6)
if (document.getElementById('mid_home')){
	if (document.all&&document.getElementById) { 
		// Main menu
		navRootTotal = document.getElementById("home");
		navRoot = navRootTotal.getElementsByTagName("li"); 
		
		for (i=0; i<navRoot.length; i++) { 
			node = navRoot[i]; 
			if (node.nodeName=="LI") { 
				node.onmouseover=function() { 
					this.className+=" over"; 
				} 
				node.onmouseout=function() { 
				this.className=this.className.replace(" over", ""); 
				} 
			}
		} 
	}
}



// Hi- an unlite projectblocks
function actProject(nr,action){
	var obj = document.getElementById('project_' + nr);
	for (i=1; i<16; i++){
		if (document.getElementById('project_'+i)){document.getElementById('project_'+i).style.zIndex = i}
	}
	
	if (action == 'on'){
			document.getElementById('project_'+nr).style.zIndex = 100;
			document.getElementById('proj_title_'+nr).style.display = 'block';
			document.getElementById('border_title_'+nr).style.display = 'block';
		}
	if (action == 'off'){
			document.getElementById('proj_title_'+nr).style.display = 'none';
			document.getElementById('border_title_'+nr).style.display = 'none';
		}
}
