// Kategorien
$(function(){
	$(".btn-slide2").click(function(){
		$("#panel2").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
});


// Archiv
$(function(){
	$(".btn-slide3").click(function(){
		$("#panel3").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
});


// fix for fonts
$(function(){
	$("h2").css({display:"block"});
	$(".post-title").css({display:"block"});
});


// Blogroll
$(function(){
	$(".btn-slide4").click(function(){
		$("#panel4").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
});


// RSS
$(function(){
	$("li.animate a img")
	.hover(function(){
		$(this).animate({ marginLeft: '-0.6em'});
		},
		function(){
		$(this).animate({ marginLeft: '0em'});
		});
});


// Pixelblog Fader
$(function(){
	$("#sidebar-3-content img")
	.hover(function(){
		$(this).animate({opacity: 1});
		},
		function(){
		$(this).animate({opacity: .8});
		});
});


// Flickr Fader
$(function(){
	$(".footer-box ul#flickr li img")
	.hover(function(){
		$(this).animate({opacity: 1});
		},
		function(){
		$(this).animate({opacity: .8});
		});
});

// Logo Fader
$(function(){
	$("#logo img")
	.hover(function(){
		$(this).animate({opacity: 1});
		this.src = this.src.replace("_off","_on");
		},
		function(){
		$(this).animate({opacity: .8});
		this.src = this.src.replace("_on","_off");
		});
});


// Link Styles for Images
$(function(){
    //Apply CSS class to all A links that end in .pdf
    $("a[href$='.ical']").addClass("ICAL");
    
    //Apply CSS class to all A links that end in .pdf
    $("a[href$='.pdf']").addClass("PDF");
    
    //Apply CSS class to all A links that start with mailto:
    $("a[href^='mailto:']").addClass("Mail");
});


// Animate Links
$(function(){
   $('li.cat-item')
  	.hover(function(){
  			$(this).animate({ marginLeft: '-0.6em' }, 600);
  		},
  		function(){
  			$(this).animate({ marginLeft: '0em' }, 1000);
  		});
  });


// Animate Twitter with Cycles
$(function()
	{
		$("#aktt_tweets").cycle({
    timeout:       6500,  // milliseconds between slide transitions (0 to disable auto advance) 
    speed:         800,  // speed of the transition (any valid fx speed value) 
    next:          null,  // id of element to use as click trigger for next slide 
    prev:          null,  // id of element to use as click trigger for previous slide 
    before:        null,  // transition callback (scope set to element to be shown) 
    after:         null,  // transition callback (scope set to element that was shown) 
    height:       '89', // container height 
    sync:          0,     // true if in/out transitions should occur simultaneously 
    fit:           0,     // force slides to fit container 
    pause:         1,     // true to enable "pause on hover" 
    delay:         0,     // additional delay (in ms) for first transition (hint: can be negative) 
    slideExpr:     null,  // expression for selecting slides (if something other than all children is required) 
		});
	}
);


// Smooth Scrolling
$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                return false;
            }
        }
    });
});

// Coda Bubbles
$(function(){
	$(".music li a").hover(function() {
	  $(this).next("em").animate({opacity: "show", top: "-37"}, "slow");
	}, function() {
	  $(this).next("em").animate({opacity: "hide", top: "-47"}, "fast");
	});
});
