$(function() {
	// $.ajax({
		// url: "/snippets/random_header.php",
		// cache: false,
		// success: function(html){
			// $("#header").html(html);
			$('#header').cycle({ 
		        fx: 'fade', 
		        speed: 1000,
		        random: 1,
		        timeout: 5000
		    });
		// }
	// });
	
	$.ajax({
		url: "/snippets/logos.php",
		cache: false,
		success: function(html){
			$("#logos").html(html);
			
			var i = 0;
			var total = 0;
			$('#logos .logo').each(function() { total++; });
			var prev = 0;
			total--;
			
			$.timer(3000, function (timer) {
				prev = (i == 0) ? total : (i - 1);
				$('#logo' + prev).slideUp(200);
				$('#logo' + i).slideDown(200);
				i = (i == total) ? 0 : (i + 1);
			});
		}
	});

});
