// trainingen dropdown menu
$(function(){
	
	// doe wat bij select
	$("select#trainselect").change( function(){
		jump(this);
	});
	
	// kut IE snapt niet dat 'ie het select-venster moet 
	// aanpassen aan de breedte van de content
	if ($.browser.msie) {
		
		// kut IE6 trekt hele lay uit elkaar
		// daarom position absolute
		var pos = $("select#trainselect").position();
		var top = pos['top'];
		var left = pos['left'];
	
		// bind functie aan trekmenu
		$("select#trainselect").mousedown( function(){
			$(this).width("390px");
			$(this).css("position","absolute");
			$(this).css("left",left);
			$(this).css("top",top);
		});
		$("select#trainselect").blur( function(){
			$(this).width("98%");
			$(this).css("position","relative");
			$(this).css("left","0");
			$(this).css("top","0");
		});
	}
	
	// fancybox
	$("a.enlarge").fancybox({
		
		'overlayShow'	: true,		// Toggle overlay
		'overlayOpacity': 0.3,		// Opacity of the overlay (from 0 to 1; default - 0.3)
		'overlayColor'	: '#666',	// Color of the overlay
		'showCloseButton'	: true,
		'titleShow'		: true,		// Toggle title
		'titlePosition'	: 'over',	// The position of title. Can be set to 'outside', 'inside' or 'over'

		'cyclic'		: true,
		'speedIn'		: 300, 
		'speedOut'		: 200 
	});

	
});

$(function(){

	$('img',$('a.boxitem'))
	.hover(
		function () {
			var image = $(this).attr('src').replace('_active','');
			$(this).attr('src',image.replace('.gif','_active.gif'));
		}, 
		function () {
			var image = $(this).attr('src').replace('_active','');
			$(this).attr('src',image);
		}
	);
});
