830deb078ff93b63c6d001ff7961bde105e02fd7
1 function populate(objForm,resultForm) {
2 if(objForm.year) {
3 yearSel=objForm.year.options[objForm.year.selectedIndex].text;
5 monthIx=objForm.month.selectedIndex;
6 nextMonthIx=0;
7 if(monthIx!=11)
8 nextMonthIx=monthIx+1;
10 nextMonthSel=objForm.month.options[nextMonthIx].value;
11 monthSel=objForm.month.options[monthIx].value;
13 daySel=1;
14 if(objForm.day.selectedIndex!=-1)
15 daySel=objForm.day.options[objForm.day.selectedIndex].value;
17 timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
18 timeDifference = timeOfDayOne - 86400000;
19 timeOfLastDay = new Date(timeDifference);
21 var daysInMonth = timeOfLastDay.getDate();
23 if(daySel>daysInMonth) daySel=daysInMonth;
25 selectedDate= new Date(yearSel,monthSel,daySel);
26 for (var i = 0; i < objForm.day.length; i++) {
27 objForm.day.options[0] = null;
28 }
29 for (var i = 0; i < daysInMonth; i++) {
30 objForm.day.options[i] = new Option(i+1);
31 }
32 objForm.day.selectedIndex=daySel-1;
33 saveResult(selectedDate,resultForm);
34 }
35 }
37 function createResult(objForm,resultForm){
38 yearSel=objForm.year.options[objForm.year.selectedIndex].text;
39 monthIx=objForm.month.selectedIndex;
40 monthSel=objForm.month.options[monthIx].value;
41 daySel=objForm.day.options[objForm.day.selectedIndex].value;
42 selectedDate= new Date(yearSel,monthSel,daySel);
43 saveResult(selectedDate,resultForm);
44 }
46 function saveResult(selectedDate,resultForm){
47 timeInSeconds=Math.floor((selectedDate.getTime() - selectedDate.getTimezoneOffset() * 60000 ) / 1000);
48 resultForm.value=timeInSeconds;
49 }
51 function populate_sambaLogonTime(objForm,resultForm) {
52 var yearSel=objForm.sambaLogonTime_year.options[objForm.sambaLogonTime_year.selectedIndex].text;
53 var monthIx=objForm.sambaLogonTime_month.selectedIndex;
54 var nextMonthIx=0;
55 if(monthIx!=11)
56 nextMonthIx=monthIx+1;
58 var nextMonthSel=objForm.sambaLogonTime_month.options[nextMonthIx].value;
59 var monthSel=objForm.sambaLogonTime_month.options[monthIx].value;
61 var daySel=1;
62 if(objForm.sambaLogonTime_day.selectedIndex!=-1)
63 daySel=objForm.sambaLogonTime_day.options[objForm.sambaLogonTime_day.selectedIndex].value;
65 var timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
66 var timeDifference = timeOfDayOne - 86400000;
67 var timeOfLastDay = new Date(timeDifference);
69 var daysInMonth = timeOfLastDay.getDate();
71 if(daySel>daysInMonth) daySel=daysInMonth;
73 var selectedDate= new Date(yearSel,monthSel,daySel);
74 for (var i = 0; i < objForm.sambaLogonTime_day.length; i++) {
75 objForm.sambaLogonTime_day.options[0] = null;
76 }
77 for (var i = 0; i < daysInMonth; i++) {
78 objForm.sambaLogonTime_day.options[i] = new Option(i+1);
79 }
80 objForm.sambaLogonTime_day.selectedIndex=daySel-1;
81 saveResult(selectedDate,resultForm);
82 }
83 function populate_sambaLogoffTime(objForm,resultForm) {
84 var yearSel=objForm.sambaLogoffTime_year.options[objForm.sambaLogoffTime_year.selectedIndex].text;
85 var monthIx=objForm.sambaLogoffTime_month.selectedIndex;
86 var nextMonthIx=0;
87 if(monthIx!=11)
88 nextMonthIx=monthIx+1;
90 var nextMonthSel=objForm.sambaLogoffTime_month.options[nextMonthIx].value;
91 var monthSel=objForm.sambaLogoffTime_month.options[monthIx].value;
93 var daySel=1;
94 if(objForm.sambaLogoffTime_day.selectedIndex!=-1)
95 daySel=objForm.sambaLogoffTime_day.options[objForm.sambaLogoffTime_day.selectedIndex].value;
97 var timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
98 var timeDifference = timeOfDayOne - 86400000;
99 var timeOfLastDay = new Date(timeDifference);
101 var daysInMonth = timeOfLastDay.getDate();
103 if(daySel>daysInMonth) daySel=daysInMonth;
105 var selectedDate= new Date(yearSel,monthSel,daySel);
106 for (var i = 0; i < objForm.sambaLogoffTime_day.length; i++) {
107 objForm.sambaLogoffTime_day.options[0] = null;
108 }
109 for (var i = 0; i < daysInMonth; i++) {
110 objForm.sambaLogoffTime_day.options[i] = new Option(i+1);
111 }
112 objForm.sambaLogoffTime_day.selectedIndex=daySel-1;
113 saveResult(selectedDate,resultForm);
114 }
115 function populate_sambaKickoffTime(objForm,resultForm) {
116 var yearSel=objForm.sambaKickoffTime_year.options[objForm.sambaKickoffTime_year.selectedIndex].text;
117 var monthIx=objForm.sambaKickoffTime_month.selectedIndex;
118 var nextMonthIx=0;
119 if(monthIx!=11)
120 nextMonthIx=monthIx+1;
122 var nextMonthSel=objForm.sambaKickoffTime_month.options[nextMonthIx].value;
123 var monthSel=objForm.sambaKickoffTime_month.options[monthIx].value;
125 var daySel=1;
126 if(objForm.sambaKickoffTime_day.selectedIndex!=-1)
127 daySel=objForm.sambaKickoffTime_day.options[objForm.sambaKickoffTime_day.selectedIndex].value;
129 var timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
130 var timeDifference = timeOfDayOne - 86400000;
131 var timeOfLastDay = new Date(timeDifference);
133 var daysInMonth = timeOfLastDay.getDate();
135 if(daySel>daysInMonth) daySel=daysInMonth;
137 var selectedDate= new Date(yearSel,monthSel,daySel);
138 for (var i = 0; i < objForm.sambaKickoffTime_day.length; i++) {
139 objForm.sambaKickoffTime_day.options[0] = null;
140 }
141 for (var i = 0; i < daysInMonth; i++) {
142 objForm.sambaKickoffTime_day.options[i] = new Option(i+1);
143 }
144 objForm.sambaKickoffTime_day.selectedIndex=daySel-1;
145 saveResult(selectedDate,resultForm);
146 }
148 function createResult_sambaLogonTime(objForm,resultForm){
149 yearSel=objForm.sambaLogonTime_year.options[objForm.sambaLogonTime_year.selectedIndex].text;
150 monthIx=objForm.sambaLogonTime_month.selectedIndex;
151 monthSel=objForm.sambaLogonTime_month.options[monthIx].value;
152 daySel=objForm.sambaLogonTime_day.options[objForm.sambaLogonTime_day.selectedIndex].value;
153 selectedDate= new Date(yearSel,monthSel,daySel);
154 saveResult(selectedDate,resultForm);
155 }
156 function createResult_sambaLogoffTime(objForm,resultForm){
157 yearSel=objForm.sambaLogoffTime_year.options[objForm.sambaLogoffTime_year.selectedIndex].text;
158 monthIx=objForm.sambaLogoffTime_month.selectedIndex;
159 monthSel=objForm.sambaLogoffTime_month.options[monthIx].value;
160 daySel=objForm.sambaLogoffTime_day.options[objForm.sambaLogoffTime_day.selectedIndex].value;
161 selectedDate= new Date(yearSel,monthSel,daySel);
162 saveResult(selectedDate,resultForm);
163 }
164 function createResult_sambaKickoffTime(objForm,resultForm){
165 yearSel=objForm.sambaKickoffTime_year.options[objForm.sambaKickoffTime_year.selectedIndex].text;
166 monthIx=objForm.sambaKickoffTime_month.selectedIndex;
167 monthSel=objForm.sambaKickoffTime_month.options[monthIx].value;
168 daySel=objForm.sambaKickoffTime_day.options[objForm.sambaKickoffTime_day.selectedIndex].value;
169 selectedDate= new Date(yearSel,monthSel,daySel);
170 saveResult(selectedDate,resultForm);
171 }