/* Kalender ____________________________________________________________ */ var calendar = null; function showCalendar (element, input, container, source, relatedinput) { var aDatum = new Array(); Object.extend(Date.prototype, { monthnames: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], daynames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] }); if (!calendar) { container = $(container); new Draggable(container, {handle: "rtop", starteffect: Prototype.emptyFunction, endeffect: Prototype.emptyFunction}); calendar = new scal(element, $(input), { updateformat: 'dd.mm.yyyy', wrapper: container, relatedinput: relatedinput }); } else { calendar.updateelement = $(input); } aDatum = $F(input).split("."); var date = new Date(aDatum[2] + "/" + aDatum[1] + "/" + aDatum[0]); calendar.setCurrentDate(isNaN(date) ? new Date() : date); $(container).setStyle({ left: ($(source).cumulativeOffset()[0] + $(source).getWidth() + 2) + 'px', top: ($(source).cumulativeOffset()[1]) + 'px' }); calendar.openCalendar(); }; var imgCalendar_Click = function(e, input, relatedinput) { if (!$('calendar-container')) { $('body').insert({ 'bottom': '' }); } showCalendar("calendar", input, "calendar-container", Event.element(e), relatedinput); }; Event.observe(window, "load", function(e) { if ($('imganreisedatum')) { Event.observe("imganreisedatum", "click", imgCalendar_Click.bindAsEventListener(this, "anreisedatum", "")); } });