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();
    });
};






$(document).ready(function() {
			

/*$('#menue').hoverAccordion();*/

$('#mycarousel').jcarousel({

});


$(".menue a").each(function(){
        var href = this.getAttribute('href');
        var location = new String( document.location );
		var fileN1 = location.lastIndexOf("/") + 1;
		var fileN2 = location.length;
		location = location.substring(fileN1,fileN2);
		
		if ( location == href) {
            $(this).addClass("active");
        }
    });





if ($.cookie('position')=="unten") {
	$("#text").animate({"marginTop": "180px"}, "slow");
	$("#pfeil").addClass("unten");	
	$("#pfeil").attr("src","../images/rauf.png");
	
}
if ($.cookie('position')=="oben") {
	$("#text").animate({"marginTop": "0px"}, "slow");
	$("#pfeil").addClass("oben");	
	$("#pfeil").attr("src","../images/runter.png");	
};





$("#pfeil").click(function () {
    if ($(this).hasClass("unten") ) {
	$("#text").animate({"marginTop": "0px"}, "slow");
	$(this).removeClass("unten");
	$(this).attr("src","../images/runter.png");
	$.cookie('position', 'oben');
	} 
	else {
	$("#text").animate({"marginTop": "180px"}, "slow");
	$(this).addClass("unten");	
	$(this).attr("src","../images/rauf.png");
	$.cookie('position', 'unten');
	}
});



});


