/* Kalender ____________________________________________________________ */ var calendar = null; function showCalendar (element, input, container, source, relatedinput) { var aDatum = new Array(); //alert(relatedinput); 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); //the Draggable handle is hard coded to "rtop" to avoid other parameter. new Draggable(container, {handle: "rtop", starteffect: Prototype.emptyFunction, endeffect: Prototype.emptyFunction}); //The singleton calendar is created. 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); //Locates the calendar over the calling control (in this example the "img"). if (source = $(source)) { Position.clone($(source), container, {setWidth: false, setHeight: false, offsetLeft: source.getWidth() + 2}); } //finally show the calendar =) calendar.openCalendar(); }; var imgCalendar_Click = function(e, input, relatedinput) { if (!$('calendar-container')) { $$('body')[0].insert({ 'bottom': '' }); } showCalendar("calendar", input, "calendar-container", Event.element(e), relatedinput); }; Event.observe(window, "load", function(e) { Event.observe("imganreisedatum", "click", imgCalendar_Click.bindAsEventListener(this, "anreisedatum", "")); });