//
// Created on: <18-Nov-2004 10:54:01 bh>
//
// SOFTWARE NAME: eZ publish
// SOFTWARE RELEASE: 3.9.2
// BUILD VERSION: 18839
// COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
// SOFTWARE LICENSE: GNU General Public License v2.0
// NOTICE: >
//   This program is free software; you can redistribute it and/or
//   modify it under the terms of version 2.0  of the GNU General
//   Public License as published by the Free Software Foundation.
//
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of version 2.0 of the GNU General
//   Public License along with this program; if not, write to the Free
//   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//   MA 02110-1301, USA.
//
//
            
/*! \file eziepngfix.js
*/


/*!
  Forces use of DirectX transparency filter for image tags with
  "transparent-png-icon" as class. The result: correct alpha 
  blending for normal (32x32) PNG icons in Internet Explorer.
*/
function useDirectXAlphaBlender()
{
    var images = document.getElementsByTagName( "img" );

    for( var i=0; i<images.length; i++ )
    {
        if( images[i].className == "transparent-png-icon" )
        {
            images[i].runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + images[i].src + "', sizingMethod='scale')";
            
            if( images[i].width == 16 )
            {           
                images[i].src = emptyIcon16;
            }
            else
            {
                images[i].src = emptyIcon32;
            }
        }
    }
}

window.attachEvent( "onload", useDirectXAlphaBlender );
