
$(document).ready(function(){
	$('#sonido').toggle(
        function(){
        	$(this).attr('src', 'img/sonido_off.png');
		},
		function(){
            $(this).attr('src', 'img/sonido_on.png');
        }
    );

    $('#entrar').hover(altIntroAzul, altIntroGris);
});

function altIntroAzul()
{
    $(this).attr('src', 'img/saltar_intro_azul.jpg');
}

function altIntroGris()
{
    $(this).attr('src', 'img/saltar_intro_gris.jpg');
}

function finintro()
{
    //$('#entrar').unbind('mouseover', altIntroAzul).unbind('mouseout', altIntroGris).fadeOut("slow", mostrarEntrar);
	$('#entrar').unbind('mouseover', altIntroAzul).unbind('mouseout', altIntroGris).attr('src', 'img/entrar_gris.jpg').hover(function(){
	        $(this).attr('src', 'img/entrar_azul.jpg');
	    }, function(){
	        $(this).attr('src', 'img/entrar_gris.jpg')
		});
}

function mostrarEntrar()
{
    $('#entrar').attr('src', 'img/entrar_azul.jpg').fadeIn('slow', blinkEntrar);
}

function blinkEntrar()
{
    var blinkCount = 2 * 2;		// two blinks, 4*2 for four blinks
	do
	{
        if(blinkCount<=1)
		{
            $('#entrar')['fade' + (blinkCount % 2 == 0 ? 'Out' : 'In')]('slow').fadeOut('slow', mostrarEntrarGris);
        }
		else
		{
			$('#entrar')['fade' + (blinkCount % 2 == 0 ? 'Out' : 'In')]('slow');
		}
	} while (--blinkCount);
}

function mostrarEntrarGris()
{
    $('#entrar').attr('src', 'img/entrar_gris.jpg').fadeIn('slow', addhoverEntrar);
}

function addhoverEntrar()
{
    $('#entrar').hover(function(){
        $(this).attr('src', 'img/entrar_azul.jpg');
    }, function(){
        $(this).attr('src', 'img/entrar_gris.jpg')
	});
}







