Merge branch 'topic/2009-conferences' of gitmo@git.moose.perl.org:moose-website
[gitmo/moose-website.git] / hosted-presentations / 2008 / nothingmuch-PTPW / ui / default / iepngfix.htc
CommitLineData
720accfe 1<public:component>\r
2<public:attach event="onpropertychange" onevent="doFix()" />\r
3\r
4<script>\r
5\r
6// IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull http://www.twinhelix.com\r
7// Free usage permitted as long as this notice remains intact.\r
8\r
9// This must be a path to a blank image. That's all the configuration you need here.\r
10var blankImg = 'ui/default/blank.gif';\r
11\r
12var f = 'DXImageTransform.Microsoft.AlphaImageLoader';\r
13\r
14function filt(s, m) {\r
15 if (filters[f]) {\r
16 filters[f].enabled = s ? true : false;\r
17 if (s) with (filters[f]) { src = s; sizingMethod = m }\r
18 } else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';\r
19}\r
20\r
21function doFix() {\r
22 if ((parseFloat(navigator.userAgent.match(/MSIE (\S+)/)[1]) < 5.5) ||\r
23 (event && !/(background|src)/.test(event.propertyName))) return;\r
24\r
25 if (tagName == 'IMG') {\r
26 if ((/\.png$/i).test(src)) {\r
27 filt(src, 'image'); // was 'scale'\r
28 src = blankImg;\r
29 } else if (src.indexOf(blankImg) < 0) filt();\r
30 } else if (style.backgroundImage) {\r
31 if (style.backgroundImage.match(/^url[("']+(.*\.png)[)"']+$/i)) {\r
32 var s = RegExp.$1;\r
33 style.backgroundImage = '';\r
34 filt(s, 'crop');\r
35 } else filt();\r
36 }\r
37}\r
38\r
39doFix();\r
40\r
41</script>\r
42</public:component>