$(document).ready(function()
{
	if ($('#maestro').length == 1)
	{
		var animphase = function()
		{
			$('#maestro').animate(
			{
				opacity:($('#maestro').css('opacity') < 1) ? 1 : 0
			}, 800);
		};

		var maestro_anim = setInterval(animphase, 5000);

		$(window).blur(function() {
			clearInterval(maestro_anim);
			maestro_anim = null;
		});

		$(window).focus(function()
		{
			if (maestro_anim == null)
			{
				maestro_anim = setInterval(animphase, 5000);
			}
		});
	}
});
