$(document).ready(function() {
Cufon.replace('h1', {
	textShadow: '1px 1px rgba(0, 0, 0, 0.2)'
});
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('.thumbinfo');


$(document).ready(function() {
	$("a.kuva").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	500, 
		'speedOut'		:	280, 
		'overlayShow'	:	true
	});
	
});

$(window).scroll(function() {
 var bodyTop = $(window).scrollTop()
 var navLoc = $('#nav').offset().top;
  if ( navLoc < bodyTop ) {
	 istop = $('#nav').is('.fixd');
	 
	    if (!istop){
    // fade out h2 if not already faded
	$('#nav').addClass('fixd').animate({top:0});
   }
	} else {
	if (istop || bodyTop <= 116) {
    // fade in h2 if faded
 $('#nav').removeClass('fixd');
   }
	}

});

$(document).ready(function() {
  $('#links').onePageNav({
  currentClass: 'active',
  changeHash: false,
  scrollSpeed: 750
});
});

});

