/**
* I. Use in <HEAD> with DEFER keyword wrapped in conditional comments:
* <!--[if lt IE 7]>
* <script defer type="text/javascript" src="pngfix.js"></script>
* <![endif]-->
* II. Assign to blankSrc path to transparent gif image
*
* @author Pavel Kulbakin 
*
*/
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
var blankSrc = "/images/zero.gif"
if ((version >= 5.5) && (document.body.filters)) 
{
   /*for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
         $(img).load(function(){
            $('meta').attr('test','3');
            $(this).width(this.width.toString()+'px');
            $(this).height(this.height.toString()+'px');
            $(this).css('filter',"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='scale')");
            $(this).attr('src',blankSrc)
         });
      }
   }*/
   $(document).ready(function(){
      $('img').each(function(){
         if (this.src.toUpperCase().replace(/.*\./g,'')=='PNG'){
            //.attr('src',this.src) - fix for execute load event
            $(this).attr('src',this.src).load(function(){
               if(this.src.indexOf(blankSrc)==-1){
                  $(this).css('width',$(this).width()+'px');
                  $(this).css('height',$(this).height()+'px');
                  $(this).css('filter',"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + $(this).attr('src') + "', sizingMethod='scale')");
                  $(this).attr('src',blankSrc);
               }
            });
         }
      });
   });
   
}

