function rollOver(quel){
	path = eval("document.images."+quel)
	path.src = "../images/menu/"+quel+"_over.gif"
}

function rollOut(quel){
	path = eval("document.images."+quel)
	path.src = "../images/menu/"+quel+".gif"
}
function writeImg(path){
	switchMenu('pics')
	switchMenu('gal')
	e = document.getElementById('pics')
	e.innerHTML = "<a href='javascript:putback()'>[ Revenir aux photos ]</a> <br><br><br> <img src='"+path+"'>"
}
function putback(){
	switchMenu('pics')
	switchMenu('gal')
}
function switchMenu(which) {
 var el = document.getElementById(which);
 if ( el.style.display != "none" ) {
  el.style.display = 'none';
 }else {
  el.style.display = '';
 }
}
function aJournal(){
	if(document.ajouterJournal.contenu.value == ""){
		alert("Vous devez remplir le champ de contenu.")
		return false
	}
	if(document.ajouterJournal.contenu.value.length > 500){
		alert("Vous devez raccourcir le journal")
		return false
	}
	document.ajouterJournal.submit()
}
function checkFileExtension(){
	val = document.ajout.uploadedfile.value
	hasJpg = val.indexOf(".jpg")
	if(hasJpg>0){
		document.ajout.submit()	
	}else{
		alert("Votre image doit être en format JPEG (.jpg)")	
	}
}
function confirmSupprimeImg(path){
	answer = confirm("Voulez-vous vraiment supprimer cette image?");
	if(answer){
		window.location = "gestion.php?action=unlink&img="+path	
	}
}