/*** Initiierung wenn DOM geladen ***/
$(function(){
	
	/*** Hacks für IE bis v7 ***/
	if ($.browser.msie && $.browser.version < 8) {
				
		/*** Leeres TITLE-Attribut an IMG anhängen -> keine ALT-Text-Tooltips ***/
		$('img:not([title])').each(function() {
			var bildtitel = $(this).parents('a');
			
			if($(bildtitel).attr('title')){
				$(this).attr('title', $(bildtitel).attr('title'));
			}
			else{
				$(this).attr('title', '');
			}
		});
	}
	
	$('#nav li:last span.divider').remove();
	
	/*** neue Fenster via JS für Strict-Validität ***/
	$('a[rel="external"], a.external').click(function(){
		window.open(this.href);
		return false;
	});
	
	/*** E-Mail-Spam-Schutz ***/
	$('.epost').yasp();
	
	$('#reden').hide();
	
	$('a[href*="#ef-"]').fancybox({
		'width'				: 500,
		'height'			: '90%',
		'autoScale'			: true,
		'autoDimensions'	: false,
		'centerOnScroll'	: true,
		'padding'			: '10',
		'opacity'			: true,
		'overlayShow'		: false,
		//'overlayColor'		: 'transparent',
		//'hideOnContentClick': true,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'inline'
	});
	
	$('a.iframe').fancybox({
		'width'				: 780,
		'height'			: 463,
		'centerOnScroll'	: true,
		'autoDimensions'	: false,
		'padding'			: '0',
		'opacity'			: true,
		'overlayShow'		: false,
		'overlayColor'		: 'transparent',
		'hideOnContentClick': true,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe'
	});
	
	//$('#images a[class="gallery"]').fancybox({
	$('#images a').attr('rel', 'gallery').fancybox({
		'autoScale'			: true,
		'centerOnScroll'	: true,
		'padding'			: '10',
		'opacity'			: true,
		'overlayShow'		: false,
		'overlayColor'		: 'transparent',
		'hideOnContentClick': true,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'cyclic'			: true
	});
	
	/*** Funktionen initiieren ***/
	//nachOben(); 
	//$(window).resize(nachOben);
	
});
