b6f7296c0a97ef7c07a03d07c209ac65ed9350c8
1 function populate(objForm,resultForm) {
2 yearSel=objForm.year.options[objForm.year.selectedIndex].text;
3 monthIx=objForm.month.selectedIndex;
4 nextMonthIx=0;
5 if(monthIx!=11)
6 nextMonthIx=monthIx+1;
8 nextMonthSel=objForm.month.options[nextMonthIx].value;
9 monthSel=objForm.month.options[monthIx].value;
11 daySel=1;
12 if(objForm.day.selectedIndex!=-1)
13 daySel=objForm.day.options[objForm.day.selectedIndex].value;
15 timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
16 timeDifference = timeOfDayOne - 86400000;
17 timeOfLastDay = new Date(timeDifference);
19 var daysInMonth = timeOfLastDay.getDate();
21 if(daySel>daysInMonth) daySel=daysInMonth;
23 selectedDate= new Date(yearSel,monthSel,daySel);
24 for (var i = 0; i < objForm.day.length; i++) {
25 objForm.day.options[0] = null;
26 }
27 for (var i = 0; i < daysInMonth; i++) {
28 objForm.day.options[i] = new Option(i+1);
29 }
30 objForm.day.selectedIndex=daySel-1;
31 saveResult(selectedDate,resultForm);
32 }
34 function createResult(objForm,resultForm){
35 yearSel=objForm.year.options[objForm.year.selectedIndex].text;
36 monthIx=objForm.month.selectedIndex;
37 monthSel=objForm.month.options[monthIx].value;
38 daySel=objForm.day.options[objForm.day.selectedIndex].value;
39 selectedDate= new Date(yearSel,monthSel,daySel);
40 saveResult(selectedDate,resultForm);
41 }
43 function saveResult(selectedDate,resultForm){
44 timeInSeconds=Math.floor((selectedDate.getTime() - selectedDate.getTimezoneOffset() * 60000 ) / 1000);
45 resultForm.value=timeInSeconds;
46 }
48 function populate_sambaLogonTime(objForm,resultForm) {
49 var yearSel=objForm.sambaLogonTime_year.options[objForm.sambaLogonTime_year.selectedIndex].text;
50 var monthIx=objForm.sambaLogonTime_month.selectedIndex;
51 var nextMonthIx=0;
52 if(monthIx!=11)
53 nextMonthIx=monthIx+1;
55 var nextMonthSel=objForm.sambaLogonTime_month.options[nextMonthIx].value;
56 var monthSel=objForm.sambaLogonTime_month.options[monthIx].value;
58 var daySel=1;
59 if(objForm.sambaLogonTime_day.selectedIndex!=-1)
60 daySel=objForm.sambaLogonTime_day.options[objForm.sambaLogonTime_day.selectedIndex].value;
62 var timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
63 var timeDifference = timeOfDayOne - 86400000;
64 var timeOfLastDay = new Date(timeDifference);
66 var daysInMonth = timeOfLastDay.getDate();
68 if(daySel>daysInMonth) daySel=daysInMonth;
70 var selectedDate= new Date(yearSel,monthSel,daySel);
71 for (var i = 0; i < objForm.sambaLogonTime_day.length; i++) {
72 objForm.sambaLogonTime_day.options[0] = null;
73 }
74 for (var i = 0; i < daysInMonth; i++) {
75 objForm.sambaLogonTime_day.options[i] = new Option(i+1);
76 }
77 objForm.sambaLogonTime_day.selectedIndex=daySel-1;
78 saveResult(selectedDate,resultForm);
79 }
80 function populate_sambaLogoffTime(objForm,resultForm) {
81 var yearSel=objForm.sambaLogoffTime_year.options[objForm.sambaLogoffTime_year.selectedIndex].text;
82 var monthIx=objForm.sambaLogoffTime_month.selectedIndex;
83 var nextMonthIx=0;
84 if(monthIx!=11)
85 nextMonthIx=monthIx+1;
87 var nextMonthSel=objForm.sambaLogoffTime_month.options[nextMonthIx].value;
88 var monthSel=objForm.sambaLogoffTime_month.options[monthIx].value;
90 var daySel=1;
91 if(objForm.sambaLogoffTime_day.selectedIndex!=-1)
92 daySel=objForm.sambaLogoffTime_day.options[objForm.sambaLogoffTime_day.selectedIndex].value;
94 var timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
95 var timeDifference = timeOfDayOne - 86400000;
96 var timeOfLastDay = new Date(timeDifference);
98 var daysInMonth = timeOfLastDay.getDate();
100 if(daySel>daysInMonth) daySel=daysInMonth;
102 var selectedDate= new Date(yearSel,monthSel,daySel);
103 for (var i = 0; i < objForm.sambaLogoffTime_day.length; i++) {
104 objForm.sambaLogoffTime_day.options[0] = null;
105 }
106 for (var i = 0; i < daysInMonth; i++) {
107 objForm.sambaLogoffTime_day.options[i] = new Option(i+1);
108 }
109 objForm.sambaLogoffTime_day.selectedIndex=daySel-1;
110 saveResult(selectedDate,resultForm);
111 }
112 function populate_sambaKickoffTime(objForm,resultForm) {
113 var yearSel=objForm.sambaKickoffTime_year.options[objForm.sambaKickoffTime_year.selectedIndex].text;
114 var monthIx=objForm.sambaKickoffTime_month.selectedIndex;
115 var nextMonthIx=0;
116 if(monthIx!=11)
117 nextMonthIx=monthIx+1;
119 var nextMonthSel=objForm.sambaKickoffTime_month.options[nextMonthIx].value;
120 var monthSel=objForm.sambaKickoffTime_month.options[monthIx].value;
122 var daySel=1;
123 if(objForm.sambaKickoffTime_day.selectedIndex!=-1)
124 daySel=objForm.sambaKickoffTime_day.options[objForm.sambaKickoffTime_day.selectedIndex].value;
126 var timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
127 var timeDifference = timeOfDayOne - 86400000;
128 var timeOfLastDay = new Date(timeDifference);
130 var daysInMonth = timeOfLastDay.getDate();
132 if(daySel>daysInMonth) daySel=daysInMonth;
134 var selectedDate= new Date(yearSel,monthSel,daySel);
135 for (var i = 0; i < objForm.sambaKickoffTime_day.length; i++) {
136 objForm.sambaKickoffTime_day.options[0] = null;
137 }
138 for (var i = 0; i < daysInMonth; i++) {
139 objForm.sambaKickoffTime_day.options[i] = new Option(i+1);
140 }
141 objForm.sambaKickoffTime_day.selectedIndex=daySel-1;
142 saveResult(selectedDate,resultForm);
143 }
145 function createResult_sambaLogonTime(objForm,resultForm){
146 yearSel=objForm.sambaLogonTime_year.options[objForm.sambaLogonTime_year.selectedIndex].text;
147 monthIx=objForm.sambaLogonTime_month.selectedIndex;
148 monthSel=objForm.sambaLogonTime_month.options[monthIx].value;
149 daySel=objForm.sambaLogonTime_day.options[objForm.sambaLogonTime_day.selectedIndex].value;
150 selectedDate= new Date(yearSel,monthSel,daySel);
151 saveResult(selectedDate,resultForm);
152 }
153 function createResult_sambaLogoffTime(objForm,resultForm){
154 yearSel=objForm.sambaLogoffTime_year.options[objForm.sambaLogoffTime_year.selectedIndex].text;
155 monthIx=objForm.sambaLogoffTime_month.selectedIndex;
156 monthSel=objForm.sambaLogoffTime_month.options[monthIx].value;
157 daySel=objForm.sambaLogoffTime_day.options[objForm.sambaLogoffTime_day.selectedIndex].value;
158 selectedDate= new Date(yearSel,monthSel,daySel);
159 saveResult(selectedDate,resultForm);
160 }
161 function createResult_sambaKickoffTime(objForm,resultForm){
162 yearSel=objForm.sambaKickoffTime_year.options[objForm.sambaKickoffTime_year.selectedIndex].text;
163 monthIx=objForm.sambaKickoffTime_month.selectedIndex;
164 monthSel=objForm.sambaKickoffTime_month.options[monthIx].value;
165 daySel=objForm.sambaKickoffTime_day.options[objForm.sambaKickoffTime_day.selectedIndex].value;
166 selectedDate= new Date(yearSel,monthSel,daySel);
167 saveResult(selectedDate,resultForm);
168 }