blob: 2747a8c292d74b446b446cf0c0c23faa14d8f61d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
function SuperImage(imgName,onsrc,offsrc)
{
this.HTMLimgName=imgName;
this.onSrc=onsrc;
this.offSrc=offsrc;
this.selected=false;
this.hover=false;
// alert(this.HTMLimgName.toString());
// alert(this.offSrc.toString());
// alert(this.onSrc.toString());
}
new SuperImage("crap","crapon.gif","crapoff.gif");
function SuperImage_over()
{
this.hover=true;
// alert("blap");
this.update();
}
SuperImage.prototype.over=SuperImage_over;
function SuperImage_on()
{
this.selected=true;
this.update();
}
SuperImage.prototype.on=SuperImage_on;
function SuperImage_off()
{
this.selected=false;
this.update();
}
SuperImage.prototype.off=SuperImage_off;
function SuperImage_out()
{
this.hover=false;
this.update();
}
SuperImage.prototype.out=SuperImage_out;
function SuperImage_update()
{
if (document.images)
{
if (this.hover == true || this.selected == true)
document[this.HTMLimgName].src = this.onSrc;
else
document[this.HTMLimgName].src = this.offSrc;
}
}
SuperImage.prototype.update=SuperImage_update;
|