$(document).ready(function(){
// Anchor sliding
	$("a.anchorLink").anchorAnimate()
// Little Navbar animation
$('#site_navigation ul li').hover(function(){
    $(this).find('span').animate({ 
        top: '5px'}, 200).animate({
        top: '15px'}, 100).animate({
        top: '10px'}, 50).animate({
        top: '15px'}, 25);
}, function(){
    $(this).find('span').animate({
        top: '25px'}, 100); 
	});
// External Links
$('a[rel="external"]').click( function() {
    window.open( $(this).attr('href') );
    return false;
    });

});
// Anchor Jumping
jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 1100
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}