$(document).ready(function() {
	var total = $("div#global_rightside").children("div.mainContentBlockCase").size();
	var realTotal = (total-1);
	var komp = $("div.slidesContainer_komp").length;
	var cases = $("div.slidesContainer").length;
	var pubs = $("div.slidesContainer_publikationen").length;
	var news = $("div.slidesContainer_news").length;
	var legal = $("div.slidesContainer_nontouch").length;
	
	
	var indiDif01 = 0;
	//alert("Total: "+realTotal+" davonsind,  kompetenzen: "+komp+ ", cases: "+cases+ ", publikationen: "+pubs+ ", news:"+news ", imprint:"+legal+"");
});
// gibt jeder Headline eine ID 
$(document).ready(function() {
	$(function() {
		$("div.subline").each(function(index){
			$(this).attr('id', 'headline_'+(index+1)+'');
	    });
	});
});

// gibt jedem slideshow container die hover ID und uebernimmt die hover funktion der slidshow weiter und zurueck button
$(document).ready(function() {
	$(function() {
		$("div.slideshow").each(function(index){
			$(this).attr('id', 'hover_'+(index+1)+'');
			var hover_id = $(this).attr("id");
			$("[id="+hover_id+"]").hover(
				function() { $("#next_"+(index+1)+"").removeClass('invisible next').addClass('visible next'); },
				function() { $("#next_"+(index+1)+"").removeClass('visible next').addClass('invisible next'); }
			);
			$("[id="+hover_id+"]").hover(
				function() { $("#prev_"+(index+1)+"").removeClass('invisible prev').addClass('visible prev'); },
				function() { $("#prev_"+(index+1)+"").removeClass('visible prev').addClass('invisible prev'); }
			);
		 });
	});
});

$(document).ready(function() {
	$(function() {
		$("a.next").each(function(index){
			$(this).attr('id', 'next_'+(index+1)+'');
			var next_id = $(this).attr("id");
		 });
	});
	$(function() {
		$("a.prev").each(function(index){
			$(this).attr('id', 'prev_'+(index+1)+'');
			var prev_id = $(this).attr("id");
		 });
	});
});
$(document).ready(function() {
	$(function() {
		$("div.indi").each(function(index){
			$(this).attr('id', 'indi_'+(index+1)+'');
			var indi_id = $(this).attr("id");
		 });
	});
});





// Sripte fuer Kompetzenzen
$(document).ready(function() {
	$(function() {
	    $('div.slidesContainer_komp').each(function(i) {
		var p = this.parentNode;
	        $(this).before('<div class="sidnav imgSelect_komp imgSelect_komp'+i+'">').attr('id', 'touch_komp_'+(i+1)+'').cycle({
	            fx:     'fade',
	            speed:  'fast',
	            timeout: 0,
				next: $('a.next', p),
				prev: $('a.prev', p),
	            pager:  '.imgSelect_komp' + i,
				before:  onBefore,
				after: 	onAfter,
				//end: blend,
				pagerAnchorBuilder: function(idx, slide) {
					var txt = $(slide).attr('title');
					return '<a href="#" class="side white">' + txt + '</a>';
				}
	        });
			function onBefore(curr, next, opts) {
				var index = opts.currSlide;
				var how = opts.slideCount+1;
				$(function() {
					var wie = $("div#indi_"+(i+1)+"").children().size();
					if (wie > 0){
						// do nothing
					}else {
						// erstell die indicator links
						for (var s = 1; s < how; s++){
							$("div#indi_"+(i+1)+"").append("<a class='indicator'><span>" +(1)+ "</span></a>");
						}
					}
				});	
				//var slideTotal = $(this).parent().children().size(); 
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+1)+"").removeClass("nav_first");
						$("a#prev_"+(i+1)+"").addClass("nav_first");
						$("div#indi_"+(i+1)+"").children("a:eq("+(index)+")").addClass("activeSlide");
					}
				});
			}
			function onAfter(curr, next, opts) {
				var index = opts.currSlide;
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+1)+"").addClass("nav_first");
						$("div#indi_"+(i+1)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+1)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						$("div#sidebar_cases_"+(i+1)+"").hide().html('<p>'+$("div#touch_komp_"+(i+1)+"").children("div:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index > 0){
						$("a#prev_"+(i+1)+"").removeClass("nav_first");
						$("div#indi_"+(i+1)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+1)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						$("div#sidebar_cases_"+(i+1)+"").hide().html('<p>'+$("div#touch_komp_"+(i+1)+"").children("div:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index == opts.slideCount- 1){
						$("a#next_"+(i+1)+"").addClass("nav_last");
					}
					if (index < opts.slideCount- 1){
						$("a#next_"+(i+1)+"").removeClass("nav_last");
					}
				});
			}
		});
	});
});



// Sripte fuer Cases
$(document).ready(function() {
	var komp = $("div.slidesContainer_komp").length;
	var dif01 = (komp+1);
	$(function() {
	    $('div.slidesContainer').each(function(i) {
		var p = this.parentNode;
	        $(this).before('<div class="indi imgSelect imgSelect'+i+'">').attr('id', 'touch_'+(i+1)+'').cycle({
	            fx:     'fade',
	            speed:  'fast',
	            timeout: 0,
				next: $('a.next', p),
				prev: $('a.prev', p),
	            pager:  '.imgSelect' + i,
				before:  onBefore,
				after: 	onAfter,
				//end: blend,
				pagerAnchorBuilder: function(idx, slide) {
					//var txt = '<span>' + (idx+1) + '</span> ' + $(slide).attr('title');
					return '<a href="#" class="indicator"><span>' + 1+ '</span></a>';
				}
	        });
			function onBefore(curr, next, opts) {
				var index = opts.currSlide;
				//var slideTotal = $(this).parent().children().size(); 
				
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif01)+"").removeClass("nav_first");
						$("a#prev_"+(i+dif01)+"").addClass("nav_first");
					//	$("div#sidebar_cases_"+(i+dif01)+"").hide().html('<p>'+$("div#touch_"+(i+1)+"").children("img:eq(0)").attr("name")+'</p>').fadeIn("fast");
					}
				});
			}
			function onAfter(curr, next, opts) {
				var index = opts.currSlide;
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif01)+"").addClass("nav_first");
						$("div#sidebar_cases_"+(i+dif01)+"").hide().html('<p>'+$("div#touch_"+(i+1)+"").children("img:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
						$("div#headline_"+(i+dif01)+"").removeClass('invisible');
					}
					if (index > 0){
						$("div#headline_"+(i+dif01)+"").addClass('invisible');
						$("a#prev_"+(i+dif01)+"").removeClass("nav_first");
						$("div#sidebar_cases_"+(i+dif01)+"").hide().html('<p>'+$("div#touch_"+(i+1)+"").children("img:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index == opts.slideCount- 1){
						$("a#next_"+(i+dif01)+"").addClass("nav_last");
					}
					if (index < opts.slideCount- 1){
						$("a#next_"+(i+dif01)+"").removeClass("nav_last");
					}
				});
			}
		});
	});
});








// Sripte fuer Publikationen
$(document).ready(function() {
	var komp = $("div.slidesContainer_komp").length;
	var cases = $("div.slidesContainer").length;
	var dif02 = (komp+cases+1);
	var indiDif01 = (komp+1);
	$(function() {
	    $('div.slidesContainer_publikationen').each(function(i) {
		var p = this.parentNode;
	        $(this).before('<div class="sidnav imgSelect_pub imgSelect_pub'+i+'">').attr('id', 'touch_pub_'+(i+1)+'').cycle({
	            fx:     'fade',
	            speed:  'fast',
	            timeout: 0,
				next: $('a.next', p),
				prev: $('a.prev', p),
	            pager:  '.imgSelect_pub' + i,
				before:  onBefore,
				after: 	onAfter,
				//end: blend,
				pagerAnchorBuilder: function(idx, slide) {
					var txt = $(slide).attr('title');
					return '<a href="#" class="side white">' + txt + '</a>';
				}
	        });
			function onBefore(curr, next, opts) {
				var index = opts.currSlide;
				var how = opts.slideCount+1;
				$(function() {
					var wie = $("div#indi_"+(i+indiDif01)+"").children().size();
					if (wie > 0){
						// do nothing
					}else {
						// erstell die indicator links
						for (var s = 1; s < how; s++){
							$("div#indi_"+(i+indiDif01)+"").append("<a class='indicator'><span>" +(s)+ "</span></a>");
						}
					}
				});
				//var slideTotal = $(this).parent().children().size(); 
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif02)+"").removeClass("nav_first");
						$("a#prev_"+(i+dif02)+"").addClass("nav_first");
						$("div#indi_"+(i+indiDif01)+"").children("a:eq("+(index)+")").addClass("activeSlide");
					}
				});
			}
			function onAfter(curr, next, opts) {
				var index = opts.currSlide;
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif02)+"").addClass("nav_first");
						$("div#indi_"+(i+indiDif01)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indiDif01)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						$("div#sidebar_cases_"+(i+dif02)+"").hide().html('<p>'+$("div#touch_pub_"+(i+1)+"").children("div:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index > 0){
						$("a#prev_"+(i+dif02)+"").removeClass("nav_first");
						$("div#indi_"+(i+indiDif01)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indiDif01)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						$("div#sidebar_cases_"+(i+dif02)+"").hide().html('<p>'+$("div#touch_pub_"+(i+1)+"").children("div:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index == opts.slideCount- 1){
						$("a#next_"+(i+dif02)+"").addClass("nav_last");
					}
					if (index < opts.slideCount- 1){
						$("a#next_"+(i+dif02)+"").removeClass("nav_last");
					}
				});
			}
		});
	});
});


// Sripte fuer Insights
$(document).ready(function() {
	var komp = $("div.slidesContainer_komp").length;
	var cases = $("div.slidesContainer").length;
	var pubs = $("div.slidesContainer_publikationen").length;
	var dif05 = (komp+cases+pubs+1);
	var indidif05 = (komp+pubs+1);
	$(function() {
	    $('div.slidesContainer_insights').each(function(i) {
		var p = this.parentNode;
	        $(this).before('<div class="sidnav imgSelect_insights imgSelect_insights'+i+'">').attr('id', 'touch_insights_'+(i+1)+'').cycle({
	            fx:     'fade',
	            speed:  'fast',
	            timeout: 0,
				next: $('a.next', p),
				prev: $('a.prev', p),
	            pager:  '.imgSelect_insights' + i,
				before:  onBefore,
				after: 	onAfter,
				//end: blend,
				pagerAnchorBuilder: function(idx, slide) {
					//var txt = '<span>' + (idx+1) + '</span> ' + $(slide).attr('title');
					//return '<a href="#" class="indicator"><span>' + 1+ '</span></a>';
					if (idx == 0 ){
						var txt = $(slide).attr('alt');
						return '<a href="#" class="side white">' + txt + '</a>';
					}
					else {}
				}
	        });
			function onBefore(curr, next, opts) {
				var index = opts.currSlide;
				var how = opts.slideCount+1;
				$(function() {
					var wie = $("div#indi_"+(i+indidif05)+"").children().size();
					if (wie > 0){
						// do nothing
					}else {
						// erstell die indicator links
						for (var s = 1; s < how; s++){
							$("div#indi_"+(i+indidif05)+"").append("<a class='indicator'><span>" +(1)+ "</span></a>");
						}
					}
				});
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif05)+"").removeClass("nav_first");
						$("a#prev_"+(i+dif05)+"").addClass("nav_first");
					}
				});
			}
			
			function onAfter(curr, next, opts) {
				var index = opts.currSlide;
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif05)+"").addClass("nav_first");
						$("div#sidebar_cases_"+(i+dif05)+"").hide().html('<p>'+$("div#touch_insights_"+(i+1)+"").children("div:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
						$("div#headline_"+(i+dif05)+"").removeClass('case_headline paper').addClass('gruen headline').hide().html('<h2>Lost &amp;  Found</h2>').fadeIn("fast");
						
						$("div#indi_"+(i+indidif05)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indidif05)+"").children("a:eq("+(index)+")").addClass("activeSlide");
					}
					if (index > 0){
						if ($("div#touch_insights_"+(i+1)+"").children("img:eq("+(index-1)+")").hasClass('postit')) {
							if ( $.browser.msie ) {
							 	$("div#headline_"+(i+dif05)+"").removeClass('gruen headline').addClass('headline_ie case_headline').hide().html('<h2>'+$("div#touch_insights_"+(i+1)+"").children("img:eq("+(index-1)+")").attr("title")+'</h2>').fadeIn("fast");
							}else{
						  		$("div#headline_"+(i+dif05)+"").removeClass('gruen headline').addClass('case_headline paper').hide().html('<h2>'+$("div#touch_insights_"+(i+1)+"").children("img:eq("+(index-1)+")").attr("title")+'</h2>').fadeIn("fast");
							}
						}else if ($("div#headline_"+(i+dif05)+"").hasClass('case_headline')) {
							if ($("div#headline_"+(i+dif05)+"").hasClass('headline_ie')) {
								$("div#headline_"+(i+dif05)+"").removeClass('headline_ie case_headline').addClass('gruen headline').hide().html('<h2></h2>').fadeIn("fast");
							}else{
							$("div#headline_"+(i+dif05)+"").removeClass('case_headline paper').addClass('gruen headline').hide().html('<h2></h2>').fadeIn("fast");
							}
						}
						
						$("a#prev_"+(i+dif05)+"").removeClass("nav_first");
						
						$("div#indi_"+(i+indidif05)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indidif05)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						
						$("div#sidebar_cases_"+(i+dif05)+"").hide().html('<p>'+$("div#touch_insights_"+(i+1)+"").children("img:eq("+(index-1)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index == opts.slideCount- 1){
						$("a#next_"+(i+dif05)+"").addClass("nav_last");
					}
					if (index < opts.slideCount- 1){
						$("a#next_"+(i+dif05)+"").removeClass("nav_last");
					}
				});
			}
		});
	});
});




// Sripte fuer News
$(document).ready(function() {
	var komp = $("div.slidesContainer_komp").length;
	var cases = $("div.slidesContainer").length;
	var pubs = $("div.slidesContainer_publikationen").length;
	var insights = $("div.slidesContainer_insights").length;
	var dif03 = (komp+cases+pubs+insights+1);
	var indiDif02 = (komp+pubs+insights+1);
	$(function() {
	    $('div.slidesContainer_news').each(function(i) {
		var p = this.parentNode;
	        $(this).before('<div class="sidnav imgSelect_news imgSelect_news'+i+'">').attr('id', 'touch_news_'+(i+1)+'').cycle({
	            fx:     'fade',
	            speed:  'fast',
	            timeout: 0,
				next: $('a.next', p),
				prev: $('a.prev', p),
	            pager:  '.imgSelect_news' + i,
				before:  onBefore,
				after: 	onAfter,
				//end: blend,
				pagerAnchorBuilder: function(idx, slide) {
					
					if (idx == 1 ){
						var txt = $(slide).attr('title');
						return '<a href="#" class="side white">' + txt + '</a>';
					}
					if (idx == 2 ){
						var txt = $(slide).attr('title');
						return '<a href="#" class="side white">' + txt + '</a>';
					}
					else {}
				}
	        });
			function onBefore(curr, next, opts) {
				var index = opts.currSlide;
				var how = opts.slideCount+1;
				$(function() {
					var wie = $("div#indi_"+(i+indiDif02)+"").children().size();
					if (wie > 0){
						// do nothing
					}else {
						// erstell die indicator links
						for (var s = 1; s < how; s++){
							$("div#indi_"+(i+indiDif02)+"").append("<a class='indicator'><span>" +(1)+ "</span></a>");
						}
					}
				});
				//var slideTotal = $(this).parent().children().size(); 
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif03)+"").removeClass("nav_first");
						$("a#prev_"+(i+dif03)+"").addClass("nav_first");
						$("div#indi_"+(i+indiDif02)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						
					}
				});
			}
			function onAfter(curr, next, opts) {
				var index = opts.currSlide;
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif03)+"").addClass("nav_first");
						$("div#indi_"+(i+indiDif02)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indiDif02)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						$("div#sidebar_cases_"+(i+dif03)+"").hide().html('<p>'+$("div#touch_news_"+(i+1)+"").children("div:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index > 0){
						$("a#prev_"+(i+dif03)+"").removeClass("nav_first");
						$("div#indi_"+(i+indiDif02)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indiDif02)+"").children("a:eq("+(index)+")").addClass("activeSlide");
						$("div#sidebar_cases_"+(i+dif03)+"").hide().html('<p>'+$("div#touch_news_"+(i+1)+"").children("div:eq("+(index)+")").attr("name")+'</p>').fadeIn("fast");
					}
					if (index == opts.slideCount- 1){
						$("a#next_"+(i+dif03)+"").addClass("nav_last");
					}
					if (index < opts.slideCount- 1){
						$("a#next_"+(i+dif03)+"").removeClass("nav_last");
					}
				});
			}
		});
	});
});
// Sripte fuer nicht touchwipe Container
$(document).ready(function() {
	var total = $("div#global_rightside").children("div.mainContentBlockCase").size();
	var dif04 = (total-2);
	var komp2 = $("div.slidesContainer_komp").length;
	var pubs2 = $("div.slidesContainer_publikationen").length;
	var insights2 = $("div.slidesContainer_insights").length;
	var news2 = $("div.slidesContainer_news").length;
	var indiDif03 = (komp2+pubs2+insights2+news2+1);
	$(function() {
	    $('div.slidesContainer_nontouch').each(function(i) {
		var p = this.parentNode;
	        $(this).before('<div class="sidnav imgSelect_non imgSelect_non'+i+'">').attr('id', 'touch_'+(i+1)+'').cycle({
	            fx:     'fade',
	            speed:  'fast',
	            timeout: 0,
				next: $('a.next', p),
				prev: $('a.prev', p),
	            pager:  '.imgSelect_non' + i,
				before:  onBefore,
				after: 	onAfter,
				//end: blend,
				pagerAnchorBuilder: function(idx, slide) {
					var txt = $(slide).attr('title');
					return '<a href="#" class="side white">' + txt + '</a>';
				}
	        });
			function onBefore(curr, next, opts) {
				var index = opts.currSlide;
				var how = opts.slideCount+1;
				$(function() {
					var wie = $("div#indi_"+(i+indiDif03)+"").children().size();
					if (wie > 0){
						// do nothing
					}else {
						// erstell die indicator links
						for (var s = 1; s < how; s++){
							$("div#indi_"+(i+indiDif03)+"").append("<a class='indicator'><span>" +(1)+ "</span></a>");
						}
					}
				});
				//var slideTotal = $(this).parent().children().size(); 
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif04)+"").removeClass("nav_first");
						$("a#prev_"+(i+dif04)+"").addClass("nav_first");
						$("div#indi_"+(i+indiDif03)+"").children("a:eq("+(index)+")").addClass("activeSlide");
					}
				});
			}
			function onAfter(curr, next, opts) {
				var index = opts.currSlide;
				$(function() {
					if (index == 0){
						$("a#prev_"+(i+dif04)+"").addClass("nav_first");
						$("div#indi_"+(i+indiDif03)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indiDif03)+"").children("a:eq("+(index)+")").addClass("activeSlide");
					}
					if (index > 0){
						$("a#prev_"+(i+dif04)+"").removeClass("nav_first");
						$("div#indi_"+(i+indiDif03)+"").children("a.activeSlide").removeClass("activeSlide");
						$("div#indi_"+(i+indiDif03)+"").children("a:eq("+(index)+")").addClass("activeSlide");
					}
					if (index == opts.slideCount- 1){
						$("a#next_"+(i+dif04)+"").addClass("nav_last");
					}
					if (index < opts.slideCount- 1){
						$("a#next_"+(i+dif04)+"").removeClass("nav_last");
					}
				});
			}
		});
	});
});
// gibt jeder Slideshow eine ID und benutzt diese um die touchwipe funktion anzu wenden
$(document).ready(function() {
	$(function() {
		if ( $.browser.msie ) {
		 // do nothing
		}else{
			$(".slidesContainer").each(function(index){
				var div_id = $(this).attr("id");
				//$("#touch_"+(index+1)+"").touchwipe({
				$("[id="+div_id+"]").touchwipe({
		        	wipeLeft: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id+"]").cycle("next");
		        	},
		        	wipeRight: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id+"]").cycle("prev");
		        	}
		    	});
		    });
			$(".slidesContainer_komp").each(function(index){
				var div_id_komp = $(this).attr("id");
				//$("#touch_"+(index+1)+"").touchwipe({
				$("[id="+div_id_komp+"]").touchwipe({
		        	wipeLeft: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_komp+"]").cycle("next");
		        	},
		        	wipeRight: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_komp+"]").cycle("prev");
		        	}
		    	});
		    });
			$(".slidesContainer_publikationen").each(function(index){
				var div_id_pub = $(this).attr("id");
				//$("#touch_"+(index+1)+"").touchwipe({
				$("[id="+div_id_pub+"]").touchwipe({
		        	wipeLeft: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_pub+"]").cycle("next");
		        	},
		        	wipeRight: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_pub+"]").cycle("prev");
		        	}
		    	});
		    });
			$(".slidesContainer_insights").each(function(index){
				var div_id_insights = $(this).attr("id");
				//$("#touch_"+(index+1)+"").touchwipe({
				$("[id="+div_id_insights+"]").touchwipe({
		        	wipeLeft: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_insights+"]").cycle("next");
		        	},
		        	wipeRight: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_insights+"]").cycle("prev");
		        	}
		    	});
		    });
			$(".slidesContainer_news").each(function(index){
				var div_id_news = $(this).attr("id");
				//$("#touch_"+(index+1)+"").touchwipe({
				$("[id="+div_id_news+"]").touchwipe({
		        	wipeLeft: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_news+"]").cycle("next");
		        	},
		        	wipeRight: function() {
						//$("#touch_"+(index+1)+"").cycle("next");
		            	$("[id="+div_id_news+"]").cycle("prev");
		        	}
		    	});
		    });
		}
	});
});



// gibt jedem Sidebar Container rechts vom Chart eine ID 
$(document).ready(function() {
	$(function() {
		$("div.sidebar_size").each(function(index){
			$(this).attr('id', 'sidebar_cases_'+(index+1)+'');
	    });
	});
});
// gibt jedem weiter und zurueck button eine ID und stellt sie auf invisible
$(document).ready(function() {
	$(function() {
		$("a.prev").each(function(index){
			$(this).attr('id', 'prev_'+(index+1)+'');
			$(this).attr('class', 'invisible prev nav_first');
	    });
	});
	$(function() {
		$("a.next").each(function(index){
			$(this).attr('id', 'next_'+(index+1)+'');
			$(this).attr('class', 'invisible next');
	    });
	});
	
});

