var nCurrentYear = 0;
var nCurrentMonth = 0;
var WEEK_START = 1;
var nFirstYear = nCurrentYear;
var nFirstMonth = nCurrentMonth;
var podInYear = new Array();
var arrayAsAString = '2025=44,46,71,74,92,94,203,303|2026=94,95';
podInYear = arrayAsAString.split("|");
function kalendarNad(day,month,year){
var sel_datumPodE = day + '.' + month + '.' + year;
//alert(sel_datumPodE);
getDateAJAX(sel_datumPodE) ;
}
function skryKalendar(){
var targetDiv = document.getElementById("targetDivKalendar");
targetDiv.innerHTML = "
";
targetDiv.style.display = "none";
document.body.style.cursor='';
}
function getDayName(i) {
var skDay = new Array("Ïí",
"Âò",
"Ñð",
"×ò",
"Ïò",
"Ñá",
"Íä");
return skDay[i];
}
function getDayOfMonth() {
var monthLength = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
if ((((nCurrentYear % 4 == 0) && (nCurrentYear % 100 != 0)) || (nCurrentYear % 400 == 0)) && nCurrentMonth == 2) {
return 29;
}
return monthLength[nCurrentMonth-1];
}
function getDayOfYear() {
if ((((nCurrentYear % 4 == 0) && (nCurrentYear % 100 != 0)) || (nCurrentYear % 400 == 0))) {
var dayOfYear = new Array(0,31,60,91,121,152,182,213,244,274,305,335);
} else {
var dayOfYear = new Array(0,31,59,90,120,151,181,212,243,273,304,334);
}
return dayOfYear[nCurrentMonth-1];
}
function isPod(day) {
var arActYear = new Array();
for(var i=0; i 12) {
nCurrentMonth -= 12;
nextYear();
}
}
function prevYear() {
nCurrentYear--;
}
function nextYear() {
nCurrentYear++;
}
function clickCalendar(day, month, year) {
var sel_datumPodE = day + '.' + month + '.' + year;
window.location.href = '/search_datum.asp?sel_datumPodE=' + sel_datumPodE;
}
function genCalendars(id, change) {
var strHTML = "";
var dt = new Date();
if (dt.getYear()<1000) dt.setYear(dt.getYear()+1900);
dt.setDate(1);
strHTML += "";
if (change && new Date(nCurrentYear, nCurrentMonth-1, 1) > dt) {
strHTML += ""
} //else alert('e-e');
strHTML += " | "
if (change) {
strHTML += " |
";
}
strHTML += "
";
strHTML += "";
strHTML += "";
for(var i=0; i <=6; i++) {
strHTML += "" + getDayName(i) + " | ";
}
strHTML += " ";
strHTML += "";
var ciselko = new Date(nCurrentYear, nCurrentMonth-1, 1).getDay();
if(ciselko == 0) {
ciselko = 7;
}
var index = 1 + WEEK_START - ciselko;
var numDays = getDayOfMonth();
var dayInYear = getDayOfYear();
while(index <= numDays) {
strHTML += "";
for(var i=1; i<=7; i++) {
if(index <= numDays && index > 0) {
dayInYear ++;
if(isPod(dayInYear)) {
if(i==6 || i==7) {
if (change){
strHTML += "";
strHTML += "" + index + " | ";
}
else
{
strHTML += "" + index + " | ";
}
} else {
if (change){
strHTML += "";
strHTML += "" + index + " | ";
}
else
{
strHTML += "" + index + " | ";
}
}
} else
if(i==6 || i==7) {
strHTML += "" + index + " | ";
} else {
strHTML += "" + index + " | ";
}
} else {
strHTML += " | ";
}
index++;
//strHTML += "";
}
}
strHTML += " "
strHTML += " "
return strHTML;
}
function setCurrentMonth() {
var dt = new Date();
curYear=dt.getYear()
if (curYear < 1000) curYear+=1900
nCurrentYear = curYear;
nCurrentMonth = dt.getMonth()+1;
}
function goNextMonth(id, change) {
var strHTML = "";
nextMonth(1);
strHTML += genCalendars(id, change);
document.getElementById(id).innerHTML = strHTML;
}
function goPrevMonth(id, change) {
var strHTML = "";
prevMonth(1);
strHTML += genCalendars(id, change);
document.getElementById(id).innerHTML = strHTML;
}
function startCalendar(id, change) {
setCurrentMonth();
var strHTML = "";
strHTML += genCalendars(id, change);
document.getElementById(id).innerHTML = strHTML;
}
|