Subversion-Projekte lars-tiefland.shop_ns

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

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