$(document).ready(function() {
	// jQuery SmoothScroll
    $('a[href*=#]').click(function(){
    
        // duration in ms
        var duration = 1500;
        
        // easing values: swing | linear
        var easing = 'swing';
        
        // make sure it's the same location      
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname && this.hash.replace(/#/, '')) {
            // get parameters
            var hash = this.hash;
            var target = $(hash).offset().top;
            
            // animate to target and set the hash to the window.location after the animation
            $("html:not(:animated),body:not(:animated)").animate({
                scrollTop: target
            }, duration, easing, function(){
                location.hash = hash;
            });
            
            // cancel default click action
            return false;
        }
    });
	
	/*
	 * Social Bookmarks
	 */
	$('.social-bookmarks img').each(function(){
		$(this).css({opacity: 0.6})
		.bind("mouseenter", function(){
			$(this).stop().animate({
	            opacity: '1'
	        }, 'fast');
		})
		.bind("mouseleave", function(){
			$(this).stop().animate({
	            opacity: '0.6'
	        }, 'fast');
		});
	})
	
	/*
	 * Menupunkte
	 */
	$('#col3_content li img').each(function(){
		var $imageHeight = $(this).height();
		if($imageHeight > 23) {
			$(this).parent().parent().height(40);
		}
		else {
			$(this).parent().parent().height(20);
		}
	})

	// Add pdf icons to pdf links
	$("a[href$='.pdf']").addClass("pdf");
 
	// Add txt icons to document links (doc, rtf, txt)
	$("a[href$='.doc'], a[href$='.txt'], a[href$='.rft']").addClass("txt");
    
    
	
});

