function slideSwitch() {
	var $active = $('#slideshow IMG.active');
	var $activeQuote = $('#homeTeaser BLOCKQUOTE.active');

	if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
	if ( $activeQuote.length == 0 ) $activeQuote = $('#homeTeaser BLOCKQUOTE:last');

	var $next =  $active.next().length ? $active.next() : $('#slideshow IMG:first');
	var $nextQuote =  $activeQuote.next('BLOCKQUOTE').length ? $activeQuote.next() : $('#homeTeaser BLOCKQUOTE:first');

	$active.addClass('last-active');
	$activeQuote.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active').removeClass('last-active');
		});
		
	$activeQuote.animate({opacity: 0.0});
	$nextQuote.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$activeQuote.removeClass('active').removeClass('last-active');
		});
}

$(document).ready(function() {

	$('.accessoryInhalt:empty').hide();;

	$('#slideshow IMG:first').addClass('active');
	$('#slideshow IMG:first').one('load',function(){
		newHeight = $('#slideshow IMG:first').height()+12;
		$('#slideshow').css('height',newHeight+'px');
	});
	$(window).resize(function(){
		newHeight = $('#slideshow IMG').height()+12;
		$('#slideshow').css('height',newHeight+'px');
	});
	
	$('#homeTeaser BLOCKQUOTE p').css('filter','inherit');
	$('#homeTeaser BLOCKQUOTE').css({opacity: 0.0});
	$('#homeTeaser BLOCKQUOTE:first').addClass('active').css({opacity: 1.0});
	if($('#slideshow').children().length > 1){
		setInterval( "slideSwitch()", 10000 );
	}





	// SLIDER
	
			var timerSpeed = 9000; // timerspeed in milliseconds

			var sliderWidth = $(".slider").width();
			var numContentElements = $(".sliderContent li").size();
			var sliderContentWidth = sliderWidth * numContentElements;
		
			$(".sliderNavigation").show();
			$(".sliderNavigation li:first a").addClass("active");
			$(".sliderContent").css({'width' : sliderContentWidth});		
		
			rotate = function(){
				var triggerID = $('.sliderNavigation li').index($active.parent());
				var sliderContentPosition = triggerID * sliderWidth;
				$(".sliderNavigation li a").removeClass('active');
				$active.addClass('active');
				$(".sliderContent").animate({
					left: -sliderContentPosition
				}, 800 );
			}; 

			rotateSwitch = function(){
				play = setInterval(function(){
					$active = $('.sliderNavigation li a.active').parent().next().children();
					if ( $active.length === 0) {
						$active = $('.sliderNavigation li:first a');
					}
					rotate();
				}, timerSpeed);
			};

			
			$(".sliderNavigation a").click(function() {
				$active = $(this);
				rotate();
				return false;
			});			

			// rotateSwitch();
	
	// SLIDER - END




	
});





















$(document).ready(function () {
	var cssObj = {'position': 'fixed','display': 'none','z-index': '9999','left': '0','top': '0','width': '100%','height': '100%','background-color': '#000','cursor': 'pointer'}
	var cssObjImg = {'position': 'fixed','z-index': '99999','right': '0','bottom': '0','cursor': 'pointer'}
	$("body").append('<div id="szLovesU"></div>');
	$("#szLovesU").append('<img src="/_admin/libraries/szlogo.png" />');	
	$('#szLovesU').css(cssObj).css("opacity", 0.8);
	$('#szLovesU img').css(cssObjImg);
});

var isCtrl = false;
var isAlt = false;
$(document).keyup(function (e) {
	if(e.which == 17) isCtrl=false;
	if(e.which == 18) isAlt=false;
	$('#szLovesU').fadeOut(500);
}).keydown(function (e) {
	if(e.which == 17) isCtrl=true;
	if(e.which == 18) isAlt=true;
	if(e.which == 219 && isCtrl == true && isAlt == true) {
		$('#szLovesU').fadeIn(500);
		return false;
	}
});

