<script language = "JavaScript">
Date.prototype.getDOY = function()
{
var onejan = new Date(this.getFullYear(),0,1);
return Math.ceil((this - onejan) / 86400000);
}
Date.prototype.isLeapYear = function()
{
var year = this.getFullYear();
return ((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
}
var today = new Date();
var yearday = today.getDOY();
var path = "yenonotie_files/enderi/";
var x = 0;
var enderi5 = new Array(
path + "1.png",
path + "2.png",
path + "3.png",
path + "4.png",
path + "5a.png");
var enderi6 = new Array(
path + "1.png",
path + "2.png",
path + "3.png",
path + "4.png",
path + "5b.png",
path + "6.png");
var months = new Array();
var days = new Array();
var y = 30;
while (x <= 11)
{
months [x] = "yenonotie_files/months/" + x + ".png";
++x;
}
x = 0
while (x <= 29)
{
days [x] = "yenonotie_files/days/" + x + ".png";
++x;
}
x = 1;
if (yearday >= 361)
{
if (today.isLeapYear())
{
document.getElementById("pic1").src = "yenonotie_files/main/enderi6.png";
document.getElementById("pic2").src = enderi6 [yearday - 361];
}
else
{
document.getElementById("pic1").src = "yenonotie_files/main/enderi5.png";
document.getElementById("pic2").src = enderi5 [yearday - 361];
}
}
else
{
while (y <= yearday - 1)
{
++x;
y += 30;
}
yearday = yearday - (30 * (x - 1));
document.getElementById("pic1").src = "yenonotie_files/main/calendar.png";
document.getElementById("pic2").src = months [x];
document.getElementById("pic3").src = days [yearday];
}
</script>