
//benötigt jquery und jquery.timers
//keine Einstellungen benötigt

//
// benötigt jquery und jquery.timers
// IE PNG fix für bilder, visibility wird im script wieder hergestellt. 
//
var IEimages = 0, blankImg = 'bilder/leer.gif', zeigeBilderTimeout = false;

if ($.browser.msie && /MSIE (5\.5|6)/.test(navigator.userAgent)) {
	document.write(
		'<style type="text/css">' + 
		'* html img {visibility:hidden;}  ' + 
		'* html .nopngfix img {visibility:visible;}  ' + 
		'* html img.nopngfix {visibility:visible;}  ' + 
		'</style>'
	);
}

$(document).ready(function(){
	if ($.browser.msie) {
		var imgtemp;
		$("img").each(function(i){
			imgtemp = this.src;
			if (imgtemp.slice(imgtemp.length - 4) == ".png" && $(this).css("visibility") == "hidden" && !$(this).hasClass("nopngfix")) {
				this.src = "";
				$(this).load(function(){
				var elm = this, src = this.src, t = 2;
					if ((src && src.slice(src.length - blankImg.length) == blankImg) || !/MSIE (5\.5|6)/.test(navigator.userAgent) || typeof elm.filters == 'unknown') return;
					src = (src || '').replace(/\(/g, '%28').replace(/\)/g, '%29');
					
					elm.style.width = elm.offsetWidth + 'px';
					elm.style.height = elm.clientHeight + 'px';
					elm.src = blankImg;
					$(elm).load();
					var newelm = $(elm).clone(true);
					$(elm).replaceWith(newelm);
					$(newelm).attr('oldsrc', src);

					IEimages++;
					if (!zeigeBilderTimeout) {
						window.setTimeout("zeigeBilderIE()", 10);
					}
					zeigeBilderTimeout = true;
				});
				this.src = imgtemp;
			} else {
				if (!$(this).hasClass("nopngfix")) {
					$(this).css('visibility','visible');
				}
			}
		});
	}
});

function zeigeBilderIE() {
	$("img").each(function(i){
		if ($(this).attr('oldsrc') && $(this).src != $(this).attr('oldsrc') && $(this).attr('oldsrc').slice(0,4) == "http") {
			var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
			this.style.visibility = 'visible';
			this.style.filter = 'progid:' + f + '(src="' + this.oldsrc +	'",sizingMethod="scale")';
			$(this).removeAttr('oldsrc');
			IEimages--;
		}
	});
	if (IEimages > 0) window.setTimeout("zeigeBilderIE()",100);
	else zeigeBilderTimeout = false;
}



