Cufon.replace('h2, h3, h4');

$(document).ready(function(){
	/*
	** popup boxes
	*/
	$(".btn-alle-klanten, #vacatures a").fancybox({
		'width'				: 750,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'autoDimensions'	: false,
		'transitionOut'		: 'none',
		'enableEscapeButton': true,
		'showCloseButton'	: true,
		'overlayColor'		: '#fff',
		'type'				: 'iframe'
	});
	/*
	** portfolio slideshow
	*/
	$('.slideshow div').cycle({
		fx: 'fade',
		next: '#thumb-nav .next',
		prev: '#thumb-nav .previous',
		speed: 'fast',
		timeout: 0
	});
	
	$('#popupbig span').cycle({
		fx: 'fade',
		speed: 'fast',
		timeout: 0,
		next : '.laad-meer'
	});
	
	$('.tnm').cycle({
		fx: 'fade',
		speed: 'fast',
		prev: '.np .previous',
		next: '.np .next',
		timeout: 0
	});
	$('.team img').hover(function(){
		var src = $(this).attr('title');
		$(this).attr('src','../img/team-'+src+'-hover.png');
	}, function(){
		var src = $(this).attr('title');
		$(this).attr('src','../img/team-'+src+'.png');
	});
	/*
	** portfolio scroll nav
	*/
	$('.slideshow-wrap').find('div').eq(2).hide();
	$('#pf-nav').find('a').click(function(evt){
		evt.preventDefault();
		$('.slideshow').hide();
		$($(this).attr('href')).show();
		$('#pf-nav').find('li').removeClass('current');
		$(this).parent().addClass('current');
	//	console.log($(this).attr('href'));
	});
	$('.scroll-top').click(up);
	$('.scroll-bottom').click(down);
	$('.scroll-bottom, .scroll-top').click(function(evt){ evt.preventDefault(); });
	
});
// eof jQuery
var scroll = 0;
var total = $('#pf-nav li ul li').length - 5;
function up() {
	if(scroll > 0) {
		scroll--;
		$('#pf-nav li ul').animate({ bottom:(-56*scroll*-1) },'fast');
	} 
	if(scroll < 1) {
		$('.scroll-top').addClass('inactief');
	}
}
function down() {
	if(scroll < total) {
		scroll++;
		$('#pf-nav li ul').animate({ bottom:(-56*scroll*-1) },'fast');
		$('.scroll-top').removeClass('inactief');
	} else {
		$('.scroll-bottom').css({'background-color':'#f2f2f2'});
	}
}
