var startYear,subdir;
var userYear=2010;

var month=new Array(
	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
 	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
 	new Array(1,1,1,1,1,1,1,1,1,1,1,1),
        new Array(1,1,1,1,1,1,1,1,1,1,1,1),
        new Array(1,1,1,1,1,1,1,1,1,1,1,1),
        new Array(1,1,1,1,1,1,1,1,1,1,1,1),
        new Array(1,1,1,1,1,1,1,1,1,1,1,1),
	new Array(1,1,1,1,1,1,1,1,1,1,1,1)
);

function Calendar (strt,end,active,sbdr,noBord)
{
	var i,j;
	startYear=strt;

//
	end=userYear; //Переменная end фиктивная - здесь её значение заменяется
//
	//для SelectedYear глобальная переменная subdir
	subdir=sbdr;

	document.write('<table border=0 cellspacing=1 width=100% style="padding-top:0"><!--год-->'+
			'<th colspan=2>АРХІВ</th>'+
			'<tr><th>Рік</th><th>Місяць</th></tr>'+
			'<tr><th width=45px>'+
				'<select id="SelYear" onchange="YearSelected()">');
	//колонка с годом
	for(i=strt;i<=end;i++)
	{
		document.write('<option>'+i);
	}
//	document.write('<option selected>'+i);
	document.all['SelYear'].selectedIndex=active-strt;

	//месяцы
	document.write('</th><td class=bordered style="background-image:URL(podl_5.jpg)">'+
			'<table border=0 cellpadding=0 cellspacing=0 width=100%>');

	for(i=1; i<=4; i++) //цикл по строкам
	{
		document.write('<tr>');
		for (j=1; j<=3; j++)
		{
			document.write('<td width=33% align=center id="a'+((i-1)*3+j-1)+'">');
			
			if(month[active-strt][(i-1)*3+j-1])
				document.write('<a href="'+subdir+'press.php?id='+active+'_'+((i-1)*3+j)+'" class=normal6>'+((i-1)*3+j)+'</a>');
			else
				document.write('<b><font color=black>'+((i-1)*3+j)+'</font></b>');

			document.write('</td>');
		}
		document.write('</tr>');
	}

	document.write('</table>'+
		'</td></tr></table><!--год-->');

}

function Calendar1 (strt,end,active,sbdr,noBord)
{
	var i,j;
	startYear=strt;

	//для SelectedYear глобальная переменная subdir
	subdir=sbdr;

	document.write('<table border='+(noBord?'0':'1')+' cellspacing=0 width=100%'+
	(noBord?'':' style="border-color:black"')+'>'+
	'<tr><th  colspan=2 align=center height=15>АРХІВ</th></tr>'+
	'<tr><td>'+
		'<table border=0 cellspacing=1 width=100%><!--год-->'+
			'<tr><th>Рік</th><th>Місяць</th></tr>'+
			'<tr><th width=45px>'+
				'<select id="SelYear" onchange="YearSelected()">');
	//колонка с годом
	for(i=strt;i<=end;i++)
	{
		document.write('<option>'+i);
	}
//	document.write('<option selected>'+i);
	document.all['SelYear'].selectedIndex=active-strt;

	//месяцы
	document.write('</th><td class=bordered>'+
		''+
			'<table border=0 cellpadding=0 width=100%>');

	for(i=1; i<=4; i++) //цикл по строкам
	{
		document.write('<tr>');
		for (j=1; j<=3; j++)
		{
			document.write('<td width=33% align=center id="a'+((i-1)*3+j-1)+'">');
			
			if(month[active-strt][(i-1)*3+j-1])
				document.write('<a href="'+subdir+'press.php?id='+active+'_'+((i-1)*3+j)+'" class=normal6>'+((i-1)*3+j)+'</a>');
			else
				document.write('<b><font color=black>'+((i-1)*3+j)+'</font></b>');

			document.write('</td>');
		}
		document.write('</tr>');
	}

	document.write('</table>'+
		'</td></tr></table><!--год-->');

	document.write('</td>'+
      '</tr>'+
     '</table>  <!--Конец календаря-->');

}

function YearSelected()
{
	var i,curr;

	curr=document.all['SelYear'].selectedIndex;

	for (i=0; i<12; i++)
	{
		if (month[curr][i])
			document.all['a'+i].innerHTML=
			    '<a href="'+subdir+'press.php?id='+(curr+startYear)+'_'+(i+1)+'" class=normal6>'+(i+1)+'</a>';
		else
			document.all['a'+i].innerHTML='<b><font color=black>'+(i+1)+'</font></b>';
	}
}

function Rubric(sbdr,noBord)  //	'themes/'
{
	var NameLst=new Array(
		'Права дитини',
		'Права інвалідів',
		'Права осіб, позбавлених волі',
		'Права біженців',
		'Захист прав співвітчизників за кордоном',
		'Український Омбудсман - ініціатор боротьби з транснаціональною работоргівлею',
		'Право громадян на охорону здоров\'я',
		'Соціальні, економічні та культурні права громадян',
		'Політичні права громадян',
		'Громадянські та особисті права',
		'Міжнародна діяльність Уповноваженого',
		'Права шахтарів',
		'Інші');
	var i;

	document.write(
		'<table border='+(noBord?'0':'1')+' cellspacing=0 width=100% '+
		(noBord?'':'style="border-color:black; margin-top:2"')+'><!--Архив-->'+
		'<tr><th  align=center height=15>РУБРИКИ</th></tr>'+
		'<tr><td valign=top>'+
		'<ul>');

	for (i=0; i<NameLst.length; i++)
	{
		document.write('<li><a href="'+sbdr+'press.php?id='+i+'" class=normal2>'+NameLst[i]+'</a><br>');

	}

	document.write(
		'</ul>'+
		'</td></tr>'+
		'</table>');

}

function FotoMaterial(sbdr,noBord)
{
	document.write(
		'<table border='+(noBord?'0':'1')+' cellspacing=0 width=100% '+
		(noBord?'':'style="border-color:black; margin-top:2"')+'>'+
		'<tr><th>ФОТОМАТЕРІАЛИ</th></tr>'+
		'<tr>'+
           '<td align=center valign=center>'+
                '<br>'+
				'<a href="'+sbdr+'foto.php?id=0" class=normal2><img border=1 width=148 height=212 id="presFoto" src=nina1.jpg><br>'+
'Уповноважений Верховної Ради України з прав людини Карпачова Н.І.</a><br>'+
		    '</td>'+
		'</tr>'+
		'</table>');
}

function CreateHeader(sbdr,isIndPg)
{
 
	document.write(
'<table border=0 cellspacing=2 width=95% align=center>'+
 '<tr>'+
  '<th>'+
    '<center>'+
    'ПРЕС-СЛУЖБА<br> УПОВНОВАЖЕНОГО ПОВІДОМЛЯЄ<br>'+
    'тел. 253-75-23;<br> тел./факс: 253-21-54'+
    '</center>'+
  '</th>'+
  '<td width=177>'+// bgcolor=#00b2f5
   '<center><img src='+sbdr+'om1.jpg width=248 height=177></center>'+
  '</td>'+
  '<th>'+
    '<center>'+
    'PRESS-SERVICE<br> OF THE COMMISSIONER REPORTS<br>'+
    'tel. 253-75-23;<br> tel./fax: 253-21-54'+
    '</center>'+
  '</th>'+
 '</tr>'+
 '<tr>'+
   '<td align=right bgcolor=#0033CC colspan=3>'+
      '<a href="'+(isIndPg?'../':sbdr)+'index.'+(isIndPg?'htm':'php')+'" class="normal1">Головне меню &gt;&gt;</a>'+
   '</td>'+
 '</tr>'+

'</table>');
}

var fotNum=3;
var foto=new Array();
var fotInd;

function Preload(sbdr)
{
  var i;
  for (i=0; i<fotNum; i++)
   {foto[i]=new Image();
     foto[i].src=sbdr+'nina'+(i+1)+'.jpg';
   }
 fotInd=0;
}

function FotRotate()
{
  fotInd=(fotInd+1)%fotNum;
  document.images['presFoto'].src=foto[fotInd].src;
  window.setTimeout("FotRotate()",6000);
}

