$(function(){
	verificaPNGs();
	$("a[rel='lightbox']").colorbox({transition:"fade"});
});

var blank = new Image();
blank.src = '/pt/imgs/pix.gif';
var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");

function verificaPNGs() {
	// Verifica se é IE 5.5 ou 6 e substitui as PNGs
	if (badBrowser) $('img[src$=.png]').each(function() {
		if (!this.complete) this.onload = function() { fixPng(this) };
		else fixPng(this);
	});
}

// Substitui a imagem png por uma imagem transparente (IE antigo)
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(); }
	// replace by blank image
	png.onload = function() { };
	png.src = blank.src;
	// set filter (display original image)
	png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
}
