/**
 * Basic.js
 *
 * This JS document does 2 things:
 * - adding a fancybox to all media items op the website
 * - adding a cycle of images on the homepage
 *
 * @author Tim Segers
 */

// Function for toggling the other options box
function toggleBoxOthers(animationDuration) {
	var $e = $('#container-otheroption');
	if($('option[value="other"]').attr('selected')) {
		$e.slideDown(animationDuration);
	} else {
		$e.slideUp(animationDuration);
	}
}

$(document).ready(function() {
	$('a.fancy').fancybox({
		'titlePosition'	: 'inside'
	});

	$('#cycle').cycle({
		fx: 'fade',
		speed: 500,
		timeout: 3000
	});

	// Fix the hiding and showing of the other option box in the visit form
	toggleBoxOthers(0);
	$('#clienttype').click(function() {
		toggleBoxOthers(250);
	});
});
