/* Kalender ____________________________________________________________ */ var calendar = null; var calendar2 = null; var calendar3 = 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(); }; function showCalendar2 (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 (!calendar2) { 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. calendar2 = new scal(element, $(input), { updateformat: 'dd.mm.yyyy', wrapper: container, relatedinput: relatedinput }); } else { calendar2.updateelement = $(input); } aDatum = $F(input).split("."); var date = new Date(aDatum[2] + "/" + aDatum[1] + "/" + aDatum[0]); calendar2.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 =) calendar2.openCalendar(); }; function showCalendar3 (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 (!calendar3) { 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. calendar3 = new scal(element, $(input), { updateformat: 'dd.mm.yyyy', wrapper: container, relatedinput: relatedinput }); } else { calendar3.updateelement = $(input); } aDatum = $F(input).split("."); var date = new Date(aDatum[2] + "/" + aDatum[1] + "/" + aDatum[0]); calendar3.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 =) calendar3.openCalendar(); }; Event.observe(window, "load", function(e) { if ($('imganreisedatumlinks') && $('imgabreisedatumlinks')) { var imgCalendar_Click = function(e, input, relatedinput) { showCalendar("calendar", input, "calendar-container", Event.element(e), relatedinput); }; Event.observe("imganreisedatumlinks", "click", imgCalendar_Click.bindAsEventListener(this, "anreisedatumlinks", "abreisedatumlinks")); Event.observe("imgabreisedatumlinks", "click", imgCalendar_Click.bindAsEventListener(this, "abreisedatumlinks", "")); } if ($('imganreisedatumunten')) { var imgCalendarUnten_Click = function(e, input, relatedinput) { showCalendar2("calendar-unten", input, "calendar-container-unten", Event.element(e), relatedinput); }; Event.observe("imganreisedatumunten", "click", imgCalendarUnten_Click.bindAsEventListener(this, "anreisedatumunten", "")); } if ($('imganreisedatumoben')) { var imgCalendarOben_Click = function(e, input, relatedinput) { showCalendar3("calendar-oben", input, "calendar-container-oben", Event.element(e), relatedinput); }; Event.observe("imganreisedatumoben", "click", imgCalendarOben_Click.bindAsEventListener(this, "anreisedatumoben", "")); } });