function SendToAFriend(Video)
{
	window.open('envoyer-a-un-ami-' + Video + '.html', 'popup', 'location=1,directories=1,scrollbars=1,resizable=1,menuBar=1,width=500,height=300');
}

var current=1;
var currentImg=null;
var currentId;
var timerThumb=null;
var imageList=null;

function updateThumb(count, main)
{
	if(currentImg == null)
		return;
	
	currentImg.src = imageList[current].src;
	current ++;
	current %= count;
}

function startThumb(img, id, count)
{
	if(currentImg != null)
		return;
		
	imageList = new Array();

	var i;
	for(i = 0; i < count; i++)
	{
		var sImg = new Image();
		sImg.src = "thumbs/" + id + "/" + (i + 1) + ".jpg";
		imageList[i] = sImg;
	}

	currentImg = img;
	currentId = id;
	if(timerThumb!=null)
		clearInterval(timerThumb);
	timerThumb = setInterval("updateThumb(" + count + ")", 500);
}

function stopThumb(id)
{
	clearInterval(timerThumb);
	timerThumb=null;
	current=1;
	currentImg.src="thumbs/" + currentId + "/" + id + ".jpg";
	currentImg=null;
}

