
	$(document).ready(function() {
		// SUGGEST
		initSuggest();
		

		// FAQs
		$('.headlineText_wrapper').children('div.faq').children('div').children('div').each(function() {
			if(!$(this).parent().hasClass('active')) {
				$(this).show().slideUp(10).hide();
			}
		});
		
		$('.headlineText_wrapper').children('div.faq').children('div').children('a').click(function(evt){
			evt.preventDefault();
			if (!$(this).parent().hasClass('active')) {
				$(this).parent().parent().children('div').each(function(val){
					$(this).children('div').slideUp(300);
					$(this).removeClass('active');
				});
				
				$(this).parent().addClass('active');
				$(this).parent().children('div').slideDown(300);
			}
			else if ($(this).parent().hasClass('active')) {
				$(this).parent().parent().children('div').each(function(val){
					$(this).children('div').slideUp(300);
					$(this).removeClass('active');
				});
			}
		});

		// LOGIN BOX - PASSWORT VERGESSEN
		$('#vergessen_box').children('.blindfx2').children('input').click(function() {
			$(this).val('');
		}).blur(function() {
			if($(this).val() == "") $(this).val('E-Mail Adresse');
		});
			

		$(".doBlind2").click(function() { 
			if ($(this).hasClass('open')) {
				$(".blindfx2").hide("blind", { 
			        direction: "vertical" 
			    }, 800, function() {
					$(this).parent().children('.doBlind2').removeClass('open');
				});
			}
			else {
				$(".blindfx2").show("blind", { 
			        direction: "vertical" 
			    }, 800);
				$(this).parent().children('.doBlind2').addClass('open');
			}							
		});
		
		
		// SUB NAVIGATION ACCORDION
		$('#rechte_spalte').children('ul.subnav').children('li').children('ul').each(function(){
			if (!$(this).parent().hasClass('active')) {
				$(this).show().slideUp(10).hide();
			}
		});
		
		$('#rechte_spalte').children('ul.subnav').children('li').children('a').click(function(evt){
			evt.preventDefault();
			if (!$(this).parent().hasClass('active')) {
				$(this).parent().parent().children('li').each(function(val){
					$(this).children('ul').slideUp(500);
					$(this).removeClass('active');
				});
				
				$(this).parent().addClass('active');
				$(this).parent().children('ul').slideDown(500)
			}
			});
		
		//TEASER TABS
		var pause;
		var tabs_links = $('#teaser_reiter #tabs a');
		tabs_links.each(function(i){
			var j = 1 + i ;
			$(this).bind ("click",function(){
				if (!($(this).hasClass("active_tab"))){
					tabs_links.removeClass("active_tab");
					$(this).addClass("active_tab");
					$(".single_tab_content").css({display: "none", visibility:"visible"});
					$("#single_tab"+j).fadeIn(600);
				}
				return false;
			});
		});	
	});
	
	function getBaseLink(loc) {
		var b = document.getElementsByTagName('base');
		if (b && b[0] && b[0].href) {
			if (b[0].href.substr(b[0].href.length-1) == '/' && loc.charAt(0) == '/')
				loc = loc.substr(1);
			loc = b[0].href + loc;
		}
		return loc
	}
	
	