jQuery(document).ready(function() {
	
	$('A[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	Shadowbox.init();
	
	//alert("hello1");
	
	$('#fb_carousel').jcarousel({
        start: 		1,
		scroll:		1,
		easing: 	"swing",
		wrap:		"both",
		itemFirstInCallback: {
		  onBeforeAnimation: cb_Before,
		  onAfterAnimation: cb_After
		},
		initCallback: InitCarousel
    });

	$('#fbwb_carousel').jcarousel({
        auto:		2,
		buttonPrevHTML:	null,
		buttonNextHTML:	null,
		start: 		1,
		scroll:		1,
		easing: 	"swing",
		wrap: 		"both",
		itemFirstInCallback: {
		  onBeforeAnimation: cb_Before,
		  onAfterAnimation: cb_After
		},
		initCallback: InitCarousel
    });

	// $('#projekte').jcarousel({
//         auto:		5,
// 		buttonPrevHTML:	null,
// 		buttonNextHTML:	null,
// 		start: 		1,
// 		scroll:		1,
// 		easing: 	"swing",
// 		wrap: 		"both",
// 		itemFirstInCallback: {
// 		  onBeforeAnimation: cb_Before,
// 		  onAfterAnimation: cb_After
// 		},
// 		initCallback: InitCarousel
//     });
	
	//alert("hello2");
	
	$(function () {
			var tabContainers = $('div.tabs ul#projekte li.tab');
			tabContainers.hide().filter(':first').show();

			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
		});

});

function cb_Before(carousel, li, index, state) {	
	//alert("cb_Before");
}

function cb_After(carousel, li, index, state) {	
	//alert("cb_After");
}

function InitCarousel (carousel, state) {
	//alert("InitCarousel");
}
