/* Author: Johan van der Geest*/
$(function() {
	// Frontpage
	$('#fp-slides img:first-child').fadeIn(500);
	$('#fp-slides').cycle('fade');

	// Portfolio
	$('#pf-image img').fadeIn(500);
	$('#pf-category h2').click(function(event) {
		$('#pf-category h2').toggleClass('active');
		$('#pf-category ul').toggleClass('closed');
		event.stopPropagation();
	});
	$('html').click(function() {
		$('#pf-category h2').removeClass('active');
		$('#pf-category ul').addClass('closed');
	});
	/*$("#pf-gallery a").each(function(index) {
		$(this).delay(50 * index).fadeIn(500);
	});*/

	// Footer tooltips
	$('#secondary a').tipsy({gravity: 'se'});
	
	// ASM
	var ab = '.abcdefghijklmnopqrstuvwxyz@';
	var asm = ab[10]+ab[15]+'ha'+ab[14]+ab[27]+'joh'+ab[1]+ab[14]+'vdg'+ab[5]+ab[5]+'st'+ab[0]+'nl';
	$('.asm').text(asm);
	$('.asm').attr('href', 'mailto:' + asm);
});
