//
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MasquerDiv(nom_div){
	var div = nom_div;
	document.getElementById('div_'+div).style.display = 'none';
}

function setproperty(div, value, initvalue){
	if(document.getElementById(div).style.fontSize == value+"px"){
		document.getElementById(div).style.fontSize = initvalue+"px";
	}else{
		document.getElementById(div).style.fontSize = value+"px";
	}
}

function confirmerSuppressionDossier(modId,dr,sd){
	if(confirm("Etes-vous sûr de vouloir supprimer ce dossier ?\nTous les fichiers présents dans ce dossier seront supprimés")){
	window.location="index.php?m="+modId+"&dr="+dr+"&sd="+sd+"&supprimerDossier";
	}
}

function confirmerSuppressionFichier(modId,dr,sd,fichier,div,typeAffichage){
	if(confirm("Etes-vous sûr de vouloir supprimer ce fichier ?")){
	window.location="index.php?m="+modId+"&dr="+dr+"&sd="+sd+"&fichier="+fichier+"&supprimerFichier&div="+div+"&af="+typeAffichage+"";
	}
}

function confirmerSuppression(modId,enrId,titre,rub){
	if(confirm("Etes-vous sûr de vouloir supprimer cet enregistrement ?")){
	window.location="index.php?"+modId+"&"+enrId+"&t="+titre+"&supprimer=true&div="+rub+"";
	}
}

function confirmerSuppression2(url,enrId,titre,rub){
	if(confirm("Etes-vous sûr de vouloir supprimer cet enregistrement ?")){
	window.location="index.php?"+url+"&"+enrId+"&t="+titre+"&supprimer=true&div="+rub+"";
	}
}

// coloriser champ lors d'un focus
function color_input(id){
	document.getElementById(id).style.backgroundColor = '#EBEBEB';
}
function no_color_input(id){
	document.getElementById(id).style.backgroundColor = '#FFFFFF';
}

// Afficher et masquer un div
function AfficherDiv(nom_div){
	var div = nom_div;
	document.getElementById('div_'+div).style.display = 'block';
}
function MasquerDiv(nom_div){
	var div = nom_div;
	document.getElementById('div_'+div).style.display = 'none';
}


// gestion des menus déroulant
window.onload=affiche_div;
function affiche_div(id){
	var div = document.getElementById('div_'+id);
	for (var i = 0; i<=100; i++) {
		if (document.getElementById('div_'+i)) {
		document.getElementById('div_'+i).style.display='none';
		}
	}
	if(div){
	document.getElementById('div_'+id).style.display='block';
	document.getElementById('div_'+id).style.marginBottom = '20px';
	}
}

function coloriserDt(div,color){
	document.getElementById('dt'+div).style.backgroundColor = color;
}

function coloriser(div){
	document.getElementById(div).style.backgroundColor = '#EBEBEB';
}
function divFondBlanc(div){
	document.getElementById(div).style.backgroundColor = '#FFFFFF';
}

/*window.onload=montre;
function montre(nameDD,id) {
var d = document.getElementById(nameDD+id);
	for (var i = 1; i<=100; i++) {
		if (document.getElementById(nameDD+i)) {
			//alert(nameDD+i);
			document.getElementById(nameDD+i).style.display='none';
		}
	}
	if(d){
		d.style.display='block';
	}
}
*/
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=25; i++) {
		if (document.getElementById('smenu'+i)) {
		document.getElementById('smenu'+i).style.display='none';
		}
	}
if (d) {d.style.display='block';}
}

function verifSelectFichier(){
	if(document.form1.image_a_copier.value == ''){
	alert("Sélectionner une image à enregistrer");
	return false;
	}else{
	return true;
	}
}

function progression(){
	document.getElementById("progression").style.display = 'block';
}

