blob: ab47a538e2748a35c00764ccc0b7995fb1dfcbdd (
plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
// Parts derived from:
// Opacity Displayer, Version 1.0
// Copyright Michael Lovitt, 6/2002.
// Distribute freely, but please leave this notice intact.
// http://www.alistapart.com/articles/pngopacity/
// Parts derived from:
// Natural Docs
// Copyright (C) 2003-2004 Greg Valure
// http://www.naturaldocs.org/
var pngTransform;
var pngNormal;
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1)
{
if ( (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1) &&
agt.indexOf("mac") != -1)
{
pngNormal = 1;
}
else if (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1 ||
agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1)
{
pngNormal = 1;
}
}
else if (agt.indexOf("msie") != -1)
{
if (agt.indexOf("msie 5.5") != -1 || agt.indexOf("msie 6") != -1)
{
if (agt.indexOf("mac") != -1)
{ pngNormal = 1; }
else if (agt.indexOf("win") != -1)
{ pngTransform = 1; };
}
else if (agt.indexOf("msie 5") != -1)
{
if (agt.indexOf("mac") != -1)
{ pngNormal = 1; };
}
else if (agt.indexOf("msie 7") != -1)
{ pngNormal = 1; }
}
else if (agt.indexOf("gecko") != -1)
{
pngNormal = 1;
}
function PNGGIF(strPath, intWidth, intHeight, strAlt, strID)
{
if (pngTransform)
{
document.write('<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'.png\', sizingMethod=\'scale\')" id="'+strID+'"></div>');
}
else if (pngNormal)
{
document.write('<img src="'+strPath+'.png" width="'+intWidth+'" height="'+intHeight+'" alt="'+strAlt+'" id="'+strID+'"/>');
}
else
{
document.write('<img src="'+strPath+'.gif" width="'+intWidth+'" height="'+intHeight+'" alt="'+strAlt+'" id="'+strID+'" />');
}
};
|