Cufon.replace('h2',{fontFamily: 'Myriad Pro'} );
Cufon.replace('h3',{fontFamily: 'Myriad Pro'} );
Cufon.replace('h4',{fontFamily: 'Myriad Pro'} );
Cufon.replace('h5',{fontFamily: 'Georgia'} );
Cufon.replace('#ervaringen .referentie .testimonial',{fontFamily: 'Georgia'} );
		
$(document).ready(function() {
	if($('.features').html() != undefined || $('.top').html() != undefined){
		$('.features, .top').localScroll();
	}
	if($('#sliderContent').html() != undefined){ $('#sliderContent').suSlider(); } 
	
	$('#loginButton').click(function(event){
		event.stopPropagation();
		$(this).hide();	
		$('#loginButtonOut').show();
		
	});
	$('body').bind('click', function(){ $('#loginButtonOut').hide(); $('#loginButton').show();});
	$('#loginButtonOut').click(function(event){
		event.stopPropagation();
	});
	jQuery("<img>").attr("src", "/images/login-button-out.png");
	
	$('.more').click(function() {
		$(this).find('.link').toggleClass('active');
		$(this).find('.infomarker, .info').slideToggle('fast', function() {
			// Animation complete.
		});
		//$(this).find('.logos').fadeToggle('fast', function() {
			// Animation complete.
		//});
	});


	function cycleNews(){
		var current = $(".newsBulletin>li.active").attr("class");
		current = current.replace(" active", "");
		current = current.replace("news", "");

		var total   = 3;
	            
		if(current == total){
			var next    = 1;
		}else{
			var next    = parseInt(current) + 1;
		}
		
		$(".newsBulletin>li.news"+current).fadeOut(500, function() {
			$(this).removeClass("active");
			$(".newsBulletin>li.news"+next).fadeIn(500, function(){
				$(this).addClass("active");
			});		
		});
	}
	
	if($(".newsBulletin>li.active").html() != null){
		setInterval(function () {
			cycleNews();
		}, 1 * 6000);
	}
	
	/* Fancybox */	
	if($('a[rel="fancyboxImage"]').html() != null){
		$('a[rel="fancyboxImage"]').fancybox({
			'titleShow'     : true,
			'titlePosition' : 'inside',
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic',
			'easingIn'      : 'easeOutBack',
			'easingOut'     : 'easeInBack'
		});
	}	
	if($('a[rel="fancyboxYoutube"]').html() != null){	
		$('a[rel="fancyboxYoutube"]').click(function() {
			$.fancybox({
					'padding'		: 0,
					'autoScale'		: false,
					'transitionIn'	: 'elastic',
					'transitionOut'	: 'none',
					'easingIn'      : 'easeOutBack',
					'title'			: this.title,
					'width'			: 854,
					'height'		: 510,
					'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
					'type'			: 'swf',
					'swf'			: {
										'wmode'				: 'transparent',
										'allowfullscreen'	: 'true'
									  }
				});
		
			return false;
		});
	}


});
