Subversion Repositories public

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 andreas 1
var AktDocument = 0;
2
 
3
function DetectBrowser ()
4
{
5
var browsername = navigator.appName;
6
 
7
	if (browsername.indexOf("Microsoft") != -1)
8
	{
9
	   browser = "MSIE";
10
	}
11
 	else
12
	{
13
	   browser = "Other";
14
	}
15
 
16
	return browser;
17
}
18
 
19
function MoveTo (url, pars)
20
{
21
	if (pars.length > 0)
22
	{
23
	   window.location = url + "?" + pars;
24
	}
25
	else
26
	{
27
	   window.location = url;
28
	}
29
}
30
 
31
function SetValue(target, val)
32
{
33
	ziel = eval(target);
34
	ziel.value = val;
35
}
36
 
37
function KeyEvent(formular)
38
{
39
	if (DetectBrowser() == "MSIE")
40
	{
41
	   if (window.Event.keyCode == 13)
42
	      formular.submit();
43
	}
44
	else
45
	{
46
	   if (window.Event.which == 13)
47
	      formular.submit();
48
	}
49
}
50
 
51
function Tastendruck(Ereignis)
52
{
53
	if (!Ereignis)
54
	   Ereignis = window.event;
55
 
56
	if (Ereignis.keyCode == 13 && AktDocument != 0)
57
	   AktDocument.submit();
58
}
59
 
60
function SetDate(duration, datum, target)
61
{
62
	sarr = datum.value.split(".");
63
	day = sarr[0];
64
	mon = sarr[1];
65
	year = sarr[2];
66
	d = new Date(year, mon-1, day);
67
	dsec = d.getTime() + (duration * 86400000);
68
	dt = new Date(dsec);
69
	day = dt.getDate();
70
	mon = dt.getMonth() + 1;
71
	year = dt.getFullYear();
72
	target.value = day + "." + mon + "." + year;
73
}
74
 
75
function SetDuration(dtstart, dtend, target)
76
{
77
	dsarr = dtstart.value.split(".");
78
	sday = dsarr[0];
79
	smon = dsarr[1];
80
	syear = dsarr[2];
81
	ds = new Date(syear, smon-1, sday);
82
	dearr = dtend.split(".");
83
	eday = dearr[0];
84
	emon = dearr[1];
85
	eyear = dearr[2];
86
	de = new Date(eyear, emon-1, eday);
87
	ssec = ds.getTime() / 1000;
88
	esec = de.getTime() / 1000;
89
	diff = (esec - ssec) / 86400;
90
	target.value = diff;
91
}
92
 
93
function CheckDateOrder(dtstart, dtend)
94
{
95
	dsarr = dtstart.value.split(".");
96
	sday = dsarr[0];
97
	smon = dsarr[1];
98
	syear = dsarr[2];
99
	ds = new Date(syear, smon-1, sday);
100
	dearr = dtend.value.split(".");
101
	eday = dearr[0];
102
	emon = dearr[1];
103
	eyear = dearr[2];
104
	de = new Date(eyear, emon-1, eday);
105
	ssec = ds.getTime();
106
	esec = de.getTime();
107
 
108
	if (ssec > esec)
109
	{
110
	   alert("Das Startdatum muss kleiner als das Endedatum sein!");
111
	   dtstart.focus();
112
	   return false;
113
	}
114
 
115
	return true;
116
}
117
 
118
function CheckDate(datum, light)
119
{
120
	dsarr = datum.value.split(".");
121
 
122
	if (light)
123
	{
124
	   day = 1;
125
	   mon = dsarr[0];
126
	   year = dsarr[1];
127
	}
128
	else
129
	{
130
	   day = dsarr[0];
131
	   mon = dsarr[1];
132
	   year = dsarr[2];
133
	}
134
 
135
	dat = new Date(year, mon-1, day);
136
	cday = dat.getDate();
137
	cmon = dat.getMonth() + 1;
138
	cyear = dat.getFullYear();
139
 
140
	if (cday != day || cmon != mon || cyear != year)
141
	{
142
	   alert("Ungültiges Datum!");
143
	   datum.focus();
144
	   return false;
145
	}
146
 
147
	return true;
148
}
149
 
150
function CheckTime(zeit)
151
{
152
var hour = 0;
153
var min = 0;
154
 
155
	zarr = zeit.value.split(":");
156
	hour = zarr[0];
157
	min = zarr[1];
158
 
159
	if (hour < 0 || hour > 23 || min < 0 || min > 59)
160
< 0 || hour >< 0 || min >	{
161
< 0 || hour >< 0 || min >	   alert("Ungültige Uhrzeit!");
162
< 0 || hour >< 0 || min >	   zeit.focus();
163
< 0 || hour >< 0 || min >	   return false;
164
< 0 || hour >< 0 || min >	}
165
 
166
< 0 || hour >< 0 || min >	return true;
167
< 0 || hour >< 0 || min >}
168
 
169
< 0 || hour >< 0 || min >function CheckOverload(val, ist_hours, max_hours)
170
< 0 || hour >< 0 || min >{
171
< 0 || hour >< 0 || min >var wert = val.value;
172
 
173
< 0 || hour >< 0 || min >	wert = wert.replace(/,/, ".");
174
 
175
< 0 || hour >< 0 || min >	if (ist_hours >= max_hours)
176
< 0 || hour >< 0 || min >	{
177
< 0 || hour >< 0 || min >	   alert("Diese Ressource ist bereits mit "+ist_hours+" PT's von maximal "+max_hours+" überbucht!");
178
< 0 || hour >< 0 || min >	   val.focus();
179
< 0 || hour >< 0 || min >	   return false;
180
< 0 || hour >< 0 || min >	}
181
 
182
< 0 || hour >< 0 || min >	rest = max_hours - ist_hours;
183
 
184
< 0 || hour >< 0 || min >	if (wert > rest)
185
< 0 || hour >< 0 || min >	{
186
< 0 || hour >< 0 || min >	   zuviel = wert - rest;
187
< 0 || hour >< 0 || min >	   alert("Diese Ressource ist mit "+zuviel+" PT's von maximal "+max_hours+" überbucht!");
188
< 0 || hour >< 0 || min >	   val.focus();
189
< 0 || hour >< 0 || min >	   return false;
190
< 0 || hour >< 0 || min >	}
191
 
192
< 0 || hour >< 0 || min >	return true;
193
< 0 || hour >< 0 || min >}
194
 
195
< 0 || hour >< 0 || min >function dx(d)
196
< 0 || hour >< 0 || min >{
197
< 0 || hour >< 0 || min >var z = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
198
< 0 || hour >< 0 || min >var x = "";
199
< 0 || hour >< 0 || min >var i = 1, v = d, r = 0;
200
 
201
< 0 || hour >< 0 || min >	max = Math.pow(16,8);
202
< 0 || hour >< 0 || min >	hex = "";
203
 
204
< 0 || hour >< 0 || min >	if(d > max)
205
< 0 || hour >< 0 || min >	{
206
< 0 || hour >< 0 || min >	   hex = "NIL";
207
< 0 || hour >< 0 || min >	   return hex;
208
< 0 || hour >< 0 || min >	}
209
 
210
< 0 || hour >< 0 || min >	if(d < 0)
211
< 0 || hour >< 0 || min >< 0)	{
212
< 0 || hour >< 0 || min >< 0)	   hex = "NIL";
213
< 0 || hour >< 0 || min >< 0)	   return hex;
214
< 0 || hour >< 0 || min >< 0)	}
215
 
216
< 0 || hour >< 0 || min >< 0)	while(v > 15)
217
< 0 || hour >< 0 || min >< 0)	{
218
< 0 || hour >< 0 || min >< 0)	   v = Math.floor(v / 16);
219
< 0 || hour >< 0 || min >< 0)	   i++;
220
< 0 || hour >< 0 || min >< 0)	}
221
 
222
< 0 || hour >< 0 || min >< 0)	v = d;
223
 
224
< 0 || hour >< 0 || min >< 0)	for(j = i; j >= 1; j--)
225
< 0 || hour >< 0 || min >< 0)	{
226
< 0 || hour >< 0 || min >< 0)	   x = x + z[Math.floor(v / Math.pow(16,j-1))];
227
< 0 || hour >< 0 || min >< 0)	   v = v - (Math.floor(v / Math.pow(16,j-1)) * Math.pow(16,j-1));
228
< 0 || hour >< 0 || min >< 0)	}
229
 
230
< 0 || hour >< 0 || min >< 0)	hex = x;
231
 
232
< 0 || hour >< 0 || min >< 0)	if (hex.length < 2)
233
< 0 || hour >< 0 || min >< 0)	{
234
< 0 || hour >< 0 || min >< 0)	   hex = "0"+hex;
235
< 0 || hour >< 0 || min >< 0)	}
236
 
237
< 0 || hour >< 0 || min >< 0)	return hex;
238
< 0 || hour >< 0 || min >< 0)}
239
 
240
< 0 || hour >< 0 || min >< 0)function Farbe(R,G,B,target)
241
< 0 || hour >< 0 || min >< 0){
242
< 0 || hour >< 0 || min >< 0)var Rx = dx(R);
243
< 0 || hour >< 0 || min >< 0)var Gx = dx(G);
244
< 0 || hour >< 0 || min >< 0)var Bx = dx(B);
245
< 0 || hour >< 0 || min >< 0)var color = Rx+Gx+Bx;
246
 
247
< 0 || hour >< 0 || min >< 0)	SetValue(target, color);
248
< 0 || hour >< 0 || min >< 0)}
249
 
250
< 0 || hour >< 0 || min >< 0)function NumRange(num, low, high)
251
< 0 || hour >< 0 || min >< 0){
252
< 0 || hour >< 0 || min >< 0)var zahl = num.value;
253
 
254
< 0 || hour >< 0 || min >< 0)	if (zahl < low || zahl > high)
255
< 0 || hour >< 0 || min >< 0)	{
256
< 0 || hour >< 0 || min >< 0)	   alert("Eingegebener Wert ist außerhalb des gültigen Bereichs!");
257
< 0 || hour >< 0 || min >< 0)	   num.focus();
258
< 0 || hour >< 0 || min >< 0)	   return false;
259
< 0 || hour >< 0 || min >< 0)	}
260
 
261
< 0 || hour >< 0 || min >< 0)	return true;
262
< 0 || hour >< 0 || min >< 0)}
263
 
264
< 0 || hour >< 0 || min >< 0)function FormatNum(num, komma)
265
< 0 || hour >< 0 || min >< 0){
266
< 0 || hour >< 0 || min >< 0)var vork = parseInt(num);
267
< 0 || hour >< 0 || min >< 0)var nachk = 0;
268
< 0 || hour >< 0 || min >< 0)var str = "";
269
 
270
< 0 || hour >< 0 || min >< 0)	if ((num > 0.0 || num < 0.0) && vork != num)
271
< 0 || hour >< 0 || min >< 0)	   nachk = parseInt((num - vork) * Math.pow(10, komma));
272
< 0 || hour >< 0 || min >< 0)	else if (vork == num)
273
< 0 || hour >< 0 || min >< 0)	{
274
< 0 || hour >< 0 || min >< 0)	   str = String(vork) + ",";
275
< 0 || hour >< 0 || min >< 0)	   i = 0;
276
 
277
< 0 || hour >< 0 || min >< 0)	   while (i < komma)
278
< 0 || hour >< 0 || min >< 0)	   {
279
< 0 || hour >< 0 || min >< 0)	      str = str + "0";
280
< 0 || hour >< 0 || min >< 0)	      i++;
281
< 0 || hour >< 0 || min >< 0)	   }
282
 
283
< 0 || hour >< 0 || min >< 0)	   return str;
284
< 0 || hour >< 0 || min >< 0)	}
285
< 0 || hour >< 0 || min >< 0)	else if (num == 0.0)
286
< 0 || hour >< 0 || min >< 0)	{
287
< 0 || hour >< 0 || min >< 0)	   str = "0,";
288
< 0 || hour >< 0 || min >< 0)	   i = 0;
289
 
290
< 0 || hour >< 0 || min >< 0)	   while (i < komma)
291
< 0 || hour >< 0 || min >< 0)	   {
292
< 0 || hour >< 0 || min >< 0)	      str = str + "0";
293
< 0 || hour >< 0 || min >< 0)	      i++;
294
< 0 || hour >< 0 || min >< 0)	   }
295
 
296
< 0 || hour >< 0 || min >< 0)	   return str;
297
< 0 || hour >< 0 || min >< 0)	}
298
 
299
< 0 || hour >< 0 || min >< 0)	str = String(vork) + "," + String(nachk);
300
< 0 || hour >< 0 || min >< 0)	return str;
301
< 0 || hour >< 0 || min >< 0)}
302
 
303
< 0 || hour >< 0 || min >< 0)function CheckTrue(b)
304
< 0 || hour >< 0 || min >< 0){
305
< 0 || hour >< 0 || min >< 0)	if (b == "true" || b == "t" || b == true || b == 1)
306
< 0 || hour >< 0 || min >< 0)	   return true;
307
 
308
< 0 || hour >< 0 || min >< 0)	return false;
309
< 0 || hour >< 0 || min >< 0)}
310
 
311
< 0 || hour >< 0 || min >< 0)function open_window(mypage, myname, w, h)
312
< 0 || hour >< 0 || min >< 0){
313
< 0 || hour >< 0 || min >< 0)var winl = screen.width;
314
< 0 || hour >< 0 || min >< 0)var wint = screen.height;
315
< 0 || hour >< 0 || min >< 0)var menubar = 'yes';
316
< 0 || hour >< 0 || min >< 0)var browser = DetectBrowser();
317
 
318
< 0 || hour >< 0 || min >< 0)	if (winl < w)
319
< 0 || hour >< 0 || min >< 0)	   winl = 0;
320
< 0 || hour >< 0 || min >< 0)	else
321
< 0 || hour >< 0 || min >< 0)	   winl = (winl - w) / 2;
322
 
323
< 0 || hour >< 0 || min >< 0)	if (wint < h)
324
< 0 || hour >< 0 || min >< 0)< h)	   wint = 0;
325
< 0 || hour >< 0 || min >< 0)< h)	else
326
< 0 || hour >< 0 || min >< 0)< h)	   wint = (wint - h) / 2;
327
 
328
< 0 || hour >< 0 || min >< 0)< h)	if (browser == 'MSIE')
329
< 0 || hour >< 0 || min >< 0)< h)	   menubar = 'no';
330
 
331
< 0 || hour >< 0 || min >< 0)< h)	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizeable=yes,menubar='+menubar+',dependent=yes';
332
< 0 || hour >< 0 || min >< 0)< h)	win = window.open(mypage,myname,winprops);
333
 
334
< 0 || hour >< 0 || min >< 0)< h)	if (parseInt(navigator.appVersion) >= 4)
335
< 0 || hour >< 0 || min >< 0)< h)	{
336
< 0 || hour >< 0 || min >< 0)< h)	   win.window.focus();
337
< 0 || hour >< 0 || min >< 0)< h)	}
338
< 0 || hour >< 0 || min >< 0)< h)}
339
 
340
< 0 || hour >< 0 || min >< 0)< h)function open_mwindow(mypage, myname, w, h)
341
< 0 || hour >< 0 || min >< 0)< h){
342
< 0 || hour >< 0 || min >< 0)< h)var winl = screen.width;
343
< 0 || hour >< 0 || min >< 0)< h)var wint = screen.height;
344
< 0 || hour >< 0 || min >< 0)< h)var menubar = 'yes';
345
< 0 || hour >< 0 || min >< 0)< h)var browser = DetectBrowser();
346
 
347
< 0 || hour >< 0 || min >< 0)< h)	if (winl < w)
348
< 0 || hour >< 0 || min >< 0)< h)	   winl = 0;
349
< 0 || hour >< 0 || min >< 0)< h)	else
350
< 0 || hour >< 0 || min >< 0)< h)	   winl = (winl - w) / 2;
351
 
352
< 0 || hour >< 0 || min >< 0)< h)	if (wint < h)
353
< 0 || hour >< 0 || min >< 0)< h)< h)	   wint = 0;
354
< 0 || hour >< 0 || min >< 0)< h)< h)	else
355
< 0 || hour >< 0 || min >< 0)< h)< h)	   wint = (wint - h) / 2;
356
 
357
< 0 || hour >< 0 || min >< 0)< h)< h)	if (browser == 'MSIE')
358
< 0 || hour >< 0 || min >< 0)< h)< h)	   menubar = 'no';
359
 
360
< 0 || hour >< 0 || min >< 0)< h)< h)	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizeable=yes,menubar='+menubar+',dependent=yes';
361
< 0 || hour >< 0 || min >< 0)< h)< h)	win = window.open(mypage,myname,winprops);
362
 
363
< 0 || hour >< 0 || min >< 0)< h)< h)	if (parseInt(navigator.appVersion) >= 4)
364
< 0 || hour >< 0 || min >< 0)< h)< h)	{
365
< 0 || hour >< 0 || min >< 0)< h)< h)	   win.window.focus();
366
< 0 || hour >< 0 || min >< 0)< h)< h)	}
367
 
368
< 0 || hour >< 0 || min >< 0)< h)< h)	win.window.print();
369
< 0 || hour >< 0 || min >< 0)< h)< h)}