
function def_layout(){
  spacer_minHeight=600;
  intro_minHeight=640;
}

function set_layout(){
  setHeight();
}

function getElementHeight(Elem) {
	var elem = document.getElementById(Elem);
	if(elem){
			xPos = elem.offsetHeight;
	} else {
	   xPos=0;
	}
	return xPos;
}

  
function setHeight(x) {
  f=getElementHeight('footer');
  t=getElementHeight('blok_top');
  k=39;  
  spacer = document.getElementById('spacer_vertical');
  if(spacer==null){
    spacer=document.getElementById('webpage');
  }
  
   windowHeight = window.innerHeight;
   if(!windowHeight) windowHeight = document.documentElement.clientHeight;

   if(windowHeight > spacer_minHeight+f+t+k){
      w=windowHeight-f-t-k;
      spacer.style.height = w + 'px';
   }else{
      spacer.style.height = spacer_minHeight+'px';
   }
   
   introswf = document.getElementById('intro');
   if(introswf){
     if(windowHeight > intro_minHeight+f+t+k){
        w=windowHeight-f-t-k;
        introswf.style.height = w + 'px';
     }else{
       introswf.style.height = intro_minHeight+'px';
     }
  }
}
