function roll(file, id, id_bg, color)
{
	document.getElementById(id).src = file;
	document.getElementById(id_bg).style.backgroundColor = '#'+color;
}

//------------------ Config ---------------
	lang = new Array();
	lang[1]='fr';	
	lang[2]='nl';
	lang[3]='it';
	lang[4]='uk';
	
	var tmp_interval = 3;	//en seconde
//-----------------------------------------

//--------- Ini ---------------------------
	var n=1;
	var z_index = 9999;
	var nbr_lang= lang.length-1;
	var val_start = z_index - nbr_lang;
//-----------------------------------------


function changeImg(id) {
	loop(id);
	clearTimeout(t);
	n=id;
	t= setTimeout("start_bt();",tmp_click*1000);
}

function start_bt() {
	//alert (n);
	loop(n); n++;
	if (n == (nbr_lang+1)) n=1;
	if (z_index > val_start)
	{tmp_interv = 0; } else {tmp_interv = tmp_interval;}
	t= setTimeout("start_bt();",tmp_interv*1000)
}

function loop(id) {
	$("#" + lang[id]).fadeOut(1000, function() {
			$("#" + lang[id]).css("z-index", z_index--);
			$("#" + lang[id]).fadeIn();
  	});
}


function closeFlash(link)
{
	//window.location.href= link;
	document.getElementById('homeFlash').style.display = 'none';
}


var milisec=0 
var seconds=13

function display()
{ 
	
	if (seconds == 0)
	{
		clearTimeout(t);
		//window.location.href = location.href;
		document.getElementById('homeFlash').style.display = 'none';
	}
	
	if (milisec<=0)
	{ 
		milisec=9;
		seconds-=1;
	} 
	if (seconds<=-1)
	{ 
		milisec=0;
		seconds+=1;
	} 
	else
	{
		milisec-=1;
		document.getElementById('time').innerHTML = seconds;
		t = setTimeout("display();",100); 
	} 
}


