$(document).ready(function() {
	$(window).scroll(function() {
		if($(this).scrollTop() != 0) {
			//console.log('Scroll: '+$(this).scrollTop());
			$('#toplink').fadeIn();
		} else {
			//console.log('Scroll: '+$(this).scrollTop());
			$('#toplink').fadeOut();
		}
	});
	if($(this).scrollTop() == 0)
		$('#toplink').hide();	
 
	$('#toplink').click(function() {
		$('body,html').animate({scrollTop:0},800);
		return(false);
	});	
});


// Ersetzt target_blank START //
$(document).ready(function(){
	$("a[rel^='external']").attr('target','_blank');
});
// Ersetzt target_blank ENDE //


//function setActive() {
//  aObj = document.getElementById('mainnav').getElementsByTagName('a');
//  for(i=0;i<aObj.length;i++) {
//    if(document.location.href.indexOf(aObj[i].href)>=0) {
//      aObj[i].className='active';
//    }
//  }
//}
//window.onload = setActive;

