/* Fancybox init */
jQuery(document).ready(function($) {
	jQuery("a#profile_image").fancybox();
});

function proconutImageSwitch(activeElem) {
	// get the currently active element
	currentActive = jQuery('div.pic.active').attr('id');
	if(activeElem == currentActive) {
		return false;
	}
	// add intermediate class to current and new picture to allow sliding effect
	jQuery('div.pic.active').addClass('toggle');
	jQuery('#' + activeElem).addClass('toggle');
	// toggle the pictures with a slide effect
	jQuery('div.pic.toggle').slideToggle("slow", function() {
		jQuery(this).removeClass('toggle').removeClass('active');
		if(this.id && this.id == activeElem) {
			jQuery(this).addClass('active');
		}
	});
	// Switch the navigation buttons
	jQuery('div.leftpicture-nav')
		.find('li')
			.removeClass('active')
			.end()
		.find("a[href$='#" + activeElem + "']")
			.parent('li')
			.addClass('active')
		.end();
	return false;
}