/* 00 - PNG FIX (IE 5.5 IE 6)
/* ----------------------------------------------*/

// setup replacement gif
var blank = new Image();
blank.src = 'images/blank.gif';
	
$(document).ready(function() {
	// determine legacy IE browsers
	var legacyIE = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
	
	if (legacyIE) {
		// get all pngs on page
		$('img[src$=.png]').each(function() {
			if (!this.complete) {
				this.onload = function() { fixPng(this) };
			} else {
				fixPng(this);
			}
		});
	}
});

function fixPng(png) {
	// get src
	var src = png.src;
	// set width and height
	if (!png.style.width) { png.style.width = $(png).width(); }
	if (!png.style.height) { png.style.height = $(png).height(); }
	// when the image is replaced by the transparent gif, the event is fired again, so we prevent that here
	png.onload = function() { };
	// replace by blank image
	png.src = blank.src;
	// set filter (display original image)
	png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
}