function AfficherCategorie(Categorie, SousCateg) {
	document.form.souscateg.value = SousCateg;
	switch (Categorie) {
		case 'A' :
			if (document.form.categorie.value == 'A' | document.form.categorie.value == 'B' | document.form.categorie.value == 'J') {
				document.form.page.value = 1;
			}
			document.form.action = "index.php";
			break;
		case 'B' :
			if (document.form.categorie.value == 'A' | document.form.categorie.value == 'B' | document.form.categorie.value == 'J') {
				document.form.page.value = 1;
			}
			document.form.action = "Biographie.php";
			break;
		case 'J' :
			if (document.form.categorie.value == 'A' | document.form.categorie.value == 'B' | document.form.categorie.value == 'J') {
				document.form.page.value = 1;
			}
			document.form.action = "Presse.php";
			break;
		case 'C' :
			document.form.action = "Calendrier.php";
			break;
		case 'O' :
			document.form.action = "Oeuvres.php";
			break;
		case 'P' :
			document.form.action = "Albums_Photos.php";
			break;
		case 'N' :
			document.form.action = "Contacts.php";
			break;
		case 'J' :
			document.form.action = "Jeux.php";
			break;
	}
	document.form.submit();
}

function Photos(ID) {
	document.form.idalbum.value = ID;
	document.form.action = "Photos.php";
	document.form.submit();
}
var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody(){
	return (document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ZoomPhoto(Photo, nomzoom, e){
/*	if (ie) {	
		crossobj=document.all.showimage
		alert(ietruebody().scrollLeft)
		var horzpos=ietruebody().scrollLeft+event.clientX
		var vertpos=ietruebody().scrollTop+event.clientY
	}
	else if (ns6) {
		crossobj=document.getElementById("showimage")
		var horzpos=pageXOffset+e.clientX
		var vertpos=pageYOffset+e.clientY
	}
	crossobj.style.left=horzpos+"px"
	crossobj.style.top=vertpos+"px"
	crossobj.innerHTML='<div align="right" id="dragbar" class="txt-bold"><span id="closetext" onClick="ClosePreview()">&raquo; Fermer</span></div><img src="'+Photo+'">'
	crossobj.style.visibility="visible"
	return false*/
	
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
/*		crossobj=document.getElementById("showimage")
		// ICI POUR REGLER LA POSITION DE LA LOUPE PAR RAPPORT A LA PAGE
		x=SourisAbs
		y=SourisOrd
		alert(x)
		alert(y)*/
/*		croosobj=document.images[nomzoom]
		crossobj.style.left=(screen.width/2-400)+"px"
		crossobj.style.top=(screen.height/2-200)+"px"*/
		
//		pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
//		horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
//		horzpos=ns6? pageXOffset+window.innerWidth/2-600/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-600/2
//		vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
//		vertpos=ns6? pgyoffset+window.innerHeight/2-600/2 : pgyoffset+ietruebody().clientHeight/2-600/2
//		if (window.opera && window.innerHeight) //compensate for Opera toolbar
//			vertpos=pgyoffset+window.innerHeight/2-imgheight/2
//			vertpos=pgyoffset+window.innerHeight/2-600/2
//			vertpos=Math.max(pgyoffset, vertpos)
//		}
//		else{
//			var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
horzpos=ietruebody().scrollLeft+(ietruebody().clientwidth/2)-330
//			var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
vertpos=ietruebody().scrollTop+(screen.height/2)-380
//		}
		crossobj.style.left=horzpos+"px"
		crossobj.style.top=vertpos+"px"
		
		crossobj.innerHTML='<div align="right" id="dragbar" class="txt-bold"><span id="closetext" onClick="ClosePreview()">&raquo; Fermer</span></div><p style="align:center vertical-align:middle"><img align="center" src="'+Photo+'">'
		crossobj.style.visibility="visible"
		return false
	}
	else //if NOT IE 4+ or NS 6+, affiche image ds le navigateur en pleine page
		return true
}

function ClosePreview(){
	crossobj.style.visibility="hidden"
}

function AfficherFlash() {
	document.form.action = "user/phpmysql_france_map.php"
	document.form.submit();
}

function ChangerCouleurPrincipal(CodeCouleur) {
	document.form.couleurprincipal.value = CodeCouleur;
	document.form.submit();
}

function ChangerCouleur(CodeCouleur) {
	document.form.couleur.value = CodeCouleur;
	document.form.submit();
}

function montre(sousmenu) {
	var d = document.getElementById(sousmenu);
	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 MoisSuivant() {
  if (document.form.mois.value == 12) {
	document.form.mois.value = 1;
	document.form.annee.value = parseInt(document.form.annee.value)+1;
  }
  else {
	document.form.mois.value = parseInt(document.form.mois.value)+1;
  }
  document.form.submit();
}

function MoisPrecedent() {
  if (document.form.mois.value == 1) {
	document.form.mois.value = 12;
	document.form.annee.value = parseInt(document.form.annee.value)-1;
  }
  else {
	document.form.mois.value = parseInt(document.form.mois.value)-1;
  }
  document.form.submit();
}

function FicheOeuvre(ID) {
	document.form.idoeuvre.value = ID;
	document.form.action = "Oeuvres_Fiche.php";
	document.form.submit();
}

function PageAllerA(page) {
	document.form.page.value = page;
	if (document.form.categorie.value == 'A') {
		document.form.action = "index.php";
	}
	else if (document.form.categorie.value == 'B') {
		document.form.action = "Biographie.php";
	}
	else {
		document.form.action = "Presse.php";
	}
	document.form.submit();
}

/////////////////////////////////////////////////////////////////
function Amelioration() {
	if (document.form.nomAmelioration.value == '') {
		alert("Vous devez saisir votre nom avant de cliquer sur Envoyer");
	}
	else if (document.form.mailAmelioration.value == '') {
		alert("Vous devez saisir votre adresse e-mail avant de cliquer sur Envoyer");	
	}
	else if (document.form.msgAmelioration.value == '') {
		alert("Vous devez saisir un message avant de cliquer sur Envoyer");
	}
	else {
		document.form.laction.value = "A";
		document.form.action = "Validation.php";
		document.form.submit();
	}
}

function ContactSylvie() {
	if (document.form.nomContactSylvie.value == '') {
		alert("Vous devez saisir votre nom avant de cliquer sur Envoyer");
	}
	else if (document.form.mailContactSylvie.value == '') {
		alert("Vous devez saisir votre adresse e-mail avant de cliquer sur Envoyer");	
	}
	else if (document.form.msgContactSylvie.value == '') {
		alert("Vous devez saisir un message avant de cliquer sur Envoyer");
	}
	else {
		document.form.laction.value = "C";
		document.form.action = "Validation.php";
		document.form.submit();
	}
}

function Inscription(etape, laction) {
	if (etape == 2) {
		//Vérification des informations saisies
		if (document.form.pseudo.value == '') {
			alert("Vous devez saisir le pseudonyme.");
			document.form.pseudo.focus();
			return false;
		}
		if (document.form.email.value == '') {
			alert("Vous devez saisir l'adresse e-mail.");
			document.form.email.focus();
			return false;
		}
		if (document.form.dep1.value == 0 & document.form.dep2.value == 0 & document.form.dep3.value == 0 & document.form.dep4.value == 0) {
			alert("Vous devez choisir au moins un département.");
			document.form.dep1.focus();
			return false;
		}
		if (document.form.motdepasse.value == '') {
			alert("Vous devez saisir le mot de passe.");
			document.form.motdepasse.focus();
			return false;
		}
		if (document.form.motdepasse2.value == '') {
			alert("Vous devez confirmer le mot de passe.");
			document.form.motdepasse2.focus();
			return false;
		}
		if (document.form.motdepasse.value != document.form.motdepasse2.value) {
			alert("Le mot de passe a mal été saisie. Veuillez le resaisir.");
			document.form.motdepasse.focus();
			return false;
		}
	}
	document.form.etape.value = etape;
	document.form.laction.value = laction;
	document.form.action = "Inscription.php";
	document.form.submit();
}

function InscriptionEmailExistant() {
	if (confirm("Un utilisateur utilisant cette adresse e-mail est déjà enregistré. Voulez-vous recevoir vos informations de connexion par e-mail ?")) {
		document.form.etape.value = 3;
		document.form.laction.value = "E";	//Email Existant
		document.form.action = "Inscription.php";
		document.form.submit();
	}
	else {
		AfficherCategorie('N', '');
	}
}

function SupprimerAbonne() {
	if (confirm("Votre compte va être supprimé. Vous ne recevrez plus d'e-mail d'actualité. Etes-vous sûr de vouloir supprimer votre compte ?")) {
		document.form.etape.value = 3;
		document.form.laction.value = "S";	//Email Existant
		document.form.action = "Inscription.php";
		document.form.submit();
	}
}

/////////////////////////////////////////////////////////////////
function WebMaster() {
	document.form.action = "WebMaster/WM_CopieArticles.php";
	document.form.submit();
}

//////////////////////////////////////////////////////////////////
