function montre(info) {
 document.getElementById(info).style.zIndex=4;
}
function cache(info) {
 document.getElementById(info).style.zIndex=1;
}
function deroul(sub) {
 document.getElementById(sub).style.left='auto';
}
function enroul(sub) {
 submenu=document.getElementById(sub);
 if (submenu !=document.activeElement) submenu.style.left='-999em';
}
function flash(flasher) {
	//who=document.getElementById(flasher);//supprimer et mis en dur ci-dessous pour cette merde d'IE
	who=document.getElementById('toflash');
	if (who.style.visibility=='visible') who.style.visibility='hidden';
	else who.style.visibility='visible';
}
function stopflash(timer2) {
clearInterval(timer2);
document.getElementById('toflash').style.visibility='visible';
}
function repeatflash() {
a=setInterval(flash,150,'toflash');
//setTimeout(stopflash,1300,a);
setTimeout(function() {clearInterval(a);document.getElementById('toflash').style.visibility='visible';},1300);
}
//window.onload=function() {t=setInterval(flash,150,'toflash');setTimeout(stopflash,1300,t);}

var k=setInterval(repeatflash,8000);

window.onload=function() {repeatflash();}

function cachebt() {
 document.getElementById("subm").style.visibility="hidden";
}

function buttonLight(buttonID) {
	if ( buttonID == 'btcalc' ) {
		document.getElementById(buttonID).style.backgroundImage='url(images/boutons/NeonDh4.gif)'; 
		document.getElementById(buttonID).style.color = '#2B2B2B';
	}
	if ( buttonID == 'btclasst' ) {
		document.getElementById(buttonID).style.backgroundImage='url(images/boutons/competiteurover.png)'; 
		document.getElementById(buttonID).style.color = '#2B2B2B';
	}	
}

function buttonDark(buttonID) {
	if ( buttonID == 'btcalc' ) {
		document.getElementById(buttonID).style.backgroundImage='url(images/boutons/NeonDa4.gif)'; 
		document.getElementById(buttonID).style.color = '#f1f1f1';
	}
}

function swaptop() {
	idm='topmois'; ids='topsaison'; 
	if (document.getElementById(idm).style.display!='none') {
		document.getElementById(idm).style.display='none';
		document.getElementById(ids).style.display='block';
	}
	else {
		document.getElementById(ids).style.display='none';
		document.getElementById(idm).style.display='block';
	}
}
var j_on; var nivo_on; var num_on; var tabdefo=false;
function initcrit(tabl) {
j_on = tabl[1];
nivo_on = tabl[0];
num_on = tabl.substring(2);
}
function selectdiv(niveau, journee ,numtab) {
	if (tabdefo) oldid='x00'; else oldid = nivo_on + j_on + num_on;
	newid = niveau + journee + numtab; 
	if (niveau == 'n') {
		document.getElementById('j5').style.display='block';
		document.getElementById('j6').style.display='block';
	}
	else {
		document.getElementById('j5').style.display='none';
		document.getElementById('j6').style.display='none';
	}

	if ( !document.getElementById('res' + newid) ) {
		document.getElementById('res' + oldid).style.display='none';
		document.getElementById('xj').innerHTML = journee==1?journee+'<sup>ère</sup>':journee+'<sup>ème</sup>';
		document.getElementById('resx00').style.display='table';
		document.getElementById('bt' + oldid).className = 'btn';
		tabdefo = true;
		j_on = journee;
	}
	else if (document.getElementById('res' + newid).style.display != 'table') {
				document.getElementById('res' + oldid).style.display='none';
				document.getElementById('res' + newid).style.display='table';
				document.getElementById('bt' + oldid).className = 'btn';
				document.getElementById('bt' + newid).className = 'btnon';
				nivo_on = niveau;
				j_on = journee;
				num_on = numtab;
				tabdefo = false;
	} 
}
function swaptour(tour) {
	if ( document.getElementById('j' + tour).className == 'btj' ) {
		document.getElementById('j' + j_on).className = 'btj';
		document.getElementById('j' + tour).className = 'btjon';
		if (document.getElementById('btsn'+j_on)) document.getElementById('btsn'+j_on).style.display='none';
		if (document.getElementById('btsn'+tour)) document.getElementById('btsn'+tour).style.display='block';
		if (document.getElementById('btsz'+j_on)) document.getElementById('btsz'+j_on).style.display='none';
		if (document.getElementById('btsz'+tour)) document.getElementById('btsz'+tour).style.display='block';
		if (document.getElementById('btsr'+j_on)) document.getElementById('btsr'+j_on).style.display='none';
		if (document.getElementById('btsr'+tour)) document.getElementById('btsr'+tour).style.display='block';
		if (document.getElementById('btsd'+j_on)) document.getElementById('btsd'+j_on).style.display='none';
		if (document.getElementById('btsd'+tour)) document.getElementById('btsd'+tour).style.display='block';
		selectdiv(nivo_on, tour, num_on) ;
	}
}
function popimg(foto,galerie) {
	window.open('img2.php?foto='+foto+'&g='+galerie,'popfoto','toolbar=0,menubar=0,location=0,directories=0;status=0,scrollbars=1,width=1400,height=1000');
}
timer = setInterval(swaptop,5000);
/*
function patientez() {
	document.getElementById('ecran').innerHTML.value='...patientez.....';
}
*/

