// 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 scrollImages()
{
	$('.bodyText .scrollImages').each(function(){
		var scrollImages = this;
	    if($(this).find('.imageTable:first').width() > $(this).width()){

	        $(this).before('<div class="scroll-butts"><a href="#" class="scroll-butt-left" style="height:'+$(this).find('.imageTable:first').height()+'px;"></a><a href="#" class="scroll-butt-right" style="height:'+$(this).find('.imageTable:first').height()+'px;"></a></div>');
	        var scrollAction = $(this).prev();
	        $(this).prev().find('.scroll-butt-left').click(function(){
	            $(scrollImages).scrollTo('-='+($(scrollImages).find('img:first').width()+$(scrollImages).find('.imageSpace:first').width())+'px', 0, {duration:400});
				return false;
			});
	        $(this).prev().find('.scroll-butt-right').click(function(){
	            $(scrollImages).scrollTo('+='+($(scrollImages).find('img:first').width()+$(scrollImages).find('.imageSpace:first').width())+'px', 0, {duration:400});
				return false;
			});

			$(this).parent().mouseover(function(){
			    $(scrollAction).show();
			});
			$(this).parent().mouseout(function(){
			    $(scrollAction).hide();
			});

	    } else {
			$(scrollImages).removeClass('scrollImages');
	    }
	});
}

$(document).ready(function(){
	fixPng();
	$('.zoombox').zoombox();
});

window.onload = scrollImages;
