window.addEvent('domready', function(){
	if (Browser.Engine.trident)
	{
		$$('#navigation, #navigation div.c1, #footer, #footer div.c1').each(function(el){
			var imgLoc = el.getStyle('background-image');
			el.setStyles({
				'position': 'relative',
				'background-image': 'none'
			});
			imgLoc = imgLoc.replace('url("','');
			imgLoc = imgLoc.replace('")','');
			//alert(imgLoc);
			//imgLoc = imgLoc.replace('.png','-ie6.png');
			//alert(imgLoc);
			var imgPos = el.getStyle('background-position');
	
			var img = new Element('img', {
				'src': imgLoc
			}).setStyles({
				'position': 'absolute',
				'top': 0
			}).inject(el);
			switch(el.id)
			{
				case 'navigation':
				case 'footer':
					img.setStyle('left',0);
				break;
				default:
					img.setStyle('right',0);
				break;
			}
		});
	}
});

window.addEvent('load', function(){
/***************************************
/  PNG transparency fix for IE 6
/**************************************/
	if ((Browser.Engine.trident) && (document.body.filters))
	{
		$$('img').each(function(img){
			var imgName = img.src.toUpperCase()
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
			{
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = "display:inline-block;" + img.style.cssText 
				if (img.align == "left") imgStyle = "float:left;" + imgStyle
				if (img.align == "right") imgStyle = "float:right;" + imgStyle
				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
				img.outerHTML = strNewHTML
			}
		});
	}
});