$(document).ready(function() {
	
	$('.truncate').click(function() {
		
		$('.truncate').slideToggle();
		
		return false;
		
	});
	
	$('.filterLink').click(function() {
		
		$('.filter').slideToggle();
		$('.filterLink').toggle();
		
		return false;
		
	});
	
	$( "#dialog:ui-dialog" ).dialog( "destroy" );
	
	$( "#dialog" ).dialog({
		modal: true,
		show: 'slide',
		width: '500',
		draggable: true,
		zIndex: 11000,
		resizable: false
	});
	
	$('.ProdListingHorizontal').jcarousel({
       	wrap: 'circular'
    });
	
	$('.jcarousel-skin-manufacturer').jcarousel({
       	wrap: 'circular',
       	auto: 6
    });
	
	$('.mainteaser').anythingSlider({
		autoPlay	    : true, // If autoPlay is on, this can force it to start stopped
		theme           : 'metallic',
		easing          : 'easeInOutBack',
		buildArrows		: true,
		buildNavigation : true,
		pauseOnHover	: true,
		onSlideComplete : function(slider){
			// alert('Welcome to Slide #' + slider.currentPage);
		},
		stopAtEnd : false
	});
	
	$('a.zoombox').zoombox({
        theme       : 'zoombox',        //available themes : zoombox,lightbox, prettyphoto, darkprettyphoto, simple
        opacity     : 0.8,              // Black overlay opacity
        duration    : 800,              // Animation duration
        animation   : true,             // Do we have to animate the box ?
        gallery     : true,             // Allow gallery thumb view
        autoplay : false                // Autoplay for video
    });
	
	/*
	// Bildchen wechsel Dich auf der Produktinfo Seite
	$('.productInfoAdditionalImages a').click(function() {

		oHref = $('#productInfoImages a').attr('href');
		oSrc = $('#productInfoImages img').fadeIn().attr('src');
		
		image = $(this).attr('href');
		src = $(this).children('img').attr('src');
		obj = $(this).children('img');
		
		$('#productInfoImages img').fadeOut(function() {
			
			$('#productInfoImages a').attr('href', image);
			$('#productInfoImages img').fadeIn().attr('src', src);
			//$('#wrap img').attr('href', src);
			
			obj.attr('href', oHref);
			obj.fadeIn().attr('src', oSrc);

		});

		return false;
		
	});
	*/
	
	/*
	Tabs
	*/
	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
});
