	$(document).ready(function(){
	
			/* detach width and height attributes to enable css resizing */
			$("div.bigbox img").removeAttr('width');
			$("div.bigbox img").removeAttr('height');
			
			/* detach empty links, workaround for typo3 */
			$('div.slidercontainer div.slider a:empty').detach();
			$('div.thumbslidercontent a:empty').detach();
			
			$('div.contentwrapper a:empty').detach();
			
			/* detach news ul li nested elements */
			$('li.level1 > span').parent().detach();
			$('div.level2 > span').parent().detach();
			$('ul.news_catmenu a:first').detach();
			
			/* add first class to contentwrapper to avoid double lines (css background image von contentwrapper and content) */
			$("div.contentwrapper div.content:first-child").addClass("first");
	
			
			/* count the amount of sliders and active cylce.all plugin */
			slidercontainercounter=1;
			$("div.slidercontainer div.slider").each(function(){
				
				$(this).addClass("slider"+slidercontainercounter);
				
				slidercounter=1;
				
				$(this).children().each(function(){
	
					if(slidercounter%2==1){
						$(this).addClass("first");
					}
					
					slidercounter++;
				})
				
				for(i=0;i<=slidercounter;i++){
					$(this).children().slice(i,i+2).wrapAll("<div class='contentwrapper'></div>");
				}
				
				if(slidercounter>3){
	
					prevbutton=($(this).parent().find('a.slider-prev'));
					nextbutton=($(this).parent().find('a.slider-next'));
				
					$(this).cycle({
						fx: 'scrollHorz',
						speed:  'medium',
				        timeout: 0,
				        next:   nextbutton,
				        prev:   prevbutton,
				        after: onAfterSlider,
				        containerResize:1
					});
					
				}else{
				
					$(this).parent().find('ul.slidermenu').hide();
					
				}
	
				slidercontainercounter++;
				
			})
	
			
			/* Dropdown menu */
			$("ul.dropdown li.main a").click(function () {
				
				 //remove all previous activated links
				 $("ul.dropdown li a").removeClass("activeclick");
				 
				 //make sure the main menu isnt a real link.
				 if($(this).next().children().attr('class')=='sub'){
					 
					 $(this).attr("href", "javascript:void(0);");
					 
					 //get the parentcontainer ul to add the class to add the background immage
				     parentcontainer = $(this).parent().parent();
				     parentcontainer.addClass("activedropdown"+parentcontainer.attr('id'));
				     
				 }
				 
				 //add the clicked link as actived
			     $(this).addClass("activeclick");
	
				//fade out all dropdown which where previous activaed
			     $('ul.menu li div').css('display', 'none');
	
			    //get offset from top do position dropdown 
				offset=($(this).offset());
				
				//position the div
				$(this).next().css('top', (120-offset.top)+'px');
				
				//fade in the div
				$(this).next().fadeIn(300, function(){$(this).children().next().css('display', 'block');});
				//display dropdown inside the div 
				
				//blur the menu
			    $(this).blur();
			    
			  });
	
	
			$("ul.dropdown").mouseleave(function(){
	
				$("ul.dropdown").removeClass("activedropdown"+$(this).attr('id'));
				$("ul.dropdown li a").removeClass("activeclick");
	
				$("ul.dropdown li div img").css('display', 'none');
				$("ul.dropdown li div").fadeOut(300);
	
			});
	
	
			
			
			var pageUrl = location.href.split('#')[0];
			
			if (anchor) {
				
				if (anchor.substr((anchor.length-1),1) == "!") {
					anchor = anchor.substring(0,(anchor.length-1));
				}
	
				//Karriere
				$('#'+anchor+' a.expand').click();
				
			}
			
			
			/**
			 * Function for text expanding
			 */
			//hide all text that can be expanded
			$('div.expansion').hide();
	
			
			//close button function
			$('a.close').click(function() {
				
				$(this).parent().parent().hide(400);
				
				$('.expand', $(this).parent().parent().parent() ).fadeIn();
				
				if($('.csc-default').text().length > 0){
					$.scrollTo( $(this).closest('.csc-default'), 400 );
				}
				
				$(this).hide();
	
			}).attr("href", "javascript:void(0)");
			
			//show button function
			$('a.expand').show().click(function() {
				
				$(this).hide();
	
				$('.expansion', $(this).parent().parent()).show(300);
				if($('.csc-default').text().length > 0){
					$.scrollTo( $(this).closest('.csc-default'), 400 );
				}
				
				$('a.close').show();
				
			}).attr("href", "javascript:void(0)");
			
			
			
			//each show button gets an javascript URL attached
			$('a.expand').each(function() {
				$(this).attr("href", pageUrl + "#" + $(this).closest('.csc-default').attr("id") );
			});
			
			
			//show all standard open expansions
			$('div.open').show();
			
			//hide all standrd open open links and show all standard open close links
			$('div.open').parent().children('p').children('a.expand').hide();
			$('div.open a.close').show();
			
			
			/* Newsbereich close und expand Buttons */
			if(lang=="en"){
				$('.news_item.expandable p.text').append(" ").append(
					$('<br /><br /><a href="" class="expand">Read&nbsp;news</a>')
					 );
				
				$('.news_item.expandable p.redmorebutton').append(" ").append(
						$('<a href="" class="expand">Read&nbsp;news</a>')
						 );
			}else{
				$('.news_item.expandable p.text').append(" ").append(
					$('<br /><br /><a href="" class="expand">Meldung&nbsp;lesen</a>')
					 );
				
				$('.news_item.expandable p.redmorebutton').append(" ").append(
						$('<a href="" class="expand">Meldung&nbsp;lesen</a>')
						 );				
			}
			
			
			$('.news_item.expandable p a.expand').click(function() {
				
				if(lang=="en"){
		
					$('.expansion', $(this).parent().parent()).show(300).append(
						$('<p><br /><a href="javascript:void(0)" class="close">Close</a></p>')
					);
				}else{
					$('.expansion', $(this).parent().parent()).show(300).append(
						$('<p><br /><a href="javascript:void(0)" class="close">Meldung schlie&szlig;en</a></p>')
					);				
				}				
				$.scrollTo( $(this).closest('.csc-default'), 400 );
				
				$('.news_item.expandable p a.close').click(function() {
					
					$(this).parent().parent().hide(400);
					
					$.scrollTo( $(this).closest('.csc-default'), 400 );
					
					$('.expand', $(this).parent().parent().parent() ).fadeIn();
					$(this).parent().hide();
					$(this).hide();
		
					
				});
				
				$(this).hide();
	
			});
	
			$('.news_item.expandable p a.expand').each(function() {
				$(this).attr("href", pageUrl + "#" + $(this).closest('.csc-default').attr("id") );
			});
	
		
			
			
			
			/* Check if anchor is part of URL to click on expander */
			var locationhref = unescape(location.href);
			var anchor = locationhref.split('#')[1];
			
			if (anchor) {
	
				//Newsbereich
				$('#'+anchor+' .news_item.expandable p a.expand').click();
			}
			
			
			/* showInfo */
			$(document).mousemove(function(e){
				$('#hover').css({top:(e.pageY+20) + "px", left:(e.pageX+10) + "px"});
			});
			
			$('.thumbslidercontent').mouseout(function(){
				$('#hover').stop(true,true).fadeOut(70);
			});
			
			$('.bigbox').mouseout(function(){
				$('#hover').stop(true,true).fadeOut(70);
			});
			
			
			
			/* Content Teaser MouseOver ändert Icon_Arrow und Links werden active */
			$('div.smallbox a').mouseover(function(){
				if($(this).children('img').attr('src')=='fileadmin/templates/images/icon_teaser_arrow.gif'){
					$(this).children('img').attr('src','fileadmin/templates/images/icon_teaser_arrow_active.gif');
				}
			});
			
			$('div.smallbox a').mouseout(function(){
				if($(this).children('img').attr('src')=='fileadmin/templates/images/icon_teaser_arrow_active.gif'){
					$(this).children('img').attr('src','fileadmin/templates/images/icon_teaser_arrow.gif');
				}
			});
			
			
	});

	
	
	function onAfterSlider(curr, next, opts) {
		
	    var index = opts.currSlide;
	    
	    currentCounterContainer = ($(this).parent().parent().find('li.slider-currentcounter'));
	    totalCounterContainer = ($(this).parent().parent().find('li.slider-nextcounter'));
	    
	    currentCounterContainer.html(opts.currSlide+1);
	    totalCounterContainer.html(opts.slideCount);
	    
	}

		
	
	function showInfo(info)
	{
	  $('#hover').text(info);
	  $('#hover').stop(true,true).fadeIn(250);
	}
	
	
	function Fensterweite()
	{
		if (window.innerWidth) return window.innerWidth;
		else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
		else return 0;
	}
	
	function Fensterhoehe()
	{
		if (window.innerHeight) return window.innerHeight;
		else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
		else return 0;
	}
	
	
	function neuAufbau()
	{
			return;
		/*
		Weite = Fensterweite();
		Hoehe = Fensterhoehe();
	
		if(Weite > 400){
			document.getElementById('bodytag').className='small';
		}
	
		if(Weite > 800){
			document.getElementById('bodytag').className='small';
		}
	
		if(Weite > 1230){
			document.getElementById('bodytag').className='normal';
		}*/	
	}
	
	/*Überwachung von Netscape initialisieren*/
	if(!window.Weite && window.innerWidth)
	{
		var Weite = Fensterweite();
		var Hoehe = Fensterhoehe();
		window.onresize = neuAufbau;
	
	}
