$(document).ready(function(){

	/* External Links & File Types */
	$('a[rel*="external"]').externalLinks({
		title_prefix:    'Nieuw venster : '
	});
	$('a[href*="maps.google"]').externalLinks({
		class_name:      'maps',
		title:           'Toon in Google Maps',
	});
	$('a[href$=".pdf"]').externalLinks({
		class_name:      'acrobat',
		title:           'Adobe Acrobat Document',
		tracking_prefix: 'download'
	});
	$('a[href$=".vcf"]').externalLinks({
		class_name:      'vcard',
		title:           'Vcard',
		tracking_prefix: 'download'
	});
	/* External Links & File Types - Event Tracking */
	$('a[rel*="external"]').click(function() {
		var target = $(this).attr('href');
		pageTracker._trackPageview('/external/' + target);
	});
	$('a[href*="maps.google"]').click(function() {
		var target = $(this).attr('href');
		pageTracker._trackPageview('/external/' + target);
	});
	$('a[href$=".pdf"]').click(function() {
		var target = $(this).attr('href');
		pageTracker._trackPageview('/download/' + target);
	});
	$('a[href$=".vcf"]').click(function() {
		var target = $(this).attr('href');
		pageTracker._trackPageview('/download/' + target);
	});

	/* Portfolio Accordion */
	$('#portfoliobox').accordion({
		speed:  250,
		header: "h3"
	});
	$('#portfoliobox h3').addClass('accordion-enabled').attr('title', 'Klik hier om de details te zien');
	/* Portfolio Accordion - Event Tracking */
	$('#portfoliobox h3').click(function() {
		var name   = $(this).html();
		var target = $(this).next().attr('id');
		pageTracker._trackEvent("Portfolio", "Click", name);
		clicky.log('/portfolio.html#' + target, 'saspijkerman.com &raquo; Portfolio &raquo; ' + name);
	});

	/* Image Ticker */
	$('#ticker').cycle({
		delay:   -4000,
		fx:      'shuffle', 
		shuffle: {
			top:  -25,
			left: 185
		}
	});
	/* Image Ticker - CSS Fixes */
	$('#ticker li:first-child').addClass('first');

});
