// JavaScript Document

function showmenu()
	{
	tabl=document.getElementsByTagName('table');
	count=0;
	for (i=0; i<tabl.length; i++)
		if (tabl[i].className=="menu")
			count++;
	for (i=1;i<count+1;i++)
		{
		h=(i-1)*d+sm; //current heigth of menuhead
		document.getElementById('menu'+i).style.position='absolute';
		document.getElementById('menu'+i).style.top=h+'px';
		document.getElementById('menu'+i).style.left=left_off+'px';
		document.getElementById('menu'+i).style.visibility='hidden';
		document.getElementById('menuh'+i).style.background='none';
		document.getElementById('menuh'+i).style.textDecoration='underline';
		}
	return;
	}

function rolldown(menu)
	{
	tabl=document.getElementsByTagName('table');
	count=0;
	for (i=0; i<tabl.length; i++)
		if (tabl[i].className=="menu")
			count++;
	showmenu();
	//change current chapter
	var num;
	
	num=menu.id.substr(4,menu.id.length-4);
	document.getElementById('menuh'+num).style.textDecoration='none';
	menu.style.visibility='visible';
	
	//count of current table td
	j=1;
	for (i=0; i<tabl.length; i++)
		{
		if (tabl[i].className=='menu')
			{
			if (j==num) tdcount=tabl[i].rows.length-1;
			j++;
			}
		}
	//change offset
	num++;
	for (i=num;i<count+1;i++)
		{
		str=document.getElementById('menu'+i).style.top.slice(0,-2);
		h=parseInt(str)+d1*tdcount;
		document.getElementById('menu'+i).style.top=h+'px';
		}
	d=25; 
	d1=20; 
	sm=35; 
	left_off=35;
	return;
	}
function zoomfoto(fotoid)
	{
	zmftwin=window.open("./fotos/"+fotoid+".jpg","Увеличение","height=600,width=800");
	return;
	}
