//GLOBALES
var existingElements = 0;

var slideTime = 750;
var loopTime = 4000;

var counterBuehneHome = 1;
var tempID = 666;
var stageElements = 0;

var circleStop = 0;
var clickedID = 666;

var counterBuehneFiliale = 1;
var tempFilialID = 666;
var filialElements = 0;

var tempID = 0;
var teaserID = 0;

//ÜBERBLENDE COVERFLOW GROSS
var transTime = 200;

$(document).ready(function() {	

	//Detergentia
	$("#detergentiaBtn").click(function(){
		var detergentiaValue = $('#detergentiaValue').val();
		$(".detergentiaFault1, .detergentiaFault2, .detergentiaFault3").hide();
		
		if(isNaN(detergentiaValue)){ 
			$(".detergentiaNE, .detergentiaPE").hide();
			$(".detergentiaFault1").show();
			return false;
		}
		
		if(detergentiaValue.length != 13){ 
			$(".detergentiaNE, .detergentiaPE").hide();
			$(".detergentiaFault2").show();
			return false;
		}
	});
	//EOF Detergentia
	
	//Filialsuche
	var filialsearchValue1 = $('.store-search input.mainHeaderSearchField').val();
	$(".store-search input.mainHeaderSearchButton").click(function(){
		var filialsearchValue2 = $('.store-search input.mainHeaderSearchField').val();
		
		if(filialsearchValue1 == filialsearchValue2){
			$(".store-search input.mainHeaderSearchField").attr("style","color:red;font-weight:bold;");
			return false;
		}
		
	});
	$(".store-search input.mainHeaderSearchField").focus(function() {
		$(this).attr("style","");
	});
	//EOF Filialsuche

	var activeID = 666;
	var prevID = 666;
	
	//GUTSCHEINE BESTELLEN
	$('input.submitbtn').hover(
	  function () {
	    $(this).css('background-position', 'right 0px').css('color','#E95D0E');
	  },
	  function () {
	    $(this).css('background-position', 'right -29px').css('color','#888888');
	  }
	);
	
	$('.bonusesWrap input.submitbtngrey').hover(
	  function () {
	    $(this).css('background-position', 'right 0px').css('color','#E95D0E');
	  },
	  function () {
	    $(this).css('background-position', 'right -16px').css('color','#888888');
	  }
	);	
	
	//Linie auf Startseite
	productHomeCounter = $('.productsFloatStart').length;
	
	$('.productsFloatStart').each(function(i){
		if(i % 2 != 0 && i != productHomeCounter - 1){
			//alert(productHomeCounter % 2+"a");
			$(this).after('<div class="homeLine"></div>');	
		}	
	}); 
	
	//LINK AUF BILDER IN MEHR INFO BOX
	$('.boxMoreInfo_GlobalFrame .boxMoreInfo_Link a').each(function(){
		boxMoreLink = $(this).attr('href');
		boxMoreTarget = $(this).attr('target');
		boxMoreRel = $(this).attr('rel');
		boxMoreClass = $(this).attr('class');
		if($(this).attr('href')){
			$(this).closest('.boxMoreInfo_GlobalFrame').find('a.boxMorePictureLink').attr('href', boxMoreLink).attr('target', boxMoreTarget).attr('rel', boxMoreRel).attr('class', boxMoreClass);
		}else{
			
		}
	});
	
	$('.boxMoreInfoContent_GlobalFrame .boxMoreInfoContent_Link a').each(function(){
		boxMoreLink = $(this).attr('href');
		boxMoreTarget = $(this).attr('target');
		boxMoreRel = $(this).attr('rel');
		boxMoreClass = $(this).attr('class');
		$(this).closest('.boxMoreInfoContent_GlobalFrame').find('a.boxMorePictureLink').attr('href', boxMoreLink).attr('target', boxMoreTarget).attr('rel', boxMoreRel).attr('class', boxMoreClass);
	});
	
	//TT_NEWS
	$('.news-latest-item').last().css('border-bottom','none');

	//ROLLOVER FÜR INDEXED SEARCH FELD UND FILIALSUCHER IM TEASER
	$('.mainHeaderSearchButton').hover(
	  function () {
	    $(this).css('background-position', '0px -20px');
	  },
	  function () {
	    $(this).css('background-position', '0px 0px');
	  }
	);
	
	//LINK ERGÄNZUNG
	/*
	$('a.button-more').before('<span class="button-more-start"></span>');
	$('a.button-extern').before('<span class="button-more-start"></span>');
	$('a.button-download').before('<span class="button-more-start"></span>');
	$('.prospectuslink a ').before('<span class="button-more-start"></span>');
	$('.pdflink a ').before('<span class="button-more-start"></span>');
	$('input.submitbtn').before('<span class="button-more-start"></span>');
	*/
	
	$('#content p.bodytext').each(function(){
		$(this).find('a.button-download').last().after('<br/><br/>');
	})
	
	//TT_NEWS LISTE
	var n = $('.scwSpecialAmenu a').length;
	var scwAMenu = "";
	var scwSelect = "";
	$('.scwSpecialAmenu a').each(function(i){
	
		text = $(this).html();
		
		if($(this).children().hasClass('selected')){
			scwSelect = 'selected="selected"';
		}else{
			scwSelect = '';
		};
		
		link = "/"+$(this).attr('href');
		$(this).remove('a');
		
		var d = new Date();
		
		if(text == d.getFullYear()){
			link = "/index.php?id=112";
		};
		
		if(i==0){
			scwAMenu = scwAMenu + '<form method="POST"><select name="linkliste" size="1" onchange="surfto(this.form)"><option value="/index.php?id=112">'+d.getFullYear()+'</option><option value="'+link+'" '+scwSelect+'>'+text+'</option>';
		}else if(i==n-1){
			scwAMenu = scwAMenu + '<option value="'+link+'" '+scwSelect+'>'+text+'</option></select></form>';
		}else{
			scwAMenu = scwAMenu + '<option value="'+link+'" '+scwSelect+'>'+text+'</option>';
		}
		
	});
	$('.scwSpecialAmenu').append(scwAMenu);
	
	
	$('.news-list-item').last().css('border-bottom', '1px solid #dddddd');
	
	$('.news-list-item-CONTENT').hide();
	$('.news-list-item-CONTENT').first().show().addClass('activeToggle');
	$('.news-list-item-HEAD .accTeaser_Arrow').first().removeClass('accTeaser_Arrow').addClass('accTeaser_Active');
	
	$('.accTeaser_Frame').each(function(i) {
	    $(this).attr('id', 'accFrame'+i);
	});
	$('.news-list-item-HEAD').hover(
	  function () {
	    $(this).children('.accTeaser_Arrow').css('background-position', '-17px 0px');
	    $(this).children('.accTeaser_Active').css('background-position', '0px 0px');
	    $(this).css('color','#E95D0E');
	  },
	  function () {
	    $(this).children('.accTeaser_Arrow').css('background-position', '-17px -17px');
	    $(this).children('.accTeaser_Active').css('background-position', '0px -17px');
	    $(this).removeAttr('style');
	  }
	);	
	$('.news-list-item-HEAD').click(function() {
		var curToggleFrame1 = $(this).closest('.accTeaser_Frame').attr('id');
		if($(this).next('.news-list-item-CONTENT').hasClass('activeToggle')){
			$(this).next('.activeToggle').slideUp('fast');
			$(this).next('.news-list-item-CONTENT').removeClass('activeToggle');
			$(this).removeClass('activeHeader');
			$(this).children('.accTeaser_Active').addClass('accTeaser_Arrow').removeClass('accTeaser_Active');
		}else{
			$('.activeToggle').each(function() {
				var curToggleFrame2 = $(this).closest('.accTeaser_Frame').attr('id');
			    if(curToggleFrame2 == curToggleFrame1){
			    	$(this).slideUp('fast');
			    	$(this).removeClass('activeToggle');
			    	$(this).closest('.news-list-item').find('.activeHeader').removeClass('activeHeader');
			    	$(this).closest('.news-list-item').find('.accTeaser_Active').addClass('accTeaser_Arrow').removeClass('accTeaser_Active');
			    	$(this).closest('.news-list-item').find('.accTeaser_Arrow').css('background-position', '-17px -17px');
			    }
			});
			$(this).addClass('activeHeader');
			$(this).next('.news-list-item-CONTENT').slideToggle('fast').addClass('activeToggle');
			$(this).children('.accTeaser_Arrow').addClass('accTeaser_Active').removeClass('accTeaser_Arrow');
		}
	});
	
	//BÜHNE AUF DER STARTSEITE
	
	$('.buehneHome_Content').each(function(i) {
	    $(this).attr('id', 'buehneHome_Content'+i).css('z-index',i);
	    stageElements = i;
	});
	$('#buehneHome_Content0').css("z-index","25").show();
	var positionLeft = 0;
	var countButtons = 0;
	var originalWidth = 0;
	var bgWidth = 0;
	
	$('.buehneHome_Button').each(function(i) {
	    $(this).attr('id', 'buehneHome_Button'+i);
	    originalWidth = originalWidth + $(this).outerWidth();
	    countButtons = i;  	    
	});
	
	positionLeft = (858-originalWidth)/2 - 5;
	
	$('.scwBuehneNewPrev').css("left", positionLeft+7);
	$('.scwBuehneNewNext').css("right", positionLeft+7);
	
	$('.scwBuehneNewNext').hover(
	  function () {
	    $(this).css('background-position', '-29px 0px');
	  },
	  function () {
	    $(this).css('background-position', '0px 0px');
	  }
	);
	
	$('.scwBuehneNewPrev').hover(
	  function () {
	    $(this).css('background-position', '-29px -29px');
	  },
	  function () {
	    $(this).css('background-position', '0 -29px');
	  }
	);
	
	$('.scwWhiteBackground').css('left', positionLeft);
	
	$('.buehneHome_Button').each(function(i) {
			if(i == 0){
				$(this).css("padding-left", 45);
			}else if(i == countButtons){
				$(this).css("padding-right", 45);
			}
		    $('#buehneHome_Button'+i).css('left', positionLeft);
		    if(i==0 || i==countButtons){
		    	positionLeft = positionLeft + $(this).width() + 45;
		    	bgWidth = bgWidth + $(this).width() + 45;
		    }else{
		    	positionLeft = positionLeft + $(this).width();
		    	bgWidth = bgWidth + $(this).width();
		    }
		});
	
	$('.scwWhiteBackground').css('width', bgWidth);
	$('#buehneHome_Button0').addClass('activeCircle');
	
	$('.buehneHome_Button').each(function(i) {
		$(this).bind('click', function (){
			clearInterval(stageLoop);
			var triggerBuehne = "button";
			circleStop = 1;
			clickedID = i;
			$('.activeCircle').removeClass('activeCircle');
			teaserID = gotoStage(i,triggerBuehne);
		});
		$(this).bind('mouseenter', function (){
			buttonColorAdd(i);
		});
		$(this).bind('mouseleave', function (){
			buttonColorRemove(i);
		});
	});
	
	$('.scwBuehneNewPrev').click(function(){
		clearInterval(stageLoop);
		var triggerBuehne = "newprev";
		//gotoStage(teaserID,triggerBuehne);
		clickedID = 9999;
		teaserID = gotoStage(teaserID,triggerBuehne);
		
	});
	
	$('.scwBuehneNewNext').click(function(){
		clearInterval(stageLoop);
		var triggerBuehne = "newnext";
		//gotoStage(teaserID,triggerBuehne);
		clickedID = 9999;
		teaserID = gotoStage(teaserID,triggerBuehne);
		
	});
	
	//FCE TEASER ACCORDION
	$('.accTeaser_Content').hide();
	$('.accTeaser_Frame').each(function(i) {
	    $(this).attr('id', 'accFrame'+i);
	    $(this).find('.accTeaser_Content').first().show().addClass('activeToggle');
	    $(this).find('.accTeaser_ElementHead .accTeaser_Arrow').first().removeClass('accTeaser_Arrow').addClass('accTeaser_Active');
	    $(this).find('.accTeaser_ElementHead').first().addClass('activeHeader');
	});
	
	$('.accTeaser_ElementHead').hover(
	  function () {
	    $(this).children('.accTeaser_Arrow').css('background-position', '-17px 0px');
	    $(this).children('.accTeaser_Active').css('background-position', '0px 0px');
	    $(this).children('.accTeaser_Headline').css('color','#E95D0E');
	  },
	  function () {
	    $(this).children('.accTeaser_Arrow').css('background-position', '-17px -17px');
	    $(this).children('.accTeaser_Active').css('background-position', '0px -17px');
	    $(this).children('.accTeaser_Headline').removeAttr('style');
	  }
	);	
	$('.accTeaser_ElementHead').click(function() {
		var curToggleFrame1 = $(this).closest('.accTeaser_Frame').attr('id');
		if($(this).next('.accTeaser_Content').hasClass('activeToggle')){
			$(this).next('.activeToggle').slideUp('fast');
			$(this).next('.accTeaser_Content').removeClass('activeToggle');
			$(this).removeClass('activeHeader');
			$(this).children('.accTeaser_Active').addClass('accTeaser_Arrow').removeClass('accTeaser_Active');
		}else{
			$('.activeToggle').each(function() {
				var curToggleFrame2 = $(this).closest('.accTeaser_Frame').attr('id');
			    if(curToggleFrame2 == curToggleFrame1){
			    	$(this).slideUp('fast');
			    	$(this).removeClass('activeToggle');
			    	$(this).closest('.accTeaser_SingleFrame').find('.activeHeader').removeClass('activeHeader');
			    	$(this).closest('.accTeaser_SingleFrame').find('.accTeaser_Active').addClass('accTeaser_Arrow').removeClass('accTeaser_Active');
			    	$(this).closest('.accTeaser_SingleFrame').find('.accTeaser_Arrow').css('background-position', '-17px -17px');
			    }
			});
			$(this).addClass('activeHeader');
			$(this).next('.accTeaser_Content').slideToggle('fast').addClass('activeToggle');
			$(this).children('.accTeaser_Arrow').addClass('accTeaser_Active').removeClass('accTeaser_Arrow');
		}
	});
	
	//GROSSER COVERFLOW START ONLOAD
	
	if ( $('.scwFlowPopUp').length ) {
		var positionPopUp = $(".scwCoverFlow");
		var position = positionPopUp.position();
		$('.scwFlowPopUp').css('top',position.top+20);
	}
	
	$('.scwCoverFlowPrev').hover(
	  function () {
	    $(this).css('background-position', '0px 0px');
	  },
	  function () {
	    $(this).css('background-position', '0px -36px');
	  }
	);
	
	$('.scwCoverFlowNext').hover(
	  function () {
	    $(this).css('background-position', '0px 0px');
	  },
	  function () {
	    $(this).css('background-position', '0px -36px');
	  }
	);
	
	$('.scwFlowPopClose').hover(
	  function () {
	    $(this).css('background-position', '0px -31px');
	  },
	  function () {
	    $(this).css('background-position', '0px 0px');
	  }
	);
	
	$('.scwFlowInfolinks, .scwFlowInfolinksListing').hover(
	  function () {
	    $(this).css('background-position', '0px -19px');
	  },
	  function () {
	    $(this).css('background-position', '0px 0px');
	  }
	);
	
	$('.scwFlowElement').each(function(i){
		$(this).attr('id', 'scwFlowElement'+i);
		existingElements = i;
	});
	
	$('.scwFlowText').each(function(i){
		$(this).attr('id', 'scwFlowText'+i).hide();
	});
	
	middleElement = Math.floor(existingElements/2);		
	CoverMovementInitial(middleElement);

	$('.scwFlowPopUp').each(function(i){
		$(this).attr('id', 'scwFlowPopUp'+i).hide();	
	});
	
	$('.scwFlowPopClose').click(function(){
		$('.scwFlowPopUp').fadeOut();	
	});
	
	var selectExists = 'no';
	var infoExists = 'no';
	
	$('.scwFlowElement').each(function(i){
		$(this).bind('click', function() {
		
		
			activeID = 666;
			$('.info').hide();
			$('.scwFlowInfolinks').hide();
			
			if($(this).hasClass('pos4')){
				$('#scwFlowPopUp'+i).fadeIn();
				
				selectExists = 'no';
				infoExists = 'no';
				
				$('#scwFlowPopUp'+i).find('select.scwPopSelect').each(function(){
					selectExists = 'yes';
				});
				

				
				if(selectExists == 'no'){
					$('.flowBigHint').hide();
					$('.pdflink').show();
					$('.descr-long').show();
					$('.infolink').show();
					$('.prospectuslink').show();
					$('.scwFlowInfolinks').show();						
				}else if(selectExists == 'yes'){
					$('select.scwPopSelect').children('.firstOption').attr("selected", true)
					$('.flowBigHint').show();
					$('.pdflink').hide();
					$('.descr-long').hide();
					$('.infolink').hide();
					$('.prospectuslink').hide();
					$('.info').hide();	
				};
				
			}else if($(this).hasClass('pos0')){
				for (var j = 0; j <= 3; j++){
					middleElement--;
					CoverMovementClick(middleElement);
				}
			}else if($(this).hasClass('pos1')){
				for (var j = 0; j <= 2; j++){
					middleElement--;
					CoverMovementClick(middleElement);
				}
			}else if($(this).hasClass('pos2')){
				for (var j = 0; j <= 1; j++){
					middleElement--;
					CoverMovementClick(middleElement);
				}
			}else if($(this).hasClass('pos3')){
				for (var j = 0; j <= 0; j++){
					middleElement--;
					CoverMovementClick(middleElement);
				}
			}else if($(this).hasClass('pos5')){
				for (var j = 0; j <= 0; j++){
					middleElement++;
					CoverMovementClick(middleElement);
				}
			}else if($(this).hasClass('pos6')){
				for (var j = 0; j <= 1; j++){
					middleElement++;
					CoverMovementClick(middleElement);
				}
			}else if($(this).hasClass('pos7')){
				for (var j = 0; j <= 2; j++){
					middleElement++;
					CoverMovementClick(middleElement);
				}
			}else if($(this).hasClass('pos8')){
				for (var j = 0; j <= 3; j++){
					middleElement++;
					CoverMovementClick(middleElement);
				}
			}
			if(middleElement == existingElements){
				$('.scwCoverFlowPrev').hide();
				$('.scwCoverFlowNext').show();
			}
			if(middleElement == 0){
				$('.scwCoverFlowPrev').show();
				$('.scwCoverFlowNext').hide();
			}
			if(middleElement != 0 && middleElement != existingElements){
				$('.scwCoverFlowPrev').show();
				$('.scwCoverFlowNext').show();
			}
		});
	});
	
	$('.scwCoverFlowPrev').click(function() {
	
		$('.info').hide();
		$('.scwFlowInfolinks').hide();
		
		activeID = 666;
		if(middleElement < existingElements){
			$('.scwCoverFlowNext').show();
			middleElement++;
	  		CoverMovementClick(middleElement);
	  		if(middleElement == existingElements){
	  			$('.scwCoverFlowPrev').hide();
	  			$('.scwCoverFlowNext').show();
	  		}
	  	}
	  	
	});
	$('.scwCoverFlowNext').click(function() {
	
		$('.info').hide();
		$('.scwFlowInfolinks').hide();
		
		activeID = 666;
		if(middleElement > 0){
			$('.scwCoverFlowPrev').show();
			middleElement--;
	    	CoverMovementClick(middleElement);
	    	if(middleElement == 0){
	    		$('.scwCoverFlowPrev').show();
	    		$('.scwCoverFlowNext').hide();
	    	}
	    }
	    
	});
	
	$('.scwPopSelect').change(function() {
		activeID = $(this).val();
		
		$('.flowBigHint').hide();
		
		$('.pdflink').hide();
		$('.descr-long').hide();
		$('.infolink').hide();
		$('.prospectuslink').hide();
		$('.info').hide();
		
		$('.scwFlowInfolinks').show();
		$('#pdflink-'+activeID).show();
		$('#descr-long-'+activeID).show();
		$('#infolink-'+activeID).show();
		$('#prospectuslink-'+activeID).show();
	});
	
	$('.scwFlowInfolinks').click(function() {
		if(activeID != 666){
			$('#info-'+activeID).slideToggle();
		}else{
			$('.info').slideToggle();
		}
	});
	
	//SMALL COVERFLOW
	$('.scwCoverFlowSmall_Slider').css('width', $('.scwCoverFlowSmall_Slider .scwFlowElementSmall').length * 88);
	
	$('.scwCoverFlowSmallPrev').hover(
	  function () {
	    $(this).css('background-position', '0px 0px');
	  },
	  function () {
	    $(this).css('background-position', '0px -20px');
	  }
	);
	
	$('.scwCoverFlowSmallNext').hover(
	  function () {
	    $(this).css('background-position', '0px 0px');
	  },
	  function () {
	    $(this).css('background-position', '0px -20px');
	  }
	);
	
	if ( $('.scwFlowPopUpSmall').length ) {
		var positionPopUp = $(".scwCoverFlowSmall");
		var position = positionPopUp.position();
		$('.scwFlowPopUpSmall').css('top',position.top+20);
	}
	
	var positionLeft = 0;
	
	$('.scwFlowElementSmall').each(function(i){
		$(this).attr('id', 'scwFlowElementSmall'+i);
		existingElements = i;
		if($(this).hasClass('scwFlowElementActive')){
			positionLeft = -1 * i * 88;
			$('.scwCoverFlowSmall_Slider').css('left',positionLeft);
			if(positionLeft == 0){
				$('.scwCoverFlowSmallPrev').hide();	
			}; 
		}
	});
	
	$('.scwFlowTextSmall').each(function(i){
		$(this).attr('id', 'scwFlowTextSmall'+i);
	});
	$('.scwFlowElementActive').show();
	
	$('.scwFlowPopUpSmall').each(function(i){
		$(this).attr('id', 'scwFlowPopUpSmall'+i);
	});
	
	$('.scwFlowPopClose').click(function(){
		$('.scwFlowPopUpSmall').fadeOut();	
	});
	
	$('.scwFlowElementSmall').each(function(i){
		$(this).bind('click', function() {		
			activeID = 666;
			$('.info').hide();
			$('.scwFlowInfolinks').hide();
			$('#scwFlowPopUpSmall'+i).fadeIn();
			
			selectExists = 'no';
			infoExists = 'no';
			
			$('#scwFlowPopUpSmall'+i).find('select.scwPopSelect').each(function(){
				selectExists = 'yes';
			});
			
			$('#scwFlowPopUpSmall'+i).find('select.scwPopSelect').each(function(){
				selectExists = 'yes';
			});
			
			if(selectExists == 'no'){
				$('.flowBigHint').hide();
				$('.pdflink').show();
				$('.descr-long').show();
				$('.infolink').show();
				$('.prospectuslink').show();
				$('.scwFlowInfolinks').show();	
			}else if(selectExists == 'yes'){
				$('select.scwPopSelect').children('.firstOption').attr("selected", true)
				$('.flowBigHint').show();
				$('.pdflink').hide();
				$('.descr-long').hide();
				$('.infolink').hide();
				$('.prospectuslink').hide();
				$('.info').hide();	
			};
		});
	});
	
	$('.scwCoverFlowSmallPrev').click(function(){
	
		$('.scwFlowElementActive').removeClass('scwFlowElementActive').addClass('ActiveTemp');
		$('.ActiveTemp').prev().addClass('scwFlowElementActive');
		$('.ActiveTemp').removeClass('ActiveTemp');

		positionLeft = positionLeft + 88;		
		$('.scwCoverFlowSmall_Slider').animate({
			left: positionLeft
		},transTime);
		if(positionLeft == 0){
			$('.scwCoverFlowSmallPrev').hide();	
		}else{
			$('.scwCoverFlowSmallPrev').show();
			$('.scwCoverFlowSmallNext').show();
		}; 
	});
	
	$('.scwCoverFlowSmallNext').click(function(){
	
		$('.scwFlowElementActive').removeClass('scwFlowElementActive').addClass('ActiveTemp');
		$('.ActiveTemp').next().addClass('scwFlowElementActive');
		$('.ActiveTemp').removeClass('ActiveTemp');
	
		positionLeft = positionLeft - 88;
		$('.scwCoverFlowSmall_Slider').animate({
			left: positionLeft
		},transTime);	
		if(positionLeft == $('.scwCoverFlowSmall_Slider .scwFlowElementSmall').length * -88 + 88){
			$('.scwCoverFlowSmallNext').hide();	
		}else{
			$('.scwCoverFlowSmallPrev').show();
		}; 
	});
	
	//PROSPEKT LISTE
	$('.scwProspectusContentWrap').each(function(){

			if($(this).find('.scwFlowSelect').length){
				$(this).find('.firstOption').attr("selected", true)
				$(this).find('.flowBigHint').show();
				$(this).find('.pdflink').hide();
				$(this).find('.descr-long').hide();
				$(this).find('.infolink').hide();
				
				$(this).find('.scwFlowInfolinksListing').hide();
				
				$(this).find('.prospectuslink').hide();
				$(this).find('.info').hide();
			}else{
				$(this).find('.flowBigHint').hide();
				$(this).find('.scwFlowInfolinksListing').show();
			}
			
	});

	$('.scwPopSelectList').change(function() {
		$('option.firstOption').remove('option.firstOption');
		$(this).closest('.scwProspectusContentWrap').find('.scwFlowInfolinksListing').show();
		activeID = $(this).val();
		$('.flowBigHint').hide();
		$('#prospectuslink-'+prevID).hide();
		$('#descr-long-'+prevID).hide();
		$('#pdflink-'+prevID).hide();
		$('#descr-long-'+prevID).hide();
		$('#infolink-'+prevID).hide();
		$('#prospectuslink-'+prevID).hide();
		$('#info-'+prevID).hide();
		$('#prospectuslink-'+activeID).show();
		$('#pdflink-'+activeID).show();
		$('#descr-long-'+activeID).show();
		$('#infolink-'+activeID).show();
		$('#prospectuslink-'+activeID).show();
		$('#descr-long-'+activeID).show();
		$('#info-'+prevID).hide();
		prevID = activeID;
	});
	
	$('.scwFlowInfolinksListing').click(function() {
	
		var aliensExist = $(this).closest('.scwProspectusContentWrap').find('.scwFlowSelect').length;

		if(activeID != 666 && aliensExist == 1){
			$(this).closest('.scwProspectusContentWrap').find('#info-'+activeID).slideToggle();
		}else{
			$(this).closest('.scwProspectusContentWrap').find('.info').slideToggle();
		}
	
	});
	
	//JOB LISTE	
	$('.job-list-item .headline').hover(
	  function () {
	    $(this).children('.accTeaser_Arrow').css('background-position', '-17px 0px');
	    $(this).children('.accTeaser_Active').css('background-position', '0px 0px');
	    $(this).children('.jobs-headline-position').css('color','#E95D0E');
	  },
	  function () {
	    $(this).children('.accTeaser_Arrow').css('background-position', '-17px -17px');
	    $(this).children('.accTeaser_Active').css('background-position', '0px -17px');
	    $(this).children('.jobs-headline-position').removeAttr('style');
	  }
	);	
	$('.job-list-item .headline').click(function() {
		var curToggleFrame1 = $(this).closest('.accTeaser_Frame').attr('id');
		if($(this).next('.job-list-item .details').hasClass('activeToggle')){
			$(this).next('.activeToggle').slideUp('fast');
			$(this).next('.job-list-item .details').removeClass('activeToggle');
			$(this).removeClass('activeHeader');
			$(this).children('.accTeaser_Active').addClass('accTeaser_Arrow').removeClass('accTeaser_Active');
		}else{
			$('.activeToggle').each(function() {
				var curToggleFrame2 = $(this).closest('.accTeaser_Frame').attr('id');
			    if(curToggleFrame2 == curToggleFrame1){
			    	$(this).slideUp('fast');
			    	$(this).removeClass('activeToggle');
			    	$(this).closest('.job-list-item').find('.activeHeader').removeClass('activeHeader');
			    	$(this).closest('.job-list-item').find('.accTeaser_Active').addClass('accTeaser_Arrow').removeClass('accTeaser_Active');
			    	$(this).closest('.job-list-item').find('.accTeaser_Arrow').css('background-position', '-17px -17px');
			    }
			});
			$(this).addClass('activeHeader');
			$(this).next('.job-list-item .details').slideToggle('fast').addClass('activeToggle');
			$(this).children('.accTeaser_Arrow').addClass('accTeaser_Active').removeClass('accTeaser_Arrow');
		}
	});
	//CHARTS
		$.get('/fileadmin/mount/de/charts/album.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.album').html(dataOutput);
		});
	
		$.get('/fileadmin/mount/de/charts/maxi.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.maxi').html(dataOutput);
		});
		
		$.get('/fileadmin/mount/de/charts/sampler.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.sampler').html(dataOutput);
		});
			
		$.get('/fileadmin/mount/de/charts/blueray.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.blueray').html(dataOutput);
		});
				
		$.get('/fileadmin/mount/de/charts/dvd.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.dvd').html(dataOutput);
		});
					
		$.get('/fileadmin/mount/de/charts/nintendo.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.nintendo').html(dataOutput);
		});
						
		$.get('/fileadmin/mount/de/charts/pc.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.pc').html(dataOutput);
		});
							
		$.get('/fileadmin/mount/de/charts/playstation.csv', function(data) {
			var dataLines = data.split("\n");
			var dataOutput ='';
			for(var i = 0; i < dataLines.length; i++){
				dataLines[i] = dataLines[i].split(",");
				var ranking = i+1;
				var lastRow = dataLines.length - 1; 
				
				for(var j = 0; j < dataLines[i].length; j++) {
					if(j==0 && i != lastRow){
						dataLines[i][j] = "<div class='chartsRow'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else if(j==0 && i == lastRow){
						dataLines[i][j] = "<div class='chartsRowLast'><div class='chartsLabel'><span class='chartsNumber'>"+ranking+"</span></div><span class='chartsText'><b>"+dataLines[i][j].split("\"")[1]+"</b>&nbsp;";
					}else{
						dataLines[i][j] = dataLines[i][j].split("\"")[1];
					}
				}
			}
			for(var i = 0; i < dataLines.length; i++){
				for(var j = 0; j < dataLines[i].length; j++) {
					dataOutput += dataLines[i][j];
				}
				dataOutput += "</span></div>";
			}
			$('.playstation').html(dataOutput);
		});
		
		//SLIDESHOW FILIALE
		$('.buehneFilialwelt_SingleFrame').each(function(i) {
		    $(this).attr('id', 'buehneFilialwelt_SingleFrame'+i).hide();
		    filialElements = i;
		});
		$('#buehneFilialwelt_SingleFrame0').show();
		$('.buehneFilialwelt_Prev').click(function() {
			clearInterval(filialLoop);
			var triggerBuehne = "PrevButton";
			var i = "x";
			gotoFilialStage(i,triggerBuehne);
		});
		
		$('.buehneFilialwelt_Next').click(function() {
			clearInterval(filialLoop);
			var triggerBuehne = "NextButton";
			var i = "x";
			gotoFilialStage(i,triggerBuehne);
		});
		
		
		
		$('.buehneFilialwelt_Next').hover(function() {
			$('.buehneFilialwelt_NextButton').css('background-position','-29px 0');
		},function() {
			$('.buehneFilialwelt_NextButton').css('background-position','0 0');
		});
		
		
		
		$('.buehneFilialwelt_Prev').hover(function() {
			$('.buehneFilialwelt_PrevButton').css('background-position','-29px -29px');
		},function() {
			$('.buehneFilialwelt_PrevButton').css('background-position','0 -29px');
		});
		//PRODUKTLISTE
		
		$('.productListInfoButton').mouseenter(function(){
		
			$(this).css('background-position', '0px -19px');
		
			$('.productInfo').hide();
			
			
			var tempID = $(this).attr('id');
			
			$('#productInfo_'+tempID).addClass('productInfoActive');
	
			$('.productInfo .productsImageContainer').remove();
			$('.productInfo .productsDescriptionContainer').remove();
			
			var tempContent = $(this).closest('.productsFloat').html();
			$(tempContent).insertBefore('#productInfo_'+tempID+' .addInformations');
				
			var positionPopUp = $('#position'+tempID);
			var position = positionPopUp.position();
			
			if($.browser.msie && $.browser.version=="7.0"){
				$('#productInfo_'+tempID).css('top',position.top-2);
				$('#productInfo_'+tempID).css('left',position.left-12);
			}else{
				$('#productInfo_'+tempID).css('top',position.top-12);
				$('#productInfo_'+tempID).css('left',position.left-12);
			}
	
			$('#productInfo_'+tempID).show();
			
		});
		
		$('.productInfo').mouseleave(function(){
			$('.productInfo').hide();
			$('.productListInfoButton').css('background-position', '0px 0px');
		});
		
		if(!$('.prev_link').html() && !$('.next_link').html()){
			$('.productsPager').remove();
		}
		
});

// SLIDESHOW FILIALE
filialLoop = setInterval ( "filialCircle()", loopTime );
function filialCircle() {
	gotoFilialStage(counterBuehneFiliale);
	counterBuehneFiliale++;	
	if(counterBuehneFiliale == filialElements+1){counterBuehneFiliale = 0};
}
function gotoFilialStage(ID,triggerSource) {
	if(triggerSource == "NextButton"){
		ID = tempFilialID;
		ID++;
		if(ID > filialElements){
			ID = 0; 
			previusStage = filialElements
		}else{
			previusStage = tempFilialID;
		}
	}else if(triggerSource == "PrevButton"){
		ID = tempFilialID;
		ID--;
		if(ID == -1){
			ID = filialElements; 
			previusStage = 0;
		}else{
			previusStage = tempFilialID;
		}
	}else{
		previusStage = ID - 1;
		if(previusStage == -1){previusStage = filialElements};
	}
	if(previusStage != ID){
		$('#buehneFilialwelt_SingleFrame'+previusStage).fadeOut(slideTime);
		$('#buehneFilialwelt_SingleFrame'+ID).fadeIn(slideTime);
	}
	
	tempFilialID = ID;
}


// GROSSER COVERFLOW FUNCTIONS
function CoverMovementInitial(middleElement){
	$('#scwFlowElement'+middleElement).addClass('pos4');
	$('#scwFlowText'+middleElement).show();
	
	counterPrev = middleElement-1;
	counterNext = middleElement+1;
	counterPrevIndex = 3;
	counterNextIndex = 5;

	while (counterPrev > -1) {
	  if(counterPrevIndex < 0){
		$('#scwFlowElement'+counterPrev).hide();
		
		
		
		
		$('#scwFlowElement'+counterPrev).css({
			'width' : '65px',
			'height' : '174px',
			'left' : '137px',
			'top' : '58px'	
		});
		$('#scwFlowElement'+counterPrev+' img').css({
			'width' : '65px',
			'height' : '174px'
		});
		
		
		
		
		
		
	  }else{
		$('#scwFlowElement'+counterPrev).show();	
	  }
	  
	  $('#scwFlowElement'+counterPrev).addClass('pos'+counterPrevIndex);
	  
	  counterPrev--;
	  counterPrevIndex--;
	}
	while (counterNext < existingElements+1) {
	  if(counterNextIndex > 8){
		$('#scwFlowElement'+counterNext).hide();
		
		
		
		
			
		$('#scwFlowElement'+counterNext).css({
			'width' : '65px',
			'height' : '174px',
			'left' : '475px',
			'top' : '58px'	
		});
		$('#scwFlowElement'+counterNext+' img').css({
			'width' : '65px',
			'height' : '174px'
		});
		
		
		
		
			
	  }else{
		$('#scwFlowElement'+counterNext).show();	
	  }	
	  
	  $('#scwFlowElement'+counterNext).addClass('pos'+counterNextIndex);
	  
	  counterNext++;
	  counterNextIndex++;
	}				
}

function CoverMovementClick(middleElement){

	var basicWidth = 105;
	var basicHeight = 280;
	var basicLeft = 286;
	var basicTop = 23;
	
	var basicZIndex = 20;

	$('#scwFlowElement'+middleElement).animate({
		width: basicWidth,
		height: basicHeight,
		left: basicLeft,
		top: basicTop
	},transTime);
	$('#scwFlowElement'+middleElement+' img').animate({
		width: basicWidth,
		height: basicHeight
	},transTime);

	$('#scwFlowElement'+middleElement).removeClass().addClass('scwFlowElement pos4');
	counterPrev = middleElement-1;
	counterNext = middleElement+1;
	
	counterPrevIndex = 3;
	counterNextIndex = 5;

	while (counterPrev > -1) {
	  $('.scwFlowText').hide();	

	  basicZIndex = basicZIndex - 3;
	  
	  if(counterPrevIndex == 3){
	  	  basicWidth = 96;
	  	  basicHeight = 256;
	  	  basicLeft = 230;
	  	  basicTop = 33;
	  }else if(counterPrevIndex == 2){
	  	  basicWidth = 84;
	  	  basicHeight = 226;
	  	  basicLeft = 184;
	  	  basicTop = 43;
	  }else if(counterPrevIndex == 1){
	  	  basicWidth = 78;
	  	  basicHeight = 208;
	  	  basicLeft = 155;
	  	  basicTop = 48;
	  }else{
	  	  basicWidth = 65;
	  	  basicHeight = 174;
	  	  basicLeft = 137;
	  	  basicTop = 58;
	  }
	  
	  $('#scwFlowElement'+counterPrev).animate({
	  	width: basicWidth,
	  	height: basicHeight,
	  	left: basicLeft,
	  	top: basicTop
	  },transTime);
	  
	  
	  $('#scwFlowElement'+counterPrev+' img').animate({
	  	width: basicWidth,
	  	height: basicHeight
	  },transTime);
	  
	  $('#scwFlowElement'+counterPrev).show();

	  $('#scwFlowElement'+counterPrev).removeClass().addClass('scwFlowElement pos'+counterPrevIndex);
	  $('#scwFlowText'+middleElement).show();

	  counterPrev--;
	  counterPrevIndex--;
	}
	
	var basicWidth = 105;
	var basicHeight = 280;
	var basicLeft = 286;
	var basicTop = 23;
	var basicZIndex = 20;
	
	while (counterNext < existingElements+1) {
	
	  $('.scwFlowText').hide();	

	  basicZIndex = basicZIndex - 3;
	  
	  if(counterNextIndex == 5){
		  basicWidth = 96;
		  basicHeight = 256;
		  basicLeft = 351;
		  basicTop = 33;
	  }else if(counterNextIndex == 6){
		  basicWidth = 84;
		  basicHeight = 226;
		  basicLeft = 409;
		  basicTop = 43;
	  }else if(counterNextIndex == 7){
		  basicWidth = 78;
		  basicHeight = 208;
		  basicLeft = 444;
		  basicTop = 48;
	  }else{
		  basicWidth = 65;
		  basicHeight = 174;
		  basicLeft = 475;
		  basicTop = 58;
	  }

	  $('#scwFlowElement'+counterNext).animate({
		width: basicWidth,
		height: basicHeight,
		left: basicLeft,
		top: basicTop
	  },transTime);
	  
	  $('#scwFlowElement'+counterNext+' img').animate({
	  	width: basicWidth,
	  	height: basicHeight
	  },transTime);

	  $('#scwFlowElement'+counterNext).removeClass().addClass('scwFlowElement pos'+counterNextIndex);
	  $('#scwFlowText'+middleElement).show();
	  
	  $('#scwFlowElement'+counterNext).show();

	  counterNext++;
	  counterNextIndex++;
	}			
}
//AMENU TT_NEWS
function surfto(form) {
	var myindex=form.linkliste.selectedIndex
	if (form.linkliste.options[myindex].value != "0") {
	location=form.linkliste.options[myindex].value;}
}
//BÜHNE STARTSEITE
stageLoop = setInterval ( "stageCircle()", loopTime );

function stageCircle() {
	teaserID = gotoStage(counterBuehneHome);
	counterBuehneHome++;
	if(counterBuehneHome == stageElements+1){counterBuehneHome = 0};
}

function gotoStage(teaserMyID,triggerSource) {


	if(triggerSource == "button"){
		previusStage = tempID;
		
	}else if(triggerSource == "newprev"){
		previusStage = tempID;
		teaserMyID = teaserMyID - 1;
		if(teaserMyID < 0){
			teaserMyID = stageElements;
		}
		
	}else if(triggerSource == "newnext"){
		previusStage = tempID;
		teaserMyID = teaserMyID + 1;
		if(teaserMyID >= stageElements + 1){
			teaserMyID = 0;
		}
		
	}else{
		previusStage = teaserMyID - 1;
		if(previusStage == -1){previusStage = stageElements};
	}
	if(previusStage != teaserMyID){
		
		$('#buehneHome_Content'+previusStage).css('z-index',previusStage).fadeOut(slideTime);
		$('#buehneHome_Content'+teaserMyID).css('z-index','25').fadeIn(slideTime);
		$('#buehneHome_Button'+teaserMyID).addClass('activeCircle');
		$('#buehneHome_Button'+previusStage).removeClass('activeCircle');
		
		buttonColorAdd(teaserMyID);
		buttonColorRemove(previusStage);
	}
	tempID = teaserMyID;
	
	return teaserMyID;
}

function buttonColorAdd(teaserAddID){	
	$('#buehneHome_Button'+teaserAddID).addClass('active');	
}

function buttonColorRemove(teaserRemoveID){
	if(teaserRemoveID != clickedID || clickedID == 9999){
		$('#buehneHome_Button'+teaserRemoveID).removeClass('active');
		$('#buehneHome_Button'+teaserRemoveID).removeClass('activeCircle');
	}
}
