//Autor: Frank Matuse, Manuela Zogbaum

$(document).ready(function(){

	$('.datecontent').hide();

	$('ul#fader').innerfade({
						speed: 700,
						timeout: 7000,
						type: 'random_start'
	});

	$('ul#ticker').innerfade({ animationtype: 'fade', speed: 500, timeout: 3000, type: 'random', containerheight: '3.5em' }); 

	$('.dateheadline a').click(function() {

		t = $(this).parent().parent().attr('id');

		$('.dateheadline>span.close').hide();
		$('.datecontent').slideUp('fast');
		$('.dateselected').removeClass('dateselected');	

		if($('#' + t + '>.datecontent').css('display') != 'block') {
			$('#' + t).addClass('dateselected');
			$('#' + t + '>.datecontent').slideDown('fast');
			$('#' + t + '> .dateheadline a').append('<span class="close"><span class="hide">close</span></span>');
			$('#' + t + '> .dateheadline .close').fadeOut('slow');
		} else {
			$('#' + t + '> .dateheadline .close').hide();
		}
		return false;
	})

	$('.dateheadline a').hover(
		function() {
			if($(this).parent().parent().is('.dateselected') && $('.close', this).css('display') != 'block')
				$('.close', this).fadeIn('fast');
		},
		function(){
			$('.close', this).fadeOut('fast');
		}
	);

	$('.f').fancybox();

	$('.kwicks').kwicks({
		max : 500,
		spacing : 5
	});
    $('span.gallery_thumb, span.gallery_title ').css({pointer : 'hand'});
    $('span.gallery_thumb, span.gallery_title ').click(function(){
        location.href=$(this).parent().attr('href');
    })
}); 
