/* MENU TABS */

function tabRollOver(tab)
{
	if ($(tab).style.left != '-212px')
	{
		$(tab).style.left = '-106px';
		$(tab + '_text').style.color = '#ffffff';
	}
}

function tabRollOut(tab)
{
	if ($(tab).style.left != '-212px')
	{
		$(tab).style.left = '0px';
		$(tab + '_text').style.color = '#969696';
	}
}

function tabClick(tab, index)
{
	for (i = 0; i <= 2; i++)
	{
		$(tab + i).style.left = '0px';
		if (index != i)
			$(tab + i + '_text').style.color = '#969696';
	}
	
	if (0 <= index && index <= 2)
	{
		$(tab + index).style.left = '-212px';
		/*$(tab + index + '_text').style.color = '#747474';*/
	}
}

/* MEDIA NAVIGATOR'S ARROWS */

function arrowRollOver(tab)
{
	$(tab).style.top = '-114px';
	/*mediaBackgroundRollOut();*/
}

function arrowRollOut(tab)
{
	$(tab).style.top = '0px';
}

/* ENVOYER A UN AMI */

function envoyerRollOver(tab)
{
	$(tab).style.top = '-10px';
}

function envoyerRollOut(tab)
{
	$(tab).style.top = '0px';
}

/* BLOGGER PICTO */

var bloggerRoll = true;

function bloggerRollOver(tab)
{
	$(tab).style.top = '-18px';

	if (bloggerRoll)
	{
		$('media_details_blogger_infobulle').style.display = 'inline';
		setTimeout('HideBloggerTooltip()', 2000);
	}
}

function bloggerRollOut(tab)
{
	$(tab).style.top = '0px';
	HideBloggerTooltip();
	bloggerRoll = true;
}

function HideBloggerTooltip()
{
	$('media_details_blogger_infobulle').style.display = 'none';
	bloggerRoll = false;
}

/* BLOGGER POPUP */

function close_blogger()
{
	$('blogger_container').style.display = 'none';
}

function click_blogger()
{
	bloggerRollOut('media_details_blogger');
	$('blogger_container').style.display = ($('blogger_container').style.display == 'inline' ? 'none' : 'inline');
}

/* SEARCH FORM */

function searchButtonRollOver()
{
	$('search_input_button').style.left = "-25px";
}

function searchButtonRollOut()
{
	$('search_input_button').style.left = "0px";
}

/* VOTE */

function starOffRollOver(index)
{
	var i = 0;
	while (i <= index)
	{
		$('vote_star_' + i).style.left = '-30px';
		i++;
	}
	while (i < 5)
	{
		$('vote_star_' + i).style.left = '-20px';
		i++;
	}

	$('vote_note').value = (index+1) * 20;
}

function starOffRollOut(score)
{
	digits = score;
	while (digits >= 1)
		digits--;

	var i = 0;
	while (i < Math.floor(score))
	{
		$('vote_star_' + i).style.left = '0px';
		i++;
	}
	if (digits > 0.5)
	{
		$('vote_star_' + i).style.left = '-10px';
		i++;
	}
	while (i < 5)
	{
		$('vote_star_' + i).style.left = '-20px';
		i++;
	}

	$('vote_note').value = 0;
}

