/* the following code checks to see if a user is on a windows machine, and if the browser is IE.  
If this is the case it will attach an onload handler once all of the markup is loaded to enable all alpha transparencies*/
if (navigator.platform == "Win32"
        && navigator.appName == "Microsoft Internet Explorer"
        && window.attachEvent)
{
        window.attachEvent("onload", enableAlphaImages);
}

/*
* This function is what is attached and run at load time 
*/
function enableAlphaImages(){
	var url = window.location.host; 
	/* spacer path is the path to the blank.gif file, this will need to set accordingly */
	spacerPath = '/resource/image/blank.gif';
	/* checks to see if the browser is IE, and if the version is greater than IE 5.5 */
        var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
        if ((rslt != null && Number(rslt[1]) >= 5.5  && Number(rslt[1]) < 7)) { 
                /* scans all of the elements of the document for png images that have a class of "uvTransparent" */
		for (var i=0; i<document.all.length; i++){
                        var obj = document.all[i];
                        var img = document.images[i];
                        if (img && img.src.match(/\.png$/i) != null && img.className.match('uvTransparent')) {                               
                                var src = img.src;  
                                img.style.width = img.width + "px";
                                img.style.height = img.height + "px";
                                img.style.filter =
                                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')"
                                img.src = spacerPath;
                        }

                }
        }
}

var enableAlphaImage = function( img ){
	var url = window.location.host;

        var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
        if ((rslt != null && Number(rslt[1]) >= 5.5 && Number(rslt[1]) < 7)) {
                        if (img && img.src.match(/\.png$/i) != null ) {
                                var src = img.src;
                                img.style.width = img.width + "px";
                                img.style.height = img.height + "px";
                                img.style.filter =
                                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')"
                                img.src = spacerPath;
                        }

        }
}

