jQuery (document).ready(function(){
	
	var height=$('div.hdh_start_teaser_container').height();
	
	window.setTimeout(animate_start_teaser,2000);

	
	if ( $('div.hdh_content div.article a').children().size() > 0 ) 
	{
		$('div.hdh_content div.article a').css('border-bottom','0px');
	};
		
		$('#hdh_content_close_button a')
		.bind('click', function(){
			$('div.hdh_content_container').hide();
			$('#hdh_content_show_button a').css('display','block');

		});		

		$('#hdh_content_show_button a')
		.bind('click', function(){
			$('div.hdh_content_container').show();
			$('#hdh_content_show_button a').css('display','none');		
		
		});	
		
		var timeout
		$('div.hdh_service')
			.bind( 'click', function(){		
				$('div.hdh_service_menu').slideDown('slow');
				$('div.hdh_service div.article span').addClass('open');
				$('#hdh_search').show();			
				})				


		
			.bind( 'mouseleave', function(){
				timeout=window.setTimeout(function(){
					$('div.hdh_service_menu').slideUp('slow');
					$('div.hdh_service div.article span').removeClass('open');
					$('#hdh_search').hide();
				},3000)
			})
			
			.bind( 'mouseenter', function(){
				window.clearTimeout(timeout);
			});				

		var timeout	
		$('div.hdh_offer_box')	
			.bind( 'click', function(){	
				$('div.hdh_offer_box div.article-pos-2 table').show();
				$('div.hdh_offer_box div.article-pos-1 span').addClass('open');
				$('div.hdh_offer_box div.article-pos-1 span').animate({width: '610px',opacity:1}, 800);
				$('div.hdh_offer_box div.article-pos-2').animate({width:'640px',opacity:1},800);
			}) 
			
			.bind( 'mouseleave', function(){
				timeout=window.setTimeout(function(){
				$('div.hdh_offer_box div.article-pos-1 span').animate({width: '118px'}, 800);
				$('div.hdh_offer_box div.article-pos-2').animate({width: '0px',opacity:0}, 800, function(){
					$('div.hdh_offer_box div.article-pos-2').hide();
				});
				$('div.hdh_offer_box div.article-pos-1 span').removeClass('open');
				},3000)

			}) 
			
			.bind( 'mouseenter', function(){
				window.clearTimeout(timeout);
			});		
			
	function animate_start_teaser(){
		$('div.hdh_start_teaser_container').animate({width:'657px',height:'234px'},1100);
		$('#hdh_content_close_button a').animate({width:'16px',height:'63px'},1100);
		
		$('#hdh_content_close_button a')
		.bind('click', function(){
			$('div.hdh_start_teaser_container').hide();
			$('#hdh_start_teaser_show_button a').css('display','block');
		});	
		
		$('#hdh_start_teaser_show_button a')
		.bind('click', function(){
			$('div.hdh_start_teaser_container').show();
			$('#hdh_content_show_button a').css('display','none');				
		});			
		
	}
			
			
    //id ermitteln und team member anzeigen
			
    $( "div.team_member_container div.team_member" ).each(
    
     
    function( getID ){
   	 var id=$(this).attr('id'); 
   	    $( this ).children().attr('title','Details');
	    $( this ).bind (
		    "click",function(){
		     $('div.team_member_detail_container').children().hide();
		   	 $('#team_member_detail_'+id).show();
		    }
	    );
     
    });	 
    
//Merkblatt

setInterval(function() {
	var content_height=$('.hdh_content').height();
	
	if ( jQuery.browser.msie ) {
		if($(window).scrollTop() > 200 && $(window).scrollTop() < content_height)
		{
		 $('#vnh-container,#vnh-notices').animate({
		 	top: $(window).scrollTop() + 20 + "px"
		 }, 200)	 
		}
		if($(this).scrollTop() < 200)
		{
			$('#vnh-container,#vnh-notices').css('top', 150 + "px")
		}
	}
	else{
		if($(window).scrollTop() > 200 && $(window).scrollTop() < content_height)
		{
		 $('#vnh-container').animate({
		 	top: $(window).scrollTop() + 20 + "px"
		 }, 200)
		 $('#vnh-notices').animate({
		 	top: $(window).scrollTop() - 24 + "px"
		 }, 200)	 
		}
		if($(this).scrollTop() < 200)
		{
			$('#vnh-container').css('top', 150 + "px")
			$('#vnh-notices').css('top', 106 + "px")
		}	
	}
},500);    

//Link und onclick bei den Galerien im Pressebreich entfernen
$('div.cms-module-gallery-list-258450 a').removeAttr('onclick');
$('div.cms-module-gallery-list-258450 a').removeAttr('href');
$('div.cms-module-gallery-list-258451 a').removeAttr('onclick');
$('div.cms-module-gallery-list-258451 a').removeAttr('href');
$('div.cms-module-gallery-list-258452 a').removeAttr('onclick');
$('div.cms-module-gallery-list-258452 a').removeAttr('href');
$('div.cms-module-gallery-list-258453 a').removeAttr('onclick');
$('div.cms-module-gallery-list-258453 a').removeAttr('href');
$('div.cms-module-gallery-list-258454 a').removeAttr('onclick');
$('div.cms-module-gallery-list-258454 a').removeAttr('href');
$('div.cms-module-gallery-list-258455 a').removeAttr('onclick');
$('div.cms-module-gallery-list-258455 a').removeAttr('href');

$('div.cst-detail-voucher li.cst-media-embed a.cst-link-image').removeAttr('href');
$('div.cst-detail-voucher li.cst-media-embed a.cst-link-image').removeAttr('onclick');
    
});
