$(document).ready(functions_allgemein);

/*************************************************
 *************************************************/
function functions_allgemein() {
	/*$('h1').each(function(){
		$(this).textDropShadow();
	});*/
	/*var naviHeight = $('#mainNavi').height();
	$('#startseite #mainNavi').css({
		bottom: '-' + naviHeight + 'px',
		opacity: .7
	});
	$('#startseite #mainNavi').animate({
		bottom: '10px'
	}, 500).animate({
		bottom: 0,
		opacity: 1
	}, 300);
	*/
	
	// Schatten für Bilder hinzufügen
	$('span.imageWithCaption img').wrap('<span class="shadow"></span>');
	
	$('a.thickbox').click(function(e){
		var altText  = $(this).find('img').attr('alt');
		var fileType = altText.substr(-3,3);
		var pdfDir   = 'http://rvw.rsb.rpunkt.net/pub/public/pdfmaterial/';
		//$(this).attr('href', pdfDir + altText);
		if(fileType == 'pdf'){
			window.open(pdfDir + altText);
			tb_remove();
		}
	});
	
	 $('#sponsorenListing a').click(function(){
		window.open(this.href);
		return false;
	});
	/*$('.sponsorenListing li a').hover(function(){
		$(this).parent().addClass('active');
	}, function(){
		$(this).parent().removeClass('active');
	});*/
	
	elements = $('.sponsorenListing li').size();
	
	$('.sponsorenListing').jCarouselLite({
		visible:    elements,
		auto:       2500,
		speed:      1200,
        btnNext:    '.sponsorenListingNext',
        btnPrev:    '.sponsorenListingPrev',
        hoverPause: true,
        scroll:     1
    });
    
    var cycleOptions = { 
		fx:      'uncover', 
		speed:    1200, 
		timeout:  8000,
		sync:     1,
		pause:    true
	};
    $('ul.simpleNewsList').cycle(cycleOptions);
    
    $('#galleryListing').cycle(cycleOptions);
    
    cycleOptions['fx']   = 'fade';
    cycleOptions['speed']   = 1600;
    cycleOptions['timeout'] = 1200;
    cycleOptions['pause']   = false;
	$('#headerImg').cycle(cycleOptions);
	
};
