jQuery(function() {
	// Animate #tagline
	var tagline = $('#tagline');
	var taglineSpan = $(tagline).find('span');
	var height = $(tagline).height();
	$(taglineSpan).hide();
	$(tagline).height('0px');
	$(tagline).animate({ height: height }, 1000, function() { $(taglineSpan).fadeIn(); });

	var html = $('#banner').html();
	html = html.replace(/<p>/, '');
	html = html.replace(/<\/p>/, '');
	$('#banner').html(html);

	// Activate innerfade
	$('#banner').cycle({
		speed: 1500,
		timeout: 8000
	});
	
	/**
	 * Parents' notices
	 */
	$('#parents-notices ul').cycle({
		fx: 'scrollLeft',
		speed: 2500,
		timeout: 5000,
		fit: 1
	});
	
	$('#news-ticker ul').cycle({
		fx: 'scrollLeft',
		speed: 2000,
		timeout: 6000
	});

	// Activate thumbr
	$('#thumbnails').thumbr();

	$('#promo-boxes .promo-box').hover(
		function()
		{
			$(this).css('backgroundPosition', '0 -85px');
		},
		function()
		{
			$(this).css('backgroundPosition', '0 0');
		}
	);

	$('#promo-boxes .promo-box-small').hover(
		function()
		{
			$(this).css('backgroundPosition', '0 -64px');
		},
		function()
		{
			$(this).css('backgroundPosition', '0 0');
		}
	);

	// Drop-down nav
	$('#nav>ul>li>ul').css('display', 'none');
	$('#nav>ul>li').hover(
		function()
		{
			$(this).find('ul').css('display', 'block');
		},
		function()
		{
			$(this).find('ul').css('display', 'none');
		}
	);
	
	// Parent Noticeboard
	
	$('#parent-noticeboard ul').cycle({timeout:7000, sync:false, fx:'scrollDown', speed:'2000'});
	
});
