function viewPort() { 	

	var topLink = $('p.nachoben');

	if($(window).height() < $(document).height()-40){
		$(topLink).show().find('> a').click(function(){
			$.scrollTo( '#top', 500 );
			return false;
		});
	}
	else {
		$(topLink).hide();
	};
	
};

$(document).ready(function() {  
										 
	viewPort();	
	$(window).resize(viewPort); 
	
	$('#rahmen').prepend('<a id="top"></a>');
			
	$('.epost').yasp();
	
	// Leeres TITLE-Attribut an IMG anhängen -> keine ALT-Text-Tooltips in IE bis v7
	if($.browser.msie && $.browser.version <= 7){

		$('img:not([title])').each(function() {
		 
		var bildtitel = $(this).parents('a');
		
		if($(bildtitel).attr('title')){
			$(this).attr('title', $(bildtitel).attr('title'));
		 }
		else{
			$(this).attr('title', '');
		 }
		});
	};	
	// Layout-Workaround(s) für IE 6
	if($.browser.msie && $.browser.version <= 6){
		$('p + h2, ul + h2').css({'margin-top' : '1.5em'});
	};
	
	
	// Neues Fenster für Links via Klasse
	$('a.neues-fenster').attr('target', '_blank');


});

