// Initialise scripts
$(document).ready(function() {						   
  // Give the selection the height of the viewport or if bigger the height of the argument  
  $('body:not(.infoform)').maxHeight('#wrapper');

  $('#sidebar-st').maxHeight('#wrapper-st');
  
  // Remove border-right of last 'a'
  $('#nav-lang li:last').addClass('border-none');  
  
  // Add the elements to the DOM
  $('#branding').append('<div class="shadow"></div>');
  $('#slideshow').prepend('<div class="shadow"></div>');
  $('body').append('<div class="extra-1"></div>');
  
  // Cufon - Choose which elemenets should be replaced
  Cufon.replace('#branding p', {fontFamily: 'Trajan Pro'});
  Cufon.replace('#content h1', {fontFamily: 'Trajan Pro'});
  Cufon.replace('#sidebar li a', {fontFamily: 'Trajan Pro'});
  Cufon.replace('#sidebar-st li a', {fontFamily: 'Trajan Pro'});  
  
  // Slide image on "start" page
  $('#slider img:first').show();
  $('#slider').animate({
    left: '344px'}, 2000, 'easeOutQuart', function() {	  
	  setInterval(function(){
        $('#slider img:first').fadeOut()
          .next('img').fadeIn()
           .end().appendTo('#slider');}, 
      3000); 	 
  });
  
 // Slideshow
 $('#slideshow img:gt(0)').hide();
  setInterval(function(){
    $('#slideshow img:first').fadeOut()
       .next('img').fadeIn()
       .end().appendTo('#slideshow');
    }, 
    6000);  

 // Lightbox
 $('.lightbox').lightbox({
     fitToScreen: true,
     imageClickClose: false
 });
});

