/* Kalender ____________________________________________________________ */ var calendar = null; function showCalendar (element, input, container, source, relatedinput) { var aDatum = new Array(); Object.extend(Date.prototype, { monthnames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], daynames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] }); 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] - $(container).getHeight()) + '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", "")); } });