var bSwitcherFree = true;
$(function()
{
	$('#albumsSwitcher').click(function(e)
	{
		e.preventDefault();
		if(bSwitcherFree)
		{
			bSwitcherFree = false;
			$("#videos").fadeOut('fast', function()
			{
				$('#albums').fadeIn('fast', function()
				{
					bSwitcherFree = true;
				});
			});
			$(this).addClass('albumsvideos_switcher_on');
			$("#videosSwitcher").removeClass('albumsvideos_switcher_on');
		}
	});
	
	$('#videosSwitcher').click(function(e)
	{
		e.preventDefault();
		if(bSwitcherFree)
		{
			bSwitcherFree = false;
			$("#albums").fadeOut('fast', function()
			{
				$('#videos').fadeIn('fast', function()
				{
					bSwitcherFree = true;
				});
			});
			$(this).addClass('albumsvideos_switcher_on');
			$("#albumsSwitcher").removeClass('albumsvideos_switcher_on');
		}
	});
	$('#videos').hide();
});

function cerrarVideo()
{
	$('#video param[name=movie]').attr('value', '');
	$('#video embed').attr('src', '');
	$('#video').hide();
	$('#cortina').fadeOut();
}

function verVideo(sId)
{
	var sMovieUrl =
		'http://www.youtube.com/v/' + sId + '&hl=es_ES&fs=1&color1=0x2b405b&color2=0x6b8ab6';
	$('#video param[name=movie]').attr('value', sMovieUrl);
	$('#video embed').attr('src', sMovieUrl);
	$('#cortina').sahExpand();
	$('#video').sahCenter().show();
}
