Subversion-Projekte lars-tiefland.webanos.zeldi.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
4 lars 1
// JavaScript Document
2
 
3
/*
4
    billigerGesehen.css
5
    ...
6
    width:132px;
7
    height:68px;
8
    ...
9
 
10
*/
11
 
12
 
13
 
14
var billigerGesehen_min_x = 212; // Breite geschlossen
15
var billigerGesehen_min_y = 68; // Höhe geschlossen
16
 
17
var billigerGesehen_max_x = 412; // Breite geöffnet
18
var billigerGesehen_max_y = 225; // Höhe geöffnet
19
 
20
var billigerGesehen_step_x = 10;
21
var billigerGesehen_step_y = 10;
22
 
23
var billigerGesehen_time = 5;
24
 
25
var billigerGesehen_action = 0;
26
 
27
var agent = navigator.userAgent.toLowerCase();
28
 
29
function billigerGesehenWidth(obj)
30
{
31
    if (i = obj.style.width.match(/\d+/)) {
32
 
33
           if (agent.indexOf('msie')==true) {
34
               obj.style.marginLeft = -(parseInt(i)-billigerGesehen_min_x)+'px';
35
        }else{
36
            obj.style.marginLeft = 0+'px';
37
        }
38
 
39
        return parseInt(i);
40
    } else {
41
        return billigerGesehen_min_x;
42
    }
43
}
44
 
45
function billigerGesehenHeight(obj)
46
{
47
    if (i = obj.style.height.match(/\d+/)) { return parseInt(i); } else { return billigerGesehen_min_y; }
48
}
49
 
50
function billigerGesehenVerifyPreisInput(value)
51
{
52
    value = value.replace(/,/,'.');
53
    value = value.replace(/[^\d\.]/g,'');
54
    return value+" Euro";
55
}
56
 
57
function billigerGesehenSubmit(formObj)
58
{
59
    buffer= new Array;
60
 
61
    with (formObj)
62
    {
63
        if (billigerGesehen_kundeName.value == "")
64
        {
65
            buffer.push(" - Ihr Name\n");
66
        }
67
 
68
        if (!billigerGesehen_kundeMail.value.match(/@/g))
69
        {
70
            buffer.push(" - Ihre E-Mail-Adresse\n");
71
        }
72
 
73
        if (billigerGesehen_kundePLZ.value == "")
74
        {
75
            buffer.push(" - Ihre Postleitzahl\n");
76
        }
77
 
78
        if (isNaN(parseFloat(billigerGesehen_kundePreis.value)))
79
        {
80
            buffer.push(" - Ihre Preisvorstellung\n");
81
        }
82
    }
83
 
84
    if (buffer.length > 0)
85
    {
86
        alert("Bitte überprüfen Sie Ihre Eingaben in den folgenden Feldern:\n\n\t"+buffer.join("\t"));
87
        return false;
88
    }
89
    else
90
    {
91
        formObj.method='post';
92
        formObj.submit();
93
    }
94
}
95
 
96
function billigerGesehenOpen(obj)
97
{
98
    if (billigerGesehen_action==0)
99
    {
100
        document.getElementById('col_1').style.marginLeft = "381px";
101
        document.getElementById(obj.id+"_body").style.display="block";
102
        document.getElementById(obj.id+"_head").style.display="none";
103
        document.getElementById(obj.id+"_submitButton").style.display="block";
104
 
105
        window.setTimeout("billigerGesehen_action=\"open\"; billigerGesehenFadeIn('"+obj.id+"')", 1);
106
    }
107
 
108
}
109
 
110
function billigerGesehenClose(obj)
111
{
112
    if (billigerGesehen_action==0)
113
    {
114
        document.getElementById(obj.id+"_body").style.display="none";
115
        document.getElementById(obj.id+"_head").style.display="block";
116
        document.getElementById(obj.id+"_submitButton").style.display="none";
117
 
118
        window.setTimeout("billigerGesehen_action=\"close\"; billigerGesehenFadeOut('"+obj.id+"')", 1);
119
 
120
    }
121
 
122
}
123
 
124
function billigerGesehenFadeIn(obj_id) {
125
 
126
    if (billigerGesehen_action=="open")
127
    {
128
        var obj=document.getElementById(obj_id);
129
        var loopFlag=false;
130
 
131
        if (billigerGesehenHeight(obj) < billigerGesehen_max_y)
132
            { loopFlag=true; obj.style.height=(billigerGesehenHeight(obj) + billigerGesehen_step_y) + "px"; }
133
 
134
        if (billigerGesehenWidth(obj) < billigerGesehen_max_x)
135
            {
136
                loopFlag=true;
137
                obj.style.width=(billigerGesehenWidth(obj) + billigerGesehen_step_x) + "px";
138
 
139
            }
140
 
141
        if (loopFlag==true)
142
            { window.setTimeout("billigerGesehenFadeIn('"+obj_id+"')", billigerGesehen_time); }
143
        else
144
            { billigerGesehen_action=0; }
145
    }
146
}
147
 
148
function billigerGesehenFadeOut(obj_id)
149
{
150
    if (billigerGesehen_action=="close")
151
    {
152
        var obj=document.getElementById(obj_id);
153
        var loopFlag=false;
154
 
155
        if (billigerGesehenHeight(obj) > billigerGesehen_min_y)
156
            { loopFlag=true; obj.style.height=(billigerGesehenHeight(obj) - billigerGesehen_step_y) + "px"; }
157
 
158
        if (billigerGesehenWidth(obj) > billigerGesehen_min_x)
159
            {
160
                loopFlag=true; obj.style.width=(billigerGesehenWidth(obj) - billigerGesehen_step_x) + "px";
161
 
162
 
163
            }
164
 
165
        if (loopFlag==true)
166
            { window.setTimeout("billigerGesehenFadeOut('"+obj_id+"')", billigerGesehen_time); }
167
        else
168
            { billigerGesehen_action=0; }
169
 
170
        if (agent.indexOf('msie')==-1) {
171
            obj.style.marginLeft = "198px";
172
        }
173
    }
174
}