function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

function subUneFois(formulaire) {
  if (formulaire.elements['submit']  != null) {
    if (formulaire.elements['submit'].disabled) {
      return false;
    }
    formulaire.elements['submit'].disabled = true;
    formulaire.elements['submit'].value = 'Veuillez patienter';
  }
  return true;
}

function showHide(layer) { 
	if ((document.getElementById(layer).style.display.length == 1) || (document.getElementById(layer).style.display == "none"))
		document.getElementById(layer).style.display = "block";
	else
		document.getElementById(layer).style.display = "none" ;
}

function suppr_enr (page,id,titre) {
	var confirmation = confirm ( "Voulez vous vraiment supprimer " + titre + " ?" ) ;
	if (confirmation) {
		document.location.href = page+".php?id="+id ;
	}
}

function choix_img (img) {
	opener.document.ajoutNouvelle.image.value = img;
	window.close();
}

function add_user (user) {
	var txtAreLenght = opener.document.getElementById("dest").value;
	if (txtAreLenght == "") {
		opener.document.getElementById("dest").value += user;		
	}
	else {
		opener.document.getElementById("dest").value += "\n"+user;	
	}
	window.close();
}

function suppr_img (img) {
	var confirmation = confirm ( "Voulez vous vraiment supprimer "+img+" ?" ) ;
	if (confirmation) {
		document.location.href = "suppr-image.php?img="+img ;
	}
}

function popup(url) {
	window.open(url,'popup',
	'alwaysRaised=yes,toolbar=no,height=420,width=500,menubar=no,resizable=yes,scrollbars=yes,status=no');

}

function refreshDoc() {
	document.location.reload();
}

function makeItMain(table,id) {
	var XHR = new XHRConnection();
	XHR.sendAndLoad("makeItMain.php?table="+table+"&id="+id+"", "GET", refreshDoc);
	return true;
}

function enabledDisabled(action,table,id) {
	var XHR = new XHRConnection();
	XHR.sendAndLoad("../inc/enabledDisabled.php?action="+action+"&table="+table+"&id="+id+"", "GET", refreshDoc);
	return true;
}












