var submenu = new Array(false, false, false);
var last_click = 0;

function switch_sub(i)
{
	if(!submenu[i]) {
		submenu[i] = true;
		vis(i);
		if(last_click != i) {
			max_scroll = 0; Titres();
		}
		last_click = i;
	} else {
		submenu[i] = false;
		hid(i);
	}
}

function hid(i)
{
	var el = document.getElementById('submenu_' + i);
	el.style.display = 'none';
}

function vis(i)
{
	var el = document.getElementById('submenu_' + i);
	el.style.display = 'block';
}

function w(uri)
{
	var result = adv(uri);
	return result;
}

function adv(uri)
{
	window.open(uri, "page", "width=800, height=600,menubar=yes, location=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes,left=100,top=100");
	return false; 
}

function wf(url, width, height)
{
	width += 50; height += 50;
	window.open(url, 'foto', 'width='+width+', height='+height+', toolbar=no, location=no, resizable=yes, scrollbars=yes, top=100, left=100');
	return false;
}

function wi(url, width, height)
{
	var result = wf(url, width, height);
	return result;
}

function hid_all()
{
	hid(1); hid(2); hid(3); hid(4);
}

// rolování


max_scroll = 0;

function Titres() {
  var TitresPosition = 3;  // zvýšit "narolovanou" pozici o 1
  scrollBy(0,TitresPosition); // odrolovat
  if(max_scroll < 10) {
	 setTimeout("Titres()",50); // ještě je co rolovat - rekurzivně opakovat, číslo udává zpoždění rolování
	  max_scroll ++;
  }
}

function winH() {
   if (window.innerHeight)
      /* NN4 a kompatibilní prohlížeče */
      return window.innerHeight;
   else if
   (document.documentElement &&
   document.documentElement.clientHeight)
      /* MSIE6 v std. režimu - Opera a Mozilla
      již uspěly s window.innerHeight */
      return document.documentElement.clientHeight;
   else if
   (document.body && document.body.clientHeight)
      /* starší MSIE + MSIE6 v quirk režimu */
      return document.body.clientHeight;
   else
      return null;
}

/*
function resize_main_div()
{
	var h = winH();
	h = h - 154;
	var el = document.getElementById('page-2-content');
	el.style.height = ' ' + h + 'px';
	setTimeout('resize_main_div()', 100);
}
*/
