/**
 * below methods (fixPngs() and fixPng(png)) was implemented as on
 * http://docs.jquery.com/Tutorials:PNG_Opacity_Fix_for_IE6
 */
function fixPngs() {
   jQuery(document).ready(function() {
      var uan = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
      var fix = (uan != null && Number(uan[1]) >= 5.5 && Number(uan[1]) <= 6.0);

      if (fix) {
         jQuery("img").filter(function() {
            return PATTERN_PNG.test(this.src);
         }).each(function() {
            if (!this.complete) {
               this.onload = function() {
                  fixPng(this);
               };
            } else {
               fixPng(this);
            }
         });
      }
   });
}

function fixPng(png) {
   if (png == null || png.src == "undefined") {
      return;
   }

   if (PATTERN_PNG.test(png.src)) {
      var src = png.src;

      if (!png.style.width) {
         png.style.width = jQuery(png).width();
      }
      if (!png.style.height) {
         png.style.height = jQuery(png).height();
      }

      png.src = URL_IMG_1x1_TRANSPARENT;
      png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
   }
}
