// nastaveni vlastnosti stranky
	var height_menu = 244;
	var height_hlava = 30;
	var height_mezera = 10;
	var height_below = 20;
	

// Funkce pro velikost elementu.
function sizeBlok(x, y, ID) {

  var block = ziskejEL(ID);
    // IE 5 a vyšší, Mozilla, NN6+, Opera 5 a vyšší
  if (document.getElementById){
    block.style.width = x;
    block.style.height = y;
  }
  // NN4+
  else if (document.layers) {
    block.width = x;
    block.height  = y;
  }
  // IE4
  else if (document.all) {
    block.pixelwidth = x;
    block.pixelheight  = y;  
  }
}
	
// Funkce pro pohyb elementu po stránce.
function posunBlok(x, y, ID) {

  var block = ziskejEL(ID);
    // IE 5 a vyšší, Mozilla, NN6+, Opera 5 a vyšší
  if (document.getElementById){
    block.style.left = x;
    block.style.top = y;
  }
  // NN4+
  else if (document.layers) {
    block.left = x;
    block.top  = y;
  }
  // IE4
  else if (document.all) {
    block.pixelLeft = x;
    block.pixelTop  = y;  
  }
}

// Funkce pro získání elementu podle verze prohlížeče.
function ziskejEL(jmeno) {
  // IE 5 a vyšší, Mozilla, NN6+, Opera 5 a vyšší
  if (document.getElementById)
    return(document.getElementById(jmeno));
  // NN4+
  else if (document.layers)
    return(document.layers[jmeno]);
  // IE4
  else if (document.all)
    return(document.all[jmeno].style);
  else
    return(null);
}

function movtime(){
		
	winwidth= document.body.clientWidth;
	winheight= document.body.clientHeight;
	
	//div_hlava
	sizeBlok(winwidth, height_hlava, "div_hlava");
	
	//div_stred
	sizeBlok(winwidth*0.99, (winheight-height_hlava-height_mezera-height_below), "div_stred");
	posunBlok((winwidth*0.01), height_hlava+height_mezera, "div_stred");
	
	//below
	sizeBlok(winwidth, height_below, "below");
	posunBlok(0, (winheight-height_below), "below");
	
	//velikost
	posunBlok((winwidth-190),6,"size");
	
	//menu
	a();
	
	
	//replaceText(document.getElementById("text1"), (" šířka "+winwidth+ " výška "+ winheight));
	window.setTimeout("movtime()",1);
}


// Triger MENU po stránce.
function a() {
  	ID="menu";
  	var block = ziskejEL(ID);
    	pozwindow = document.body.scrollTop;
		winwidth= document.body.clientWidth;
		winheight= document.body.clientHeight;
		strankaheight = document.body.scrollHeight;
	
	
    
  	// IE 5 a vyšší, Mozilla, NN6+, Opera 5 a vyšší
  	if (document.getElementById){
    	akt_x = parseInt(block.style.left);
    	akt_y =  parseInt(block.style.top);
  	}
  	// NN4+
  	else if (document.layers) {
    	akt_x = block.left;
    	akt_y = block.top;
  	}
  	// IE4
  	else if (document.all) {
    	akt_x = block.pixelLeft;
    	akt_y = block.pixelTop;  
  	}
	
	//nastaveni polohy menu
	new_x = winwidth -170;
  	new_y = akt_y;



	bla = Math.floor((winheight/2)-(height_menu/2)+pozwindow);
	if(bla <(height_hlava+height_mezera)){
		bla = height_hlava+height_mezera;
	}

		

  	if (bla != akt_y)   {
		if (bla > akt_y) {
  			if ((bla-akt_y)>15){
				new_y = akt_y + 10;
			}
			else {
				new_y = akt_y + 1;
   			}
		}
		else {
  			if ((akt_y-bla)>15){
  				new_y = akt_y - 10;
			}
			else {
				new_y = akt_y - 1;
			}
		}
		if (new_y >= strankaheight) {
			new_y = strankaheight;
		}
		
		posunBlok(new_x, new_y, ID);
  		
  		window.setTimeout("a()",2);
  	}

	posunBlok(new_x, new_y, ID);
	

	 
	//replaceText(document.getElementById("text1"), (poz +" šířka "+winwidth+ " výška "+ winheight + " "+strankaheight+ " "+bla));
	
}
