/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Calendar JS v2.0 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Copyright (C) 2005 by Michael Loesler, http://www.derletztekick.de + + + + + + This program is free software; you can redistribute it and/or modify + + it under the terms of the GNU General Public License as published by + + the Free Software Foundation; either version 2 of the License, or + + (at your option) any later version. + + + + This program is distributed in the hope that it will be useful, + + but WITHOUT ANY WARRANTY; without even the implied warranty of + + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + + GNU General Public License for more details. + + + + You should have received a copy of the GNU General Public License + + along with this program; if not, write to the + + Free Software Foundation, Inc., + + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ var now = new Date(); var date = now.getDate(); var month = now.getMonth(); var year = now.getFullYear(); function prevMonth(pd, pm, py, formelement){ if (pm == 0){ pm = 11; py -= 1; } else{ pm -= 1; } getCalendar(pd, pm, py, formelement); } function nextMonth(nd, nm, ny, formelement){ if (nm == 11){ nm = 0; ny += 1; } else{ nm += 1; } getCalendar(nd, nm, ny, formelement); } function CalOut(dd, mm, yy, formelement){ if(dd < 10) dd = 0+""+dd; document.getElementsByName(formelement)[0].value = (dd) + "." + (mm+1) + "." + yy; document.getElementById("calendar").innerHTML = ""; document.getElementById("calendar").style.display = "none"; } function getCalendar(dd, mm, yy, formelement){ var sevendaysaweek = 0; var begin = new Date(yy,mm,1); var firstday = begin.getDay()-1; if (firstday < 0){ firstday = 6; } dayname = new Array("Mo","Di","Mi","Do","Fr","Sa","So"); monthname = new Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"); dayspermonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31); if ((yy%4==0) && ((yy%100!=0) || (yy%400==0))){ dayspermonth[1] = 29; } if ((mm != month) || (yy != year)){ var today = ''; } else { var today = date+'.'; } var showcalendar = document.getElementById("calendar"); for (var i=0; i