function Calendar(){
  var dDate = new Date();
  var dCurDayOfMonth = dDate.getDate();
  var dDay = dDate.getDay();
  var dCurMonth = dDate.getMonth();
  var dCurYear = dDate.getFullYear();
  var aMonth = new Array(12);
aMonth[0] = 'Январь';
aMonth[1] = 'Февраль';
aMonth[2] = 'Март';
aMonth[3] = 'Апрель';
aMonth[4] = 'Май';
aMonth[5] = 'Июнь';
aMonth[6] = 'Июль';
aMonth[7] = 'Август';
aMonth[8] = 'Сентябрь';
aMonth[9] = 'Октябрь';
aMonth[10] = 'Ноябрь';
aMonth[11] = 'Декабрь';
var eMonth = new Array(12);
eMonth[0] = 'January';
eMonth[1] = 'February';
eMonth[2] = 'March';
eMonth[3] = 'April';
eMonth[4] = 'May';
eMonth[5] = 'June';
eMonth[6] = 'July';
eMonth[7] = 'August';
eMonth[8] = 'September';
eMonth[9] = 'October';
eMonth[10] = 'November';
eMonth[11] = 'December';
var aWeek = new Array(7);
aWeek[1] = 'Понедельник';
aWeek[2] = 'Вторник';
aWeek[3] = 'Среда';
aWeek[4] = 'Четверг';
aWeek[5] = 'Пятница';
aWeek[6] = 'Суббота';
aWeek[0] = 'Воскресенье';
var eWeek = new Array(7);
eWeek[1] = 'Monday';
eWeek[2] = 'Tuesday';
eWeek[3] = 'Wednesday';
eWeek[4] = 'Thursday';
eWeek[5] = 'Friday';
eWeek[6	] = 'Saturday';
eWeek[0] = 'Sunday';
var DaysinMonth = new Array(12);
DaysinMonth[0] = 31;
DaysinMonth[1] = 28;
DaysinMonth[2] = 31;
DaysinMonth[3] = 30;
DaysinMonth[4] = 31;
DaysinMonth[5] = 30;
DaysinMonth[6] = 31;
DaysinMonth[7] = 31;
DaysinMonth[8] = 30;
DaysinMonth[9] = 31;
DaysinMonth[10] = 30;
DaysinMonth[11] = 31;
document.all.day.innerHTML = dCurDayOfMonth;
document.all.rusmonth.innerHTML = aMonth[dCurMonth];
document.all.engmonth.innerHTML = eMonth[dCurMonth];
document.all.rusdayofweek.innerHTML = aWeek[dDay];
document.all.engdayofweek.innerHTML = eWeek[dDay];
document.all.numberweek.innerHTML = NumberWeek1(DaysinMonth, dCurDayOfMonth, dCurYear, dCurMonth);
//document.all.numberweek.innerHTML = NumberWeek1(DaysinMonth, 3, dCurYear, 0);
//document.getElementById(day).innerHTML = dCurDayOfMonth;
}
/*Предупреждение: Было использовано нестандартное свойство document.all. Вместо него следует использовать свойство document.getElementById() рекомендованное W3C.
Источник: http://www.akem_nash.ru/kem/common.js
Строка: 62*/
function NumberWeek1(DaysinMonth, dCurDayOfMonth, dCurYear, dCurMonth){
	var first_day = new Date(dCurYear,0,1);
	var delta=first_day.getDay();
	if (delta==0) delta=7;
	var total_days=dCurDayOfMonth+delta-2;
	if (((dCurYear%4==0)&&(dCurYear%100!=0))||(dCurYear%400==0)){
		DaysinMonth[1]++;
	}
	for (i = 0; i < dCurMonth; i++) {
		total_days=total_days + DaysinMonth[i];
	}
	return (eval(Math.floor(total_days/7)+1));
}
function drawcalendar(){
var concertMonth = new Array ()
var concertDay = new Array ()
concertNum = 0
concertNum = 0
// При добавлении праздничной даты надо добавить месяц в var concertMonth = new Array
// и день в var concertDay = new Array
// и название праздника в var concertInfo = new Array.
var today = new Date
var dayName = new Array ("Пн","Вт","Ср","Чт","Пт","Сб","Вс")
var monthName = new Array ("ЯНВАРЬ", "ФЕВРАЛЬ", "МАРТ", "АПРЕЛЬ", "МАЙ", "ИЮНЬ", "ИЮЛЬ", "АВГУСТ", "СЕНТЯБРЬ", "ОКТЯБРЬ", "НОЯБРЬ", "ДЕКАБРЬ")
// find what day is the first day of this month
day = today.getDay();
result = (today.getDate() % 7)
if (result > day) {
day += 7 
}
firstDay = day - result
// find how many days this month has (note Jan=0, Dec=11)
if (today.getMonth() == 1) {
// 1/26/1999, added code to deal with leap years
thisYear = today.getYear() + 1900
if (thisYear % 4 == 0) {
if (thisYear % 100 == 0) {
if (thisYear % 400 == 0) {
daysInMonth = 29
}
else {
daysInMonth = 28
}
}
else {
daysInMonth = 29
}
}
else {
daysInMonth = 28
}
}
else {
if (today.getMonth() == 0 || today.getMonth() == 2 || today.getMonth() == 4 ||
today.getMonth() == 6 || today.getMonth() == 7 || today.getMonth() == 9 || 
today.getMonth() == 11) {
daysInMonth = 31 }
else {
daysInMonth = 30 }
}
// display the calender
document.write("<table border='0' cellspacing='0' cellpadding='2' class='nobg'><tr>")
// display the names of the days at the top
for (i = 0; i < 5; i++) {
}
for (i = 5; i < 7; i++) {
}
document.write("</tr><tr>")
// write any blank boxes ahead of the first day
for (i = 0; i < firstDay; i++) {
document.write("<td width='14%' align='center'>&nbsp;</td>")
}
// display the days
d = firstDay
for (i = 1; i <= daysInMonth; i++) {
if (!(d < 7)) {
document.write("</tr><tr>")
d = 0 }
if (i == today.getDate()) {
dispDay = '<span>' + i + '</span>'
}
else {
dispDay = i
}
document.write("<td width='14%' align='center' class='calenday'>" + dispDay + "</td>")
d++
}
if (d < 7) {
for (i = d; i < 7; i++) {
document.write("<td width='14%' align='center'>&nbsp;</td>")
}
}
document.write("</tr></table>")
}

// For Photo
function nWindow(oFile, wWidth, wHeight){

var cWidth=window.screen.width;
var cHeight=window.screen.height;

if(cHeight && cWidth){
        var leftOffset=Math.ceil((cWidth-wWidth)/2);
        var topOffset=Math.ceil((cHeight-wHeight)/2);
        window.open(oFile, "met_photo", 'width='+wWidth+',height='+wHeight+',top='+topOffset+',left=' + leftOffset);
        }
return false;
}
// End For Photo

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
