function voirSelect(v)
{
	if(!window.Event)
	{
		oSelects = document.getElementsByTagName('SELECT'); 
		for (i = 0; i < oSelects.length; i++)
		{ 
			oSlt = oSelects[i]; 
			oSlt.style.visibility=v;
		}			
	}
}

function div_centree(id, largeur, hauteur)
{
	largeur = (document.body.clientWidth-largeur)/2;
	hauteur = ((document.body.clientHeight-hauteur)/2)+document.body.scrollTop;
	document.getElementById(id).style.top = hauteur;
	document.getElementById(id).style.left = largeur;
	voirSelect('hidden');
}


function aff_cache2(id)
{
	if(document.getElementById(id).style.visibility == "hidden")
		document.getElementById(id).style.visibility = "visible";
	else
		document.getElementById(id).style.visibility = "hidden";
}

function aff_cache(id)
{
	if(document.getElementById(id).style.display == "none")
		document.getElementById(id).style.display = "";
	else
		document.getElementById(id).style.display = "none";
}


function aff(id)
{
	if(document.getElementById(id).style.display == "none")
		document.getElementById(id).style.display = "";
}


function cache(id)
{
	if(document.getElementById(id).style.display == "")
		document.getElementById(id).style.display = "none";
}


function aff_cachepays(value)
{
	if(value == "1")
	{
		cache('div_pays');
		cache('div_pays2');
		cache('div_region');
		cache('div_region2');
	}
	else
	{
		aff('div_pays');
		aff('div_pays2');
		aff('div_region');
		aff('div_region2');
	}
}
function aff_cachepseudo(value)
{
	if(value == "1")
	{
		aff('div_pseudo');
		aff('div_pseudo2');
	}
	else
	{
		cache('div_pseudo');
		cache('div_pseudo2');
	}
}

function aff_cachedeptcommune(value)
{
	if(value == "1")
	{
		aff('div_naiss_departement');
		aff('div_naiss_departement2');
		aff('div_naiss_commune');
		aff('div_naiss_commune2');
	}
	else
	{
		cache('div_naiss_departement');
		cache('div_naiss_departement2');
		cache('div_naiss_commune');
		cache('div_naiss_commune2');
	}
}

function aff_cachehabdeptcommune(value)
{
	if(value == "1")
	{
		aff('parcours_1');
		/*aff('parcours_2');
		aff('parcours_3');*/
		aff('ajtparcours_1');
	}
	else
	{
		cache('parcours_1');
		cache('parcours_2');
		cache('parcours_3');
		cache('ajtparcours_1');
		cache('ajtparcours_2');
	}
}


//tout cocher / tout décocher
function cocher(Action)
{
	//Recherche de tous les inputs
	var listeInput = document.getElementsByTagName('input');			
	//On parcours la liste de tous les inputs
	for(var i = 0 ; i < listeInput.length ; i++){
		//On vérifie s'il s'agit d'une checkbox , si oui on la coche
		if(listeInput[i].type == "checkbox")
		{					
			if(Action==1){
				listeInput[i].checked = true;
			}else{
				listeInput[i].checked = false;
			}
		}
	}			
}

function tout_cocher(value)
{
	if(value)
		cocher(1);
	else
		cocher(0);
}

function choix_pays(value)
{
	if(value != "FR")
	{
		document.form.region.value = "";
		document.form.departement.value = "";
		document.form.commune.value = "";
	}
}