(function($){

	$(document).ready(function() {

		// set new content of search-box
		$('#s').removeAttr('onblur');
		$('#s').val('');
		
		// add enlarge-button to images with class 'prettyPhoto'
		var enlargeTemplate = '<p class="enlargeLink"><a href="__link__" rel="prettyPhoto"><img src="' + HTTP + '/images/icon_enlarge.gif" /></a></p>';
		$('img.prettyPhoto').each(function(i){
			var href = $(this).parent().attr('href');
			var enlarge = enlargeTemplate.replace(/__link__/g, href);
			$(this).parent().after(enlarge);
		});

        // $('.entry-meta, .entry-utility').animate({
        //     'opacity', 0
        // }, {duration: 'slow'});

        // hide postheader and -footer
        interval = window.setTimeout(function(){
            $('.entry-meta, .entry-utility').animate({
                'opacity': 0
            }, {duration: 1000});
        }, 1000);
        
        
        // show postheader and -footer on mouseover
		$('.post').bind('mouseenter', function(event) {
            $('.entry-meta, .entry-utility', this).animate({
                'opacity': 1
            }, {duration: 'slow'});
        }).bind('mouseleave', function(event) {
            $('.entry-meta, .entry-utility', this).animate({
                'opacity': 0
            }, {duration: 'slow'});
        });

    	// add pdf icons to pdf links
    	$("a[href$='.pdf']").addClass("pdf");

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

})(jQuery);