/* Jquery - http://jquery.com/ */
/* Archives accordion */
$(document).ready(function() {
	$('div#archives-accordion> div.element').hide(); 
	$('div#archives-accordion> h3').click(function() {
		$(this).next('div').slideToggle('normal').siblings('div:visible').slideUp('normal');
	});
});

/* Home-link hidden with a fadeout effect after page loading */
$(document).ready(function() {
	$('#home-link').fadeOut();
});

/* Home-link displayed with a fadein effect when the cursor is over the logo */
$(document).ready(function() {
	$('#header-info').hover(function() {
		$('#home-link').fadeIn();}
		, function() {
		$('#home-link').fadeOut();
		
	});
	$('#header-info').click(function() {
			  window.location=$(this).find("a").attr("href"); return false;
	});
});

/* Links with rel=external attribute opened in a new window */
$(document).ready(function() {
    $('a[rel*=external]').click(function(){
        window.open(this.href);
        return false;
    });
});

/* Every external URL opened in a new window*/
$(document).ready(function() {
    $("a[href*='http://']:not([href*='" + location.hostname + "'])").attr("target", "_blank");
});