function explication(zone,jeu) {
         switch(jeu) {
         //case 0 : txt_titre = "Explications"; 
         //txt_explication = "passez votre curseur sur les vignettes pour plus de détails.";
         //break;
         case 2 : txt_titre = "Text Rush";
         txt_explication = "Forme des mots grâce à la série de lettres présentée.";
         txt_type = "jeu de lettres";
         break;
         case 6 : txt_titre = "Big Quake City";
         txt_explication = "Nettoie les villes de l'Ouest accompagné de ton cousin Billy.";
         txt_type = "jeu de shoot";
         break;
         case 3 : txt_titre = "El Bomba";
         txt_explication = "Attrape un maximum de fioles avant qu'elles n'explosent !";
         txt_type = "jeu de plateformes";
         break;
         case 4 : txt_titre = "West Gold";
         txt_explication = "Trois symboles identiques et tu gagnes des points ou une <b>partie gratuite</b> !";
         txt_type = "jeu de grattage";
         break;
         case 8 : txt_titre = "Stone Table";
         txt_explication = "Ouvre la porte des marais en remplissant cette grille de chiffres";
         txt_type = "Chiffres - Sudoku";
         break;
         case 1 : txt_titre = "Magic Rune";
         txt_explication = "Teste tes connaissances en répondant aux questions du magicien";
         txt_type = "Quizz";
         break;
         case 7 : txt_titre = "Dungeon Escape";
         txt_explication = "Sors du donjon en évitant ses pièges et ses gardes";
         txt_type = "jeu de réflexion - action";
         break;
         case 5 : txt_titre = "Dragon's Eggs";
         txt_explication = "Un dragon a temporairement laissé ses oeufs sans surveillance... Profites-en !";
         txt_type = "jeu de grattage";
         break;
         case 12 : txt_titre = "La Forge Okado";
         txt_explication = "Découvre un anneau magique et gagne jusqu'à 10.000pts";
         txt_type = "jeu de grattage payant => 2000pts jeu";
         break;
         case 11 : txt_titre = "The Cannon Duel";
         txt_explication = "Affronte Jackson le Doux dans un duel au canon sans pitié !";
         txt_type = "Action - Réflexion";
         break;
         case 9 : txt_titre = "Forgotten Treasure";
         txt_explication = "Ouvre le coffre et gagne des points ou des <b>parties gratuites</b> !";
         txt_type = "Hazard";
         break;
         case 15 : txt_titre = "Voodoojongg";
         txt_explication = "Supprime toutes les tuiles de la table dans un temps limité";
         txt_type = "Réflexion - Mahjongg";
         break;
         case 13 : txt_titre = "Le Gratoboom";
         txt_explication = "Trouve trois fois le même bijoux et gagne jusque 5000pts";
         txt_type = "jeu de grattage payant => 1000pts jeu";
         break;
         case 14 : txt_titre = "Arbre à Kadabra !!!";
         txt_explication = "Ramasse les fruits ou le cadeau qui tombent de l'abracadabra !";
         txt_type = "jeu pack => Un pack acheté = une partie (cadeaux à gagner !)";
         break;
				 case 16 : txt_titre = "Le Cimetière des Damnés";
				 txt_explication = "Découvre les pentacles sur les tombes des damnés.";
				 txt_type = "jeu de grattage.";
				 break;
				 case 17 : txt_titre = "La Fièvre de l'Or";
				 txt_explication = "Trouve au moins trois pépites d'or et gagne jusqu'à 2500pts";
				 txt_type = "jeu de grattage payant => 500pts jeu";
				 break;
				 case 18 : txt_titre = "La Potion Perdue";
				 txt_explication = "Aide la sorcière à retrouver la formule de sa potion...";
				 txt_type = "réflexion";
				 break;
				 case 19 : txt_titre = "Boubouls";
				 txt_explication = "Inverse les Boubouls afin de créer des combinaisons de couleurs";
				 txt_type = "Puzzle";
				 break;
				 case 21 : txt_titre = "Vampire";
				 txt_explication = "Gratte et découvre une ligne de 3 fioles de sang !";
				 txt_type = "Grattage";
				 break;
				 case 22 : txt_titre = "Evil Blocs";
				 txt_explication = "Des blocs maléfiques prennent le contrôle des arbres !";
				 txt_type = "Puzzle";
				 break;
				 case 23 : txt_titre = "Puzzle Quest";
				 txt_explication = "Sauve la princesse des griffes du magicien !!!!";
				 txt_type = "Puzzle";
				 break;
				 case 25 : txt_titre = "Fear Cave";
				 txt_explication = "Assemble autant de pièces de même couleur que possible !";
				 txt_type = "Puzzle";
				 break;
				 case 27 : txt_titre = "Yaka Math";
				 txt_explication = "Yaka Compter!";
				 txt_type = "Chiffres";
				 break;
				 case 29 : txt_titre = "The Factory";
				 txt_explication = "Fais exploser les fioles de mauvaise couleur !";
				 txt_type = "Lettres";
				 break;
				 case 32 : txt_titre = "Bijouxe";
				 txt_explication = "Trouvez un max de combinaisons avant que la pièce ne soie remplie d'eau !";
				 txt_type = "Puzzle";
				 break;
				 case 33 : txt_titre = "Big Quake City 2";
				 txt_explication = "Nettoie les villes de l'Ouest dans ce jeu de shoot";
				 txt_type = "Shoot";
				 break;
				 case 34 : txt_titre = "Crazy Ball";
				 txt_explication = "Dans ce casse-briques, essaie de garder le boulet hors du vortex !";
				 txt_type = "Casse-briques";
				 break;
         }
         switch(zone) {
         case 1 : div_explication = "exp_cowboy";
         break;
         case 2 : div_explication = "exp_medievale";
         break;
         case 3 : div_explication = "exp_pirate";
         break;
				 case 4 : div_explication = "exp_horreur";
				 break;
				 case 5 : div_explication = "exp_vip";
				 break;
         }

  
  tableau_explications =   "<table>\n" + 
    "<tr>\n" + 
    "<td valign=\"top\"><b>"+txt_titre+"</b> :</td>\n" + 
    "<td>"+txt_explication+"</td>\n" + 
    "</tr>\n" + 
    //"<tr>\n" + 
    //"<td><b>Type<\/b> :<\/td>\n" + 
    //"<td>"+txt_type+"<\/td>\n" + 
    //"<\/tr>\n" + 
    "<\/table>";
  
  
  document.getElementById(div_explication).innerHTML = tableau_explications;
}

function closeDiv(div) 
{
	nb++;
	if (nb < totalDivNb)
	{
		var obj = document.getElementById("div_"+div); 
		obj.className="overDived";
		var which = parseInt(div) + 1;
		var obj2Open = document.getElementById("div_"+which); 
		obj2Open.className="overDiv";
	} else {
		goNow();
	}
}
//////////////////////////////////
function time() 
{
	window.setTimeout("time()",2000);+1
	today = new Date();
	self.status = today.toLocaleString(); 
}

//actions confirme
function suppr(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=del';
	}
}

function generateFile(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=generate';
	}
}

function generateResult(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=generateResult';
	}
}

function cacheFile(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=caching';
	}
}

function subsuppr(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=subdel';
	}
}
function modif(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=modif';
	}
}
function active(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=show';
	}
}

function desactive(cc, id, section, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&action=hide';
	}
}
function valid(cc, id, section, comment, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&com=' + comment + '&action=valid';
	}
}
function unvalid(cc, id, section, comment, legend)
{
	if(confirm(legend))
	{
		window.location = '?cc=' + cc + '&id=' + id + '&num=' + section + '&com=' + comment + '&action=unvalid';
	}
}

function backNoSave(cc, id, legend)
{
	if(confirm(legend))
	{
		//window.location = '?cc=' + cc + '&id=' + id ; => Car si page existe pas (virtuelle, erreur => test?)
		history.back(1);
	}
}

//Fcts smiley
function smiley(smiley_n)
{
	if (!document[nomForm].infoF.disabled)    
		document[nomForm].infoF.value += smiley_n + " ";
}

//Fcts genre => info
function enableFiche(cat)
{
		document[nomForm].infoF.disabled = false;
	    switch(cat){
			case 0:
				document[nomForm].infoF.disabled = true;
				break;
			case 1:
				//texte spécifique à rajouter
				break;			
		}
}

// Fcts Add options to select
nomForm = "form1"; 
function selectGenre(cat)
{
	clear_mnu('genreF'); 
	
	b = new Array(); 
    i = 0; 
	// Creation du menu 
    if (cat != 0) {create_mnu('genreF',cat);}
}

function opt(txt, val)
{     
    // mise en tableau des objet Option 
    b[i] = new Option(txt, val); 
    i++; 
} 

function clear_mnu(nomMenu)
{ 
    for(j=document[nomForm][nomMenu].length; j >= 0; j--){ 
        // on efface les objets Option 
        document[nomForm][nomMenu].options[j] = null; 
    } 
	document[nomForm][nomMenu].disabled = true;
	document[nomForm].infoF.disabled = true;
} 

function create_mnu(nomMenu,cat)
{ 
    for(k=0; k < genreval[cat].length; k++){ 
        // on applique au menu select les objets Option contenu dans l'array a 
        document[nomForm][nomMenu].options[k] = genreval[cat][k]; 
    } 
	document[nomForm][nomMenu].disabled = false;    
} 


//Fcts impression
function bonlivraisonCado(cc,id,section,legend,param)
{
	var id_checked = document.getElementById('whichSelected').value;
	page = 'print.php?cc=Print/Livraison&id_checked='+ id_checked;
	
	window.open(page);
	return false;
	/*if(confirm(legend))
	{
		page = 'print.php?cc=Print/Livraison&id_checked='+ id_checked;
		//void MM_openBrWindow(page,'print','width=700,resizable=1,toolbar=1,directories=0,scrollbars=1,status=0,screenX=0,screenY=0,top=0,left=0','1');
		
	}*/
}

function etiquetteCado(cc,id,section,legend,param)
{
	var id_checked = document.getElementById('whichSelected').value;
	
	if(confirm(legend))
	{
		void MM_openBrWindow('print.php?cc=Print/EtiquetteLivraison&id_checked='+ id_checked,'print','width=700,resizable=1,toolbar=0,directories=0,scrollbars=1,status=0,screenX=0,screenY=0,top=0,left=0','1');
	}
}

//Fcts images
function uploaderImage(nomAncre,where,id, dir, height, width, theight, twidth)
{
	void MM_openBrWindow('Picindex.php?formfield='+ nomAncre +'&link='+ where + '&id='+ id + '&dir='+ dir + '&height='+ height + '&width='+ width + '&twidth='+ twidth + '&theight='+ theight,'upload','width=600,height=480,resizable=1,toolbar=0,directories=0,scrollbars=1,status=0,screenX=0,screenY=0,top=0,left=0','1');
}

function setItem(itemField, itemValue)
{
  var oSel = document.getElementById('uploadImField');
  //si menu déroulant alors, il faut activer ces lignes
  //var oOpt = new Option(itemValue,itemValue,false,true);
  //var oIdx = oSel.options.length;
  //oSel.options[oIdx] = oOpt;
  //oSel.selectedIndex = oIdx;
 oSel.value=itemValue;

  setImageSrc(itemField, itemValue);
}

function setImageSrc(imgField, imgFile)
{
  var imgId = imgField.replace(/^(formvars|new)/i, "img");
  var oImg = document.getElementById(imgId);
 if (oImg != null) {
    var oSrc = oImg.src;
	//alert (oSrc);
	oSrc = oSrc.substring(0,oSrc.lastIndexOf("/")+1);
	//alert (oSrc);
	//alert (oImg.src);
    //oImg.src = oSrc.replace(/(\/divx\/upload\/.*\/)([^\/]+)(\/?)$/i, "$1"+imgFile);
	oImg.src=oSrc+imgFile;
	//alert (oImg.src);
  }
}


//Fcts preview
function preview(formu,which,action)
{
	formu.action = 'preview.php?template='+which;
	formu.target = '_blank';
	formu.submit();
	//rechange l'action du form
	formu.action = action ;
	formu.target = '_self';
}

//Fcts agrandissement
function pop_agrandissement(image,width,height)
{
	finalHeight= parseInt(height)+20;
	finalWidth= parseInt(width)+20;
	void MM_openBrWindow('http://www.recreagame.com/images/Shop/'+ image +'','zoom','width='+ finalWidth +',height='+ finalHeight +',resizable=1,toolbar=0,directories=0,scrollbars=0,status=0,screenX=0,screenY=0','1');
}

//Fcts images
function show_comments(num,type)
{
	void MM_openBrWindow('http://www.divxovore.com/Newmail/Comments.php?num='+ num +'&type='+ type +'','comments','width=600,height=480,resizable=1,toolbar=0,directories=0,scrollbars=1,status=0,screenX=0,screenY=0,top=0,left=0','1');
}
function dead_link(num,type)
{
	if (confirm("Attention: si vous utilisez un autre programme que eMule ou eDonkey, ce lien peut vous paraître mort.\n Pour le récupérer dans ce cas:\n - Sous IE: faites clic droit, \'Copier le raccourci\'... \n - Sous Mozilla: faites clic droit, \'Propriété\' et copier le lien depuis \'Propriété du lien\'...\n ...Enfin, collez le lien dans votre programme P2P fonctionnant avec les liens \'ed2k\'.\n Vous pouvez consulter les FAQ sur ce site pour plus d'information.\n\n Malgré ces procédures, le lien vous paraît-il toujours mort?"))
	{
		void MM_openBrWindow('http://www.divxovore.com/Newmail/Deadlink.php?num='+ num +'&type='+ type +'','deadlink','width=1,height=1,resizable=0,toolbar=0,directories=0,scrollbars=1,status=0,screenX=0,screenY=0,top=0,left=0','1');
	}
}
function post_contact(num,type)
{
	window.location = 'http://www.divxovore.com/index2.php?cc=Form&num=' + num + '&type=' + type + '';
}

function changeGenre(cat,genre)
{
	window.location = 'index.php?cc=' + cat + '-' + genre +'-1';
}
function changeGenreX(cat,genre)
{
	window.location = 'index2.php?cc=' + cat + '-' + genre +'-1';
}
function changeCat(cat,nb)
{
	window.location = 'index.php?cc=Latest--' + nb;
}

//Fcts pop-up
Array.prototype.contient = function(valeur) { 
 var val=new RegExp("[=]+", "g");
 for (var i in this) {
	 if (i == (this.length)-1) {break;}
   var tablVal = this[i].split(val); //Sépare le paramètre de sa valeur
   if (tablVal[0] == valeur) 
   {
	  //alert (tablVal[0]+"="+valeur+": "+tablVal[1]);
	   return tablVal[1];
   }
 }
 return false;
}

function open_reglement()
{
		window.location = '?cc=rules';
		//MM_openBrWindow('http://www.recreagame.com/files/rules.php','rules','resizable=0,toolbar=0,directories=0,scrollbars=1,status=0',1); 

}

function open_policy()
{
	//MM_openBrWindow('http://www.recreagame.com/files/policy.php','policy','resizable=0,toolbar=0,directories=0,scrollbars=1,status=0',1); 
	 window.location = '?cc=policy' ;
	
}

function MM_openBrWindow(theURL,winName,features,returni) 
{ //v3.0
  var popwin;
  var reg=new RegExp("[,]+", "g");
  var tableau=features.split(reg);
  
  if (!tableau.contient('width')) { width = 600; features +=',width='+width;} else { width = tableau.contient('width');}//Default value for width
  if (!tableau.contient('height')) { height = 600; features +=',height='+height;} else { height = tableau.contient('height');}//Default value for height
  if (!tableau.contient('left')) { features +=',left=' + Math.round((screen.width-width)/2);} //Default value for left
  if (!tableau.contient('top')) { features +=',top=' + Math.round((screen.width-height)/2);} //Default value for left 
  if (tableau.contient('scrollbars')){
	  features +=',scrollbars=yes';
 }

  popwin=window.open(theURL,winName,features);
  if (popwin != null) {
        popwin.opener=self;
        popwin.focus();
    } else {
        alert("Impossible d\'ouvrir une pop-up. Si vous avez un bloqueur de pop-up installé, veuillez les autoriser sur ce site.");
    }
	
	if (returni==1)
	{
		return false;
	}
}

//Menu déroulant avec ajout possible
var openDiv = "";
var whichClassNameII = "divVisible";
function showList(obj,field) {
	var what = document.getElementById(obj);
	var where = document.getElementById(field);	
	//On ferme ce qui est ouvert...si ce n'est la fenêtre sur laquelle on travaille
	if (openDiv != "" && (openDiv != what || where.value.length != 0))
	{
		openDiv.className = "divInvisible";
		openDiv = "";
	}
	
	//On doit ouvrir?
	if (what.className == "divInvisible" && where.value.length == 0)
	{
		what.className = whichClassNameII ;
		openDiv = what;
		el =  where.offsetLeft;
		//et =  where.offsetTop;
		what.style.left = (el-5)+"px";
		//what.style.top = et+"px";
		what.style.top = "21px";
	} 
}

function selectList(obj,container,field) {
	var what = document.getElementById(obj);	
	var where = document.getElementById(field);	
	where.value = what.options[what.selectedIndex].value;
	showList(container,field); //Ferme le menu
}

function safeReturn (){
	var what = document.getElementById("gamer");
	what.submit();
}

function UnderMaintenance() {
	alert("Cette section est actuellement indisponible.\nMerci de votre compréhension.");
}

//
// Fonction utilisée pour indiquer que le chargement du jeu est oK et que la partie a été créditée
function setScoreHereTo0(){
		
		// on modifie la valeur de l'input scoreHere de -1 -> 0
		document.forms["gamer"].elements["scoreHere"].value = 0;
		
		// on enleve le bouton 'Retour au jeux'
		document.getElementById('AllowBack').className="overDivedInto";
}

//
// Fonction invoquée lorsque une connexion au fichier setInPlay a echouée
function errConnGoBack(){
		var where = document.getElementById('gamer');
		if (subm != 0)
		{
			document.gamer.action='?cc=bugSavePts'
			where.submit();
		}
}

//
// Fonction
function getScoreError(subm, score, returnL, descent, key){
		
		var where = document.getElementById('gamer');
		
		if (subm != 0)
		{
			//
			//On modifie les champs du formulaire
			document.forms["gamer"].elements["scoreHere"].value = score;
			document.forms["gamer"].elements["returnL"].value 	= returnL;
			document.forms["gamer"].elements["descent"].value	= descent;
			document.forms["gamer"].elements["key"].value		= key;
			
			document.gamer.action='?cc=bugSavePts';
			where.submit();
		}else{
			// probleme de connexion au fichier setInPLay
			// il va donc pe falloir reattribuer une partie au joueur qui n'a pas su joué
			// cela se fera dans le fichier authentified.inc.php
			where.submit();
		}
}

//Check number only
function checkSpelling(champ, pointHere) 
{
	var verif;
	var points = 0; /* Supprimer cette ligne si pas de point */
	if (pointHere) 
	{ //Plage autorisée
		var chiffres = new RegExp("[0-9\.]"); 
	} else {
		var chiffres = new RegExp("[0-9]"); 
	}

	for(x = 0; x < champ.value.length; x++)
	{
		verif = chiffres.test(champ.value.charAt(x));
		if (pointHere) 
		{ //Plage autorisée
			if(champ.value.charAt(x) == "."){points++;}
			if(points > 1){verif = false; points = 1;}
		}
		if(verif == false){champ.value = champ.value.substr(0,x) + champ.value.substr(x+1,champ.value.length-x+1); x--;}
	}
}

//ShowHide
var openModifDiv = "";
var whichClassName = "divInvisible"; //invisible
var whichClassNameII = "divVisible"; //visible

function showHide(which){
	if (openModifDiv != "")
	{
		openModifDiv.className = whichClassName;
		openModifDiv = "";
	}
	
	if (which != "")
	{
		var what = document.getElementById('HiddenDiv_'+which);
		what.className = whichClassNameII ;
		openModifDiv = what;
	}
}