function activeTopMenu()
{
	if (ActiveTopMenu!=0)
	document.getElementById("menu"+ActiveTopMenu).style.backgroundColor = "#C00607";
}

function getContHei(Different)
{
  var maxHeight  = document.body.clientHeight;
	if (parseInt(document.getElementById("central").offsetHeight)>maxHeight)
			maxHeight=parseInt(document.getElementById("central").offsetHeight);
	document.getElementById("content").style.height=maxHeight-Different;
	document.getElementById("lyr1").style.visibility="visible";
}

// Серверные часы, идущие на клиенте.
var NameMonth = new Array('января','февраля','марта','апреля','мая','июня','июля','августа','сентября','октября','ноября','декабря');
var DayOfWeek = new Array('Воскресенье','Понедельник','Вторник','Среда','Четверг','Пятница','Суббота');
function OnShowServerClock()
{
  pServerDate.setSeconds(nSeconds);

  if(nSeconds >= 60)
     nSeconds = 1;
  else
     nSeconds++;

  nSecond  = pServerDate.getSeconds();
  nHour    = pServerDate.getHours();
  nMinute  = pServerDate.getMinutes();
  nDay     = pServerDate.getDate();
	nDayWeek = pServerDate.getDay();
  nMonth   = pServerDate.getMonth() + 1;
  nYear    = pServerDate.getFullYear();

  if(nSecond <= 9)  nSecond = "0" + nSecond;
  if(nMinute <= 9)  nMinute = "0" + nMinute;
  if(nHour <= 9)    nHour   = "0" + nHour;
  if(nDay  <= 9)    nDay    = "0" + nDay ;

	strMonth   = NameMonth[nMonth-1];
	strDayWeek = DayOfWeek[nDayWeek];

  setTimeout("OnShowServerClock()", 1000);
  document.getElementById("curdate").innerHTML = strDayWeek+", "+nDay + " " + strMonth + " " + nYear;
//  document.getElementById("curtime").innerHTML = nHour + ":" + nMinute + ":" + nSecond;
//  document.getElementById("curtime").innerHTML = nHour + ":" + nMinute;
}

function ChangeColor(point,regim)
{
	if (point!=ActiveTopMenu)
	document.getElementById("menu"+point).style.backgroundColor = (regim==1)?"#C00607":"#7A8C90";
}

function VeriLogIn()
{
	pForm = document.loginform;
	if (pForm.login.value=="" || pForm.password.value=="" || pForm.login.value.length<4 || pForm.password.value.length<4)
	{
		alert("Недостаточно данных для входа.");
		return false;
	}
	pForm.submit();
}

function maxpic(path,winwid,winhei,name,type)
{
	third = "width="+winwid+" height="+winhei+" resizable";
	var newWindow = window.open("","",third);
	if (newWindow!=null)
	{
		newWindow.document.write("<title>"+name+"</title>");
		newWindow.document.write("<body leftmargin=0 topmargin=0 align=center oncontextmenu='return false'>");
		if (type==4)
		{
			newWindow.document.write("<EMBED SRC="+path+" quality=high width="+winwid+" height="+winhei+" TYPE=application/x-shockwave-flash></EMBED>");
		}
			else if (type==3)
			{
				newWindow.document.write("<EMBED SRC="+path+" width="+winwid+" height="+winhei+" AUTOSTART=true REPEAT=false></EMBED>");
			}
				else
				{
					newWindow.document.write("<IMG SRC="+path+" width="+winwid+" height="+winhei+" onClick='window.close();' onmouseover='this.style.cursor=\"hand\";' alt='Для закрытия - нажмите'>");
				}
		newWindow.document.write("</body>");
		newWindow.document.close();
		newWindow.document.focus();
	}
}

