some ie fixes
[lhc/web/wiklou.git] / stylesheets / IEFixes.js
1 // IE fix javascript
2
3 // png alpha transparency fixes
4 window.attachEvent("onload", fixalpha);
5
6 function fixalpha(){
7 // bg
8 var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
9 if (rslt != null && Number(rslt[1]) >= 5.5)
10 {
11 var logoa = document.getElementById('portlet-logo').firstChild;
12 var bg = logoa.currentStyle.backgroundImage;
13 if (bg.match(/\.png/i) != null){
14 var mypng = bg.substring(5,bg.length-2);
15 logoa.style.backgroundImage = "none";
16 logoa.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='image')";
17 }
18
19
20
21 /*
22 for (i=0; i<document.all.length; i++){
23 if(document.all[i].currentStyle && document.all[i].currentStyle.backgroundImage) {
24 var bg = document.all[i].currentStyle.backgroundImage;
25 } else {
26 bg = false;
27 }
28 if (bg){
29 if (bg.match(/\.png/i) != null){
30 var mypng = bg.substring(5,bg.length-2);
31 document.all[i].style.backgroundImage = "none";
32 document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='image')";
33 }
34 }
35 }*/
36 }
37 }