function init() {
    // Initialize slideshow
    show = new slides();
    discussion();
    
    // Check for a cover
    if($("body").hasClass("cover")) {
        cover();
    }
    // check if there is a ticker
    if (typeof ticker != "undefined")
    	ticker();
    // check if there is a form to validate
    if ($.isFunction($("form").eq(0).validate) && $("#reset_password").length == 1)
    	validateNewPassword($("#reset_password"));
    // Check for a puff
    if (typeof puff != "undefined")
      puff();


	// Flowplayer
	try {
		function addOverlayAndPlayer() {
			$('body').append('<div id="overlay"><div id="closePlayer"></div><div id="player"></div></div>');
		};

		addOverlayAndPlayer();

		var player = $f("player", {src: 'http://media.agile42.com/content/flowplayer-3.2.1.swf', wmode: 'transparent'}, {
			clip: {	url: '' }
		});
		
		$("a[href*=.flv]").live('click', function(){
			$('#overlay').show();
			$f("player", {src: 'http://media.agile42.com/content/flowplayer-3.2.1.swf', wmode: 'transparent'}, {
				clip: {	url: $(this).attr('href') }
			});
			return false;
		});

		$('#overlay, #closePlayer').live('click', function(){
			$('#overlay, #closePlayer, #player').remove();
			addOverlayAndPlayer();
			$(this).hide();
		});
	} catch(e) {
		// console.log(e);
	}

	// Fancybox youtube
	var $link = $('a.youtube');
	if ($link.length != 0) {
		// Get the thumbnails from youtube
		$link.each(function(){
			var src = $.jYoutube($(this).attr('href'), 'small');
			$(this).append('<img src='+src+' />');
		});
		
		// Hook up the click event
		$link.click(function() {
			// http://www.youtube.com/watch?v=M-cIjPOJdFM&fs=1
			$.fancybox({
				'padding'		: 10,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'			: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
					'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});

			return false;
		});
	}
      
    // TryAgilo
    if ($("body").hasClass("agilo")) {
      tryAgilo();
    }
    
    // Activate media link files
    $('.media_file').media({ width: 720, height: 480, autoplay: false });
    
    // Bind the change event on the language select menu
    $('#id_language_select').change(function() {
        //window.location = '/cms/language/' + $(this).val();
        $(this).parent('form').submit();
    });
};