function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
 
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
 
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function slideSwitch() {
    var $active = $('div.slideshow img.active');

    if ( $active.length == 0 ) $active = $('div.slideshow img:last');

    var $next =  $active.next().length ? $active.next()
        : $('div.slideshow img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

$().ready(function() {
    $("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
	
	$("a.iframe").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	100,
		'speedOut'		:	0,
		'width'			:	600,
		'height'		:	450,
		'overlayShow'	:	true
	});
		
	$("#accordion").accordion({ autoHeight: false });

	$("a#video_1").click(function(){
		$("#standalone").load("/videos/video_1.php #uniqa > *").removeClass("hide");
		$("#main p").addClass("hide");
	})
	$("#video_2").click(function(){
		$("#standalone").load("/videos/video_2.php #donauzentrum > *").removeClass("hide");
		$("#main p").addClass("hide");

	})
	$("#video_3").click(function(){
		$("#standalone").load("/videos/video_3.php #rompetrol > *").removeClass("hide");
		$("#main p").addClass("hide");

	})
	
});
