jQuery(function($) {
	
	Cufon.replace('.banner-box h2, h2.pagetitle, .main-entry h2');
	
	$('#navigation ul li').hover(
		function() {
			if($(this).find('ul').length > 0) {
				$(this).find('ul').show();
				$(this).addClass('hover');
			}
		},
		function() {
			if($(this).find('ul').length > 0) {
				$(this).find('ul').hide();
				$(this).removeClass('hover');
			}
		}	
	);
	
	var speed = 'slow';
	var interval = 10000;
	
	function change_logo() {
		var total = $('.logos-slider .logo').length;
		if (total < 2) {
			return;
		}
		var current = $('.logos-slider .logo').index($('.logos-slider .logo:visible'));
		if (current < total - 1) {
			current++;
		} else {
			current = 0;
		}
		$('.logos-slider .logo:visible').fadeOut(speed);
		$('.logos-slider .logo:eq(' + current + ')').fadeIn(speed);
		setTimeout(change_logo, interval);
	}
	
	$(window).load(function() {
		var h = 0;
		$('.logos-slider .logo').each(function() {
			if ($(this).height() > h) {
				h = $(this).height();
			}
		});
		
		$('.logos-slider').height(h);
		$('.logos-slider .logo').css({'display': 'none', 'visibility': 'visible'});
		$('.logos-slider .logo:eq(0)').fadeIn();
		setTimeout(change_logo, interval);
	});
	
});
