/*var AcceptPeriod = new Class( { implements: [Options, Events], initialize: function() { this._registerListners(); }, _registerListners : function() { oDateField = $('s_date'); oAcceptPeriodCheckBox = $('iAcceptPeriodActive_second'); oDateField.addEvent("focus", function(event) { oAcceptPeriodCheckBox.checked = true; }.bind(this)); } });*/ function setEndDate(dp) { oDateEndBox = $('e_date'); if (oDateEndBox.value=='') { oOldDate = dp.getSelectedDate(); oOldDate.increment('day', 7); aDP['e_date'].setSelectedDate(oOldDate); } } function leadingZero(x){return (x>9)?x:'0'+x;} function setAcceptPeriod() { oSearchForm = $('mapform'); oStartDateBox = $('s_date'); oEndDateBox = $('e_date'); aDateParts = oStartDateBox.value.split("-"); StartDate = new Date(aDateParts[2],(aDateParts[1]-1),aDateParts[0]); aDateParts = oEndDateBox.value.split("-"); EndDate = new Date(aDateParts[2],(aDateParts[1]-1),aDateParts[0]); if (EndDate <= StartDate) { alert('Ankomstdatoen er senere end afrejsedatoen.'); } else { oSearchForm.elements['procedure'].value = 'changeSearchCCAcceptPeriod'; oSearchForm.submit(); } } function unsetAcceptPeriod() { oSearchForm = $('mapform'); oSearchForm.elements['procedure'].value = 'deleteSearchCCAcceptPeriod'; oSearchForm.submit(); } window.addEvent("domready", function() { //oAcceptPeriod = new AcceptPeriod(); aDP = []; aDP['s_date'] = new DatePicker($('s_date'), { sLanguage : sLocale, format : sDateFormat, onDateClick: function() { setEndDate(this); } }); aDP['e_date'] = new DatePicker($('e_date'), {sLanguage : sLocale, format : sDateFormat}); });