// Initialise scripts
$(document).ready(function() {						   
  // Give the selection the height of the viewport or if bigger the height of the argument  
  $('#sidebar').maxHeight('#container');
  $('#gallery').maxHeight('#container');
  
  // Remove border-right of last 'a'
  $('#nav-lang li:last').addClass('border-none');  
 
  // Cufon - Choose which elemenets should be replaced
  Cufon.replace('#nav-main a', {hover: true});
  Cufon.replace('#sidebar h2.categorie');
  Cufon.replace('#content h1');
  Cufon.replace('#content h2');

 $('#gallery').prepend('<div class="slideshow ss-top"></div><div class="slideshow ss-bottom"></div>');
 $('#gallery img:even').appendTo('.ss-top');
 $('#gallery img:odd').appendTo('.ss-bottom');
  
  // Slideshows
  $('.ss-top').cycle({ 
    fx: 'hideFirstThenSlideRight', 
	cssFirst: {
		top: 0,
		left: -300
	},
	timeout:6000,
	speed: 3000,
	easing: 'easeOutQuart',
	sync: 0, 
	delay:-5000
  });
  $('.ss-bottom').cycle({ 
    fx: 'hideFirstThenSlideRight', 
	cssFirst: {
		top: 0,
		left: -300
	},
	timeout:6000,
	speed: 3000,
	easing: 'easeOutQuart',
	sync: 0, 
	delay:-2500
  });
});

