Cufon.replace('#language,#breadcrumb div,.interactionblock,.interactionblockSmall', { fontFamily: 'Frutiger' });
/* begin Stijn */
//Cufon.replace('#menu', { fontFamily: 'Frutiger', hover:true });
/* end Stijn */
Cufon.replace('h6', { fontFamily: 'Plantin' });

$(document).ready(function() {
	$("#header.home").parent('div').parent('body').addClass("home");
						   
	$('a.product').tipsy({gravity: 'w', offset: '-10px'});
						   
	$('a.gallery').lightBox();
	
	if($("form.specify").length > 0){
	if($("form.specify").prev().get(0).tagName=="H1"){ $("form.specify").prev().addClass('other'); }
	}
	
	$(".literature h4:eq(0)").css('border',0);
	
	$("#address").click(function(){
		if($("p.inactive").length > 0){
			$("p.inactive").removeClass('inactive');
		}
		$("#address").remove();
	});
									
	$("#menu > li").hover(function (){
		$(this).addClass('hover');
	},function(){
		$(this).removeClass('hover');
	});
	$("#menu > li > ul").hover(function(){
		$(this).parents('li').addClass('hover');
	},function(){
		$(this).parents('li').removeClass('hover');
	});
	
	var $type;
	$("input").each(function(){
		$type = $(this).attr('type');
		$(this).addClass($type);
	});
	
	$('#slideshow .slides').cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: 7000, 
		next:   '#next', 
		prev:   '#prev',
		pause:	1,
		after: onAfter1 
	});
	function onAfter1(curr,next,opts) {
        var caption1 = (opts.currSlide);
		$("h1:visible").hide();
		$("h1:eq(" + caption1 + ")").show();
		$("div.info:visible").hide();
		$("div.info:eq(" + caption1 + ")").show();
	}
	$('.accordion,.literature').accordion({
		 autoHeight: true,
		// the drawer handle
		 header: 'h4',	
		 // our selected class
		 selectedClass: 'open',
		 //alwaysOpen
		 alwaysOpen: true, 
		 // match the Apple slide out effect
		 event: 'click'
	});
	$('.mid').each(function(){
		$(this).find('img.full').hide();
		$(this).find('img.full:eq(0)').show();
	});
	
	$(".trials h4").click(function(){
		$(this).parents('.mid').find('img.full').hide();
		$(this).parents('.mid').find('img.full:eq(' + $(".trials h4").index(this) +')').show();
	});

	$(".homeNews h4").click(function(){
		$(this).parents('.mid').find('img.full').hide();
		$(this).parents('.mid').find('img.full:eq(' + $(".homeNews h4").index(this) +')').show();
	});
	
	$('h4,.faq li,.column-quarter li,.literature h4').hover(function(){
		$(this).addClass('hover');
	},function(){
		$(this).removeClass('hover');
	});
	$(".certified thead td:not(:last)").prepend("<div class='spacing'></div>");

		//get magazine equal height
	$('.magazineRight').each(function(){
		var heightRight = $(".magazineRight").height();
		var newHeight = heightRight - 224;
		$('.magazineBlock .dynamicHeight').css('height',newHeight);
	});				
	
	//slide functie samenvatting
	$(".getTotalSummary").click(function(){
		var current = $(this).attr("rel");		
		$('#' + current).slideToggle('200', function() {
			// Animation complete.
		});
		$(this).hide();								 
	});
	
	$(".closeTotalSummary").click(function(){
		var current = $(this).attr("rel");								   
		$('#' + current).slideToggle('200', function() {
			// Animation complete.
		});
		$('.getTotalSummary[rel=' + current + ']').fadeIn('200', function(){
		});
	});	
	
	
	
	//NEWS AND TRAIL OVERVIEW
	$('.newsitems > li > .thumb').css('display','none');
	$('.newsitems > li > .thumb').css('opacity',0);
	$('.newsitems > li > a > .newsItemArrow').css('display','none');
	$('.newsitems > li > a').hover(function(){
		$(this).parent('li').addClass('newsItemHover');
		$(this).parent().children('.thumb').css('display','inline-block');
		$(this).parent().children('.thumb').animate({opacity:1},{queue:false,duration:200});
		$(this).children('.newsItemArrow').css('display','inline-block');
	},function(){
		$(this).parent('li').removeClass('newsItemHover');
		$(this).parent().children('.thumb').css('display','none');
		$(this).parent().children('.thumb').animate({opacity:0},{queue:false,duration:200});
		$(this).children('.newsItemArrow').css('display','none');
	});
								
									
});

Shadowbox.init({counterType:'skip'});
