// Transparenz-Filter bei PNG-Bilder für IE 5.5 und IE 6 anwenden
// Aufruf bei $(document).ready() oder mit JS-Code vor </body>:
// <script type="text/javascript">
// fixPng();
// </script>
function fixPng()
{
    if($.browser.msie == true && $.browser.version > 5.5 && $.browser.version < 7.0 && document.body.filters)
    {
        $('img').each(function(){
			if(this.src.match(/\.png$/) != null){
				$(this)
					.css({
						filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+$(this).attr('src')+'\', sizingMethod=\'image\')',
						width: $(this).width()+'px',
						height: $(this).height()+'px'
					})
					.attr('src','images/t3_blank.gif');
			}
        });
	}
}

function change_header_pic()
{
	var duration = 1000;
	
	// Da in IE < 9 die halbtransparenten PNGs beim Fading einen schwarzen Rand verursacht wird,
	// muss hier das Fading ausgeschaltet werden!
	if($.browser.msie == true && $.browser.version < 9.0) duration = 0;
	
    if($('#imageblock > img').length > 1)
	{
	    var active = $('#imageblock > img:visible');
	    if(active.length == 0) active = $('#imageblock > img:first').show();
	    var next = active.next('img').length ? active.next('img') : $('#imageblock > img:eq(0)');

	    active.css({
				'position': 'absolute',
				'top': '0px',
				'left': '0px'
		}).fadeOut(duration);

	    next.css({
				'position': 'relative',
				'top': '0px',
				'left': '0px'
		}).fadeIn(duration);
	}
}

$(document).ready(function(){
	fixPng();
	$('.zoombox').zoombox();
	setInterval("change_header_pic()", 3000);
});


