Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
3 lars 1
// JavaScript Document
2
 
3
/*
4
	billigerGesehen.css
5
	...
6
	width:132px;
7
	height:68px;
8
	...
9
 
10
*/
11
 
12
var billigerGesehen_min_x = 132;
13
var billigerGesehen_min_y = 68;
14
var billigerGesehen_max_x = 200;
15
var billigerGesehen_max_y = 290;
16
 
17
var billigerGesehen_step_x = 5;
18
var billigerGesehen_step_y = 10;
19
 
20
var billigerGesehen_time = 5;
21
 
22
var billigerGesehen_action = 0;
23
 
24
function billigerGesehenWidth(obj)
25
{
26
	if (i = obj.style.width.match(/\d+/)) { return parseInt(i); } else { return billigerGesehen_min_x; }
27
}
28
 
29
function billigerGesehenHeight(obj)
30
{
31
	if (i = obj.style.height.match(/\d+/)) { return parseInt(i); } else { return billigerGesehen_min_y; }
32
}
33
 
34
function billigerGesehenVerifyPreisInput(value)
35
{
36
	value = value.replace(/,/,'.');
37
	value = value.replace(/[^\d\.]/g,'');
38
	return value+"€";
39
}
40
 
41
function billigerGesehenSubmit(formObj)
42
{
43
	buffer= new Array;
44
 
45
	with (formObj)
46
	{
47
		if (elements["billigerGesehen[kundeName]"].value == "")
48
			{ buffer.push(" - Ihr Name\n"); }
49
 
50
		if (!elements["billigerGesehen[kundeMail]"].value.match(/@/g))
51
			{ buffer.push(" - Ihre E-Mail-Adresse\n"); }
52
 
53
		if (isNaN(parseFloat(elements["billigerGesehen[kundePreis]"].value)))
54
			{ buffer.push(" - Ihre Preisvorstellung\n"); }
55
	}
56
 
57
	if (buffer.length > 0)
58
	{
59
		alert("Bitte überprüfen Sie Ihre Eingaben in den folgenden Feldern:\n\n\t"+buffer.join("\t"));
60
		return false;
61
	}
62
	else
63
	{
64
		formObj.method='post';
65
		formObj.submit();
66
	}
67
}
68
 
69
function billigerGesehenOpen(obj)
70
{
71
	if (billigerGesehen_action==0)
72
	{
73
		document.getElementById(obj.id+"_body").style.display="block";
74
		document.getElementById(obj.id+"_head").style.display="none";
75
		document.getElementById(obj.id+"_submitButton").style.display="block";
76
 
77
		window.setTimeout("billigerGesehen_action=\"open\"; billigerGesehenFadeIn('"+obj.id+"')", 1);
78
	}
79
}
80
 
81
function billigerGesehenClose(obj)
82
{
83
	if (billigerGesehen_action==0)
84
	{
85
		document.getElementById(obj.id+"_body").style.display="none";
86
		document.getElementById(obj.id+"_head").style.display="block";
87
		document.getElementById(obj.id+"_submitButton").style.display="none";
88
 
89
		window.setTimeout("billigerGesehen_action=\"close\"; billigerGesehenFadeOut('"+obj.id+"')", 1);
90
	}
91
}
92
 
93
function billigerGesehenFadeIn(obj_id)
94
{
95
	if (billigerGesehen_action=="open")
96
	{
97
		var obj=document.getElementById(obj_id);
98
		var loopFlag=false;
99
 
100
		if (billigerGesehenHeight(obj) < billigerGesehen_max_y)
101
			{ loopFlag=true; obj.style.height=(billigerGesehenHeight(obj) + billigerGesehen_step_y) + "px"; }
102
 
103
		if (billigerGesehenWidth(obj) < billigerGesehen_max_x)
104
			{ loopFlag=true; obj.style.width=(billigerGesehenWidth(obj) + billigerGesehen_step_x) + "px"; }
105
 
106
		if (loopFlag==true)
107
			{ window.setTimeout("billigerGesehenFadeIn('"+obj_id+"')", billigerGesehen_time); }
108
		else
109
			{ billigerGesehen_action=0; }
110
	}
111
}
112
 
113
function billigerGesehenFadeOut(obj_id)
114
{
115
	if (billigerGesehen_action=="close")
116
	{
117
		var obj=document.getElementById(obj_id);
118
		var loopFlag=false;
119
 
120
		if (billigerGesehenHeight(obj) > billigerGesehen_min_y)
121
			{ loopFlag=true; obj.style.height=(billigerGesehenHeight(obj) - billigerGesehen_step_y) + "px"; }
122
 
123
		if (billigerGesehenWidth(obj) > billigerGesehen_min_x)
124
			{ loopFlag=true; obj.style.width=(billigerGesehenWidth(obj) - billigerGesehen_step_x) + "px"; }
125
 
126
		if (loopFlag==true)
127
			{ window.setTimeout("billigerGesehenFadeOut('"+obj_id+"')", billigerGesehen_time); }
128
		else
129
			{ billigerGesehen_action=0; }
130
	}
131
}