function attente(url,duree) {
	window.setTimeout("go('"+url+"')",duree);
}

function verifEven() {
	var heure = window.document.even.heure.value;
	var description = window.document.even.contenu.value;
	if(heure<0 || heure>=24) {
		window.alert("L'heure est invalide.");
		return false;
	}
	if(heure=="" || description=="") {
		window.alert("Champs Manquants");
		return false;
	}
	else {
		return true;
	}
}


function verifEdition() {
	var titre = window.document.forms[0].titre.value;
	if(titre=="") {
		window.alert("Vous devez entrer un titre.");
		window.document.forms[0].titre.focus();
		return false;
	}
	else {
		return true;
	}
}

function go(url) {
	document.location=url
}

function confirmation(texte, url) {
	if(confirm(texte)) go(url);
}


function confSuppr(url) {
	confirmation("Voulez-vraiment supprimer cet élément ?", url);
}

function confArchiver(url) {
	confirmation("Voulez-vraiment archiver cette news ?", url);
}

function confAutoriser(url){
	confirmation("Voulez-vous vraiment autoriser ce commentaire?",url);
}

function confDesarchiver(url) {
	confirmation("Voulez-vraiment désarchiver cette news ?", url);
}

function popup(url, texte) {
	window.open(url,texte, 'top=50, left=100, screenY=50, screenX=100, width=700, height=600, resizable=0, scrollbars=1');
}

var etat = true;
function afficherParcourir(nomVar) {
	if(etat) {
		document.getElementById("parcourir").innerHTML = '<input type="hidden" name="modifFichier" value="true"><input type="hidden" name="MAX_FILE_SIZE" value="10000000" /><input type="file" value="parcourir" name="'+nomVar+'" />';
		etat=false;
	}
	else {
		document.getElementById("parcourir").innerHTML = '';
		etat=true;
	}
}

function closePopup(){
	self.close(); 
}

function pageSuivante(url, page, lastPage){
	nextPage=page+1;
	if (nextPage<=lastPage){
		go(url+nextPage);
	}
}
function pagePrecedente(url, page, lastPage){
	pageBefore=page-1;
	if (pageBefore>=1){
		go(url+pageBefore);
	}
}
