<!--
var kMaxCat;
var kMaxJeuxCat;
kMaxCat = 9;      // nombre max de categories
kMaxJeuxCat = 15; // nombre de jeux max par categorie
kMaxJeuxCatAdd = 6; // nombre de jeux max par categorie additionnelles

var infoJeux;
var imgVide;

function SetJeuxInfo( isActive, dir, infoJeux, imgLabel, url, isJava, isJavascript) {
  if (url=="") { url="index_"+lang+".html"; }
  this.isActive = isActive;
  if (isActive) {
    //this.name = imgLabel;
    this.imgLabel = "./design/" + lang + "_lab_" + imgLabel + ".gif";
    this.imgJeux = dir + infoJeux;
    this.url = dir + url;
  } else {
    //this.name = "";
    this.imgLabel = "./design/" + lang + "_lab_vide.gif";
    this.imgJeux = "./design/null.gif";
    this.url = "http://interJEUX.net";
  }
  this.isJava = isJava;
  this.isJavascript = isJavascript;
}
function JeuxInfo( isActive, dir, infoJeux, imgLabel, url, isJava, isJavascript) {
  if (url=="") { url="index_"+lang+".html"; }
  this.isActive = isActive;
  if (isActive) {
    //this.name = imgLabel;
    this.imgLabel = "./design/" + lang + "_lab_" + imgLabel + ".gif";
    this.imgJeux = dir + infoJeux;
    this.url = dir + url;
  } else {
    //this.name = "";
    this.imgLabel = "./design/" + lang + "_lab_vide.gif";
    this.imgJeux = "./design/null.gif";
    this.url = "http://interJEUX.net";
  }
  this.isJava = isJava;
  this.isJavascript = isJavascript;
//  SetJeuxInfo( isActive, dir, infoJeux, imgLabel, url, isJava, isJavascript);
  this.SetJeuxInfo = SetJeuxInfo;
}

function Init_Cat() {
  // une image vide, pour les labels et les jeux inactifs
  imgVide = new Image(1,1);
  imgVide.src = "./design/null.gif";
  // les informations des jeux
  infoJeux = new Array( kMaxCat);
  for (var i=0; i<kMaxCat; i++) {
    infoJeux[i] = new Array( kMaxJeuxCat);
    for (var j=0; j<kMaxJeuxCat; j++) {
      infoJeux[i][j] = new JeuxInfo( false, "", "", "", "", false, true);
    }
  }
  // reflexion
  infoJeux[0][0].SetJeuxInfo( true, "./jeux/mastermind/", "mastermind.jpg", "mastermind", "", false, true);
  infoJeux[0][1].SetJeuxInfo( true, "./jeux/mastermind/", "smastermind.jpg", "smastermind", "choix_index_"+lang+".html", false, true);
  infoJeux[0][2].SetJeuxInfo( true, "./jeux/solitaire/", "solitaire.jpg", "solitaire", "", false, true);
  infoJeux[0][3].SetJeuxInfo( true, "./jeux/mahjongg/", "mahjongg.jpg", "mahjongg", "", false, false);
  infoJeux[0][4].SetJeuxInfo( true, "./jeux/sudoku/", "sudoku.jpg", "sudoku", "", true, false);
  infoJeux[0][5].SetJeuxInfo( true, "./jeux/solitaire/", "sltrisolitaire0.jpg", "solitaire", "", false, true);
  infoJeux[0][6].SetJeuxInfo( true, "./jeux/spheres/", "spheres.jpg", "spheres", "", true, false);
  infoJeux[0][7].SetJeuxInfo( true, "./jeux/cascade/", "cascade.jpg", "cascade", "", true, false);
  infoJeux[0][8].SetJeuxInfo( true, "./jeux/jewelsmine/", "jewelsmine.jpg", "jewelsmine", "", true, false);
  infoJeux[0][9].SetJeuxInfo( true, "./jeux/lines/", "lines.jpg", "lines", "", true, false);
  infoJeux[0][10].SetJeuxInfo( true, "./jeux/gasp/", "gasp.jpg", "gasp", "", false, true);
  infoJeux[0][11].SetJeuxInfo( true, "./jeux/hanoi/", "hanoi.jpg", "hanoi", "", false, true);
  //infoJeux[0][14].SetJeuxInfo( true, "./jeux/compteestbon/", "compteestbon.jpg", "compteestbon", "", true, false);
  // classiques
  infoJeux[1][0].SetJeuxInfo( true, "./jeux/othello/", "othello.jpg", "othello", "", false, true);
  infoJeux[1][1].SetJeuxInfo( true, "./jeux/awele/", "awele.jpg", "awele", "", false, true);
  infoJeux[1][2].SetJeuxInfo( true, "./jeux/morpion/", "morpion.jpg", "morpion", "", false, true);
  infoJeux[1][3].SetJeuxInfo( true, "./jeux/puissance4/", "puissance4.jpg", "puissance4", "", false, true);
  infoJeux[1][4].SetJeuxInfo( true, "./jeux/demineur/", "demineur.jpg", "demineur", "", true, false);
  infoJeux[1][5].SetJeuxInfo( true, "./jeux/tetris/", "tetris.jpg", "tetris", "", true, false);
  // divers
  infoJeux[2][0].SetJeuxInfo( true, "./jeux/isola/", "isola.jpg", "isola", "", false, true);
  infoJeux[2][1].SetJeuxInfo( true, "./jeux/pousseur/", "pousseur.jpg", "pousseur", "", false, true);
  infoJeux[2][2].SetJeuxInfo( true, "./jeux/merlin/", "merlin.jpg", "merlin", "", false, true);
  infoJeux[2][3].SetJeuxInfo( true, "./jeux/quarto/", "quarto.jpg", "quarto", "", false, true);
  infoJeux[2][4].SetJeuxInfo( true, "./jeux/loto/", "loto.jpg", "loto", "", false, true);
  infoJeux[2][5].SetJeuxInfo( true, "./jeux/memory/", "memory.jpg", "memory", "", false, true);
  // des
  infoJeux[3][0].SetJeuxInfo( true, "./jeux/yams/", "yams.jpg", "yams", "", true, false);
  infoJeux[3][1].SetJeuxInfo( true, "./jeux/yathzee/", "yathzee.jpg", "yathzee", "", false, true);
  infoJeux[3][2].SetJeuxInfo( true, "./jeux/pokerdice/", "pokerdice.jpg", "pokerdice", "", false, true);
  infoJeux[3][4].SetJeuxInfo( true, "./jeux/kismet/", "kismet.jpg", "kismet", "", true, true);
  infoJeux[3][5].SetJeuxInfo( true, "./jeux/craps/", "craps.jpg", "craps", "", true, true);
  // cartes
  infoJeux[4][0].SetJeuxInfo( true, "./jeux/blackjack/", "blackjack.jpg", "blackjack", "", false, true);
  infoJeux[4][1].SetJeuxInfo( true, "./jeux/4as/", "4as.jpg", "4as", "", false, true);
  infoJeux[4][2].SetJeuxInfo( true, "./jeux/pyramids/", "pyramids.jpg", "pyramids", "", true, false);
  infoJeux[4][3].SetJeuxInfo( true, "./jeux/rsol/", "rsol.jpg", "solitaire", "", true, false);
  infoJeux[4][4].SetJeuxInfo( true, "./jeux/ruscell/", "ruscell.jpg", "ruscell", "", true, false);
  infoJeux[4][5].SetJeuxInfo( true, "./jeux/solipoker/", "solipoker.jpg", "solipoker", "", true, false);
  infoJeux[4][8].SetJeuxInfo( true, "./jeux/hilo/", "hilo.jpg", "hilo", "", false, true);
  // mots
  //infoJeux[5][0].SetJeuxInfo( false, "./jeux/wordox/", "wordox.jpg", "wordox", "", true, false);
  infoJeux[5][0].SetJeuxInfo( true, "./jeux/wordsearch/", "wordsearch.jpg", "wordsearch", "", false, true);
  infoJeux[5][1].SetJeuxInfo( true, "./jeux/boogle/", "boogle.jpg", "boogle", "", false, true);
  infoJeux[5][2].SetJeuxInfo( true, "./jeux/hexamots/", "hexamots.jpg", "hexamots", "", false, true);
  infoJeux[5][4].SetJeuxInfo( true, "./jeux/motus/", "motus.jpg", "motus", "", false, true);
  infoJeux[5][5].SetJeuxInfo( true, "./jeux/motlepluslong/", "motlepluslong.jpg", "motlepluslong", "", false, true);
  // strategie
  //infoJeux[6][0].SetJeuxInfo( true, "./jeux/partners/duelfield/", "duelfield.jpg", "duelfield", "", false, false);
  infoJeux[6][0].SetJeuxInfo( true, "./jeux/miniclip/", "battleships.jpg", "battleships", "battleships.shtml", false, false);
  //infoJeux[6][0].SetJeuxInfo( false, "", "", "", "", false, true);
  // Arcade
  infoJeux[7][0].SetJeuxInfo( true, "./jeux/javanoid/", "javanoid.jpg", "javanoid", "", true, false);
  infoJeux[7][1].SetJeuxInfo( true, "./jeux/alienattack/", "alienattack.jpg", "alienattack", "", true, false);
  infoJeux[7][2].SetJeuxInfo( true, "./jeux/fillit/", "fillit.jpg", "fillit", "", true, false);
  infoJeux[7][3].SetJeuxInfo( true, "./jeux/outpost/", "outpost.jpg", "outpost", "", true, false);
  infoJeux[7][4].SetJeuxInfo( true, "./jeux/antaris/", "antaris.jpg", "antaris", "", true, false);
  infoJeux[7][5].SetJeuxInfo( true, "./jeux/moondefender/", "moondefender.jpg", "moondefender", "", true, false);
  infoJeux[7][6].SetJeuxInfo( true, "./jeux/jkobo/", "jkobo.jpg", "jkobo", "", true, false);
  infoJeux[7][7].SetJeuxInfo( true, "./jeux/iceblox/", "iceblox.jpg", "iceblox", "", true, false);
  infoJeux[7][8].SetJeuxInfo( true, "./jeux/tempest/", "tempest.jpg", "tempest", "", true, false);
  infoJeux[7][9].SetJeuxInfo( true, "./jeux/moonstar/", "moonstar.jpg", "moonstar", "", true, false);
  infoJeux[7][10].SetJeuxInfo( true, "./jeux/pondlife/", "pondlife.jpg", "pondlife", "", true, false);
  infoJeux[7][11].SetJeuxInfo( true, "./jeux/tetris/", "tetris.jpg", "tetris", "", true, false);
  infoJeux[7][12].SetJeuxInfo( true, "./jeux/asteroids/", "asteroids.jpg", "asteroids", "", true, false);
  infoJeux[7][13].SetJeuxInfo( true, "./jeux/tailgunner/", "tailgunner.jpg", "tailgunner", "", true, false);
  infoJeux[7][14].SetJeuxInfo( true, "./jeux/kadoblaster/", "kadoblaster.jpg", "kadoblaster", "", true, false);
  // casino
  infoJeux[8][0].SetJeuxInfo( true, "./jeux/blackjack/", "blackjack.jpg", "blackjack", "", false, true);
  infoJeux[8][1].SetJeuxInfo( true, "./jeux/craps/", "craps.jpg", "craps", "", false, true);
  infoJeux[8][2].SetJeuxInfo( true, "./jeux/roulette/", "roulette.jpg", "roulette", "", false, true);
  infoJeux[8][3].SetJeuxInfo( true, "./jeux/baccarat/", "baccarat.jpg", "baccarat", "", false, true);
  infoJeux[8][4].SetJeuxInfo( true, "./jeux/paigowpoker/", "paigowpoker.jpg", "paigowpoker", "", false, true);
  infoJeux[8][5].SetJeuxInfo( true, "./jeux/caribbeanpoker/", "caribbeanpoker.jpg", "caribbeanpoker", "", false, true);
  infoJeux[8][6].SetJeuxInfo( true, "./jeux/slots/", "slots.jpg", "slots", "", false, true);
  infoJeux[8][7].SetJeuxInfo( true, "./jeux/videopoker/", "videopoker.jpg", "videopoker", "", false, true);
  infoJeux[8][8].SetJeuxInfo( true, "./jeux/keno/", "keno.jpg", "keno", "", false, true);
  infoJeux[8][9].SetJeuxInfo( false, "./jeux/jackpot5/", "jackpot5.jpg", "slots", "", false, true);
  infoJeux[8][10].SetJeuxInfo( true, "./jeux/reddog/", "reddog.jpg", "reddog", "", false, true);
  infoJeux[8][11].SetJeuxInfo( true, "./jeux/moneywheel/", "moneywheel.jpg", "moneywheel", "", false, true);
  infoJeux[8][12].SetJeuxInfo( true, "./jeux/slots/riverbelle/", "riverbelle.jpg", "slots", "", false, true);
  infoJeux[8][13].SetJeuxInfo( true, "./jeux/slots/luckynugget/", "luckynugget.jpg", "slots", "", false, true);
  infoJeux[8][14].SetJeuxInfo( true, "./jeux/slots/gamingclub/", "gamingclub.jpg", "slots", "", false, true);
}

function Init_Cat_Add() {
  infoJeuxAdd = new Array( kMaxCat);
  for (var i=0; i<kMaxCat; i++) {
    infoJeuxAdd[i] = new Array( kMaxJeuxCatAdd);
    for (var j=0; j<kMaxJeuxCatAdd; j++) {
      infoJeuxAdd[i][j] = new JeuxInfo( false, "", "", "", "", false, true);
    }
  }
  // 0:reflexion 1:classiques 2:divers 3:des 4:cartes 5:mots 6:strategie 7:Arcade 8:casino
  if (lang=="fr") {
    infoJeuxAdd[2][0].SetJeuxInfo( true, "./jeux/prizee/", "prizee.jpg", "grattage", "index_fr.php3", false, false);

    infoJeuxAdd[5][0].SetJeuxInfo( true, "./jeux/prizee/", "diabolo.jpg", "diabolo", "index_fr.html", false, false);

    //infoJeuxAdd[7][0].SetJeuxInfo( true, "./jeux/prizee/", "galaxie.jpg", "galaxie", "index_fr.html", false, false);
    //infoJeuxAdd[7][1].SetJeuxInfo( true, "./jeux/prizee/", "abysse.jpg", "abysse", "index_fr.html", false, false);
    //infoJeuxAdd[7][2].SetJeuxInfo( true, "./jeux/prizee/", "toudou.jpg", "toudou", "index_fr.html", false, false);
    infoJeuxAdd[7][0].SetJeuxInfo( true, "./jeux/prizee/", "chainealim.jpg", "xxx", "index_fr.html", false, false);
    infoJeuxAdd[7][1].SetJeuxInfo( true, "./jeux/prizee/", "aviateur.jpg", "xxx", "index_fr.html", false, false);

    infoJeuxAdd[6][0].SetJeuxInfo( true, "./jeux/serenia/", "serenia.jpg", "serenia", "index_fr.html", false, false);
  }
  if (lang=="en") {
    infoJeuxAdd[2][0].SetJeuxInfo( true, "./jeux/trivia/", "trivia.jpg", "trivia", "", false, false);

    infoJeuxAdd[0][0].SetJeuxInfo( true, "./jeux/kewlbox/", "topsyturvy.jpg", "topsyturvy", "topsyturvy.shtml", false, false);
    infoJeuxAdd[0][1].SetJeuxInfo( true, "./jeux/kewlbox/", "ticollide.jpg", "ticollide", "ticollide.shtml", false, false);
    infoJeuxAdd[0][2].SetJeuxInfo( true, "./jeux/kewlbox/", "carnivaljackpot.jpg", "carnivaljackpot", "carnivaljackpot.shtml", false, false);
    infoJeuxAdd[0][3].SetJeuxInfo( true, "./jeux/kewlbox/", "santaballs2.jpg", "santaballs2", "santaballs2.shtml", false, false);
    infoJeuxAdd[5][0].SetJeuxInfo( true, "./jeux/kewlbox/", "letterrip.jpg", "letterrip", "letterrip.shtml", false, false);
    infoJeuxAdd[5][1].SetJeuxInfo( true, "./jeux/kewlbox/", "fowlwords.jpg", "fowlwords", "fowlwords.shtml", false, false);
    infoJeuxAdd[6][0].SetJeuxInfo( true, "./jeux/kewlbox/", "diegosmart.jpg", "diegosmart", "diegosmart.shtml", false, false);
    infoJeuxAdd[7][0].SetJeuxInfo( true, "./jeux/kewlbox/", "spankthefrank.jpg", "spankthefrank", "spankthefrank.shtml", false, false);    
    infoJeuxAdd[7][1].SetJeuxInfo( true, "./jeux/kewlbox/", "flipitcake.jpg", "flipitcake", "flipitcake.shtml", false, false);
  }
}

function Write_Category_Base( iCat, infoJeux) {

  document.writeln( "<table cellspacing=1 cellpadding=1 border=0>\n" );

//  for (var j=0; j<kMaxJeuxCat/3; j++) {
  for (var j=0; j<infoJeux[0].length/3; j++) {
    document.writeln( "<tr>");
    for (var i=0; i<3; i++) {
      idx = j*3+i;
      if (infoJeux[iCat][idx].isActive) {
      document.writeln( '  <td><img src="'+infoJeux[iCat][idx].imgLabel+'" width=138 height=20></td>' );
      //document.writeln( '  <td><div class="jeuxlabel">'+infoJeux[iCat][idx].name+'</div></td>' );
      } else {
      document.writeln( "<td></td>" );
      }
      if (i!=2) { document.writeln( '  <td rowspan=2 width="20"></td>' ); }
    }
    document.writeln( "</tr><tr align=center>\n" );
    for (var i=0; i<3; i++) {
      idx = j*3+i;
      document.writeln( "<td>\n" );
      if (infoJeux[iCat][idx].isActive) {
      document.writeln( '  <table class="jeux" cellpadding=0 cellspacing=0 border=0>' );
      document.writeln( '  <tr><td valign=center align=center><a href="'+infoJeux[iCat][idx].url+'"><img src="'+infoJeux[iCat][idx].imgJeux+'" width=128 height=96 border=0></a></td></tr>' );
      document.writeln( '  </table>' );
      //} else {
      //document.writeln( "&nbsp;" );
      }
      document.writeln( "</td>\n" );
    }
  }
  document.writeln( "</table>\n" );
}

function Write_Category( iCat) {
  document.writeln( '<img src="./design/visu__0'+eval(iCat+1)+'.gif" width=78 height=80 align=middle>' );
  document.writeln( '<img src="./design/'+lang+'_titre2_'+eval(iCat)+'.gif" width=450 height=60 align=middle>' );
  document.writeln( "<hr>\n" );

  Init_Cat();
  Write_Category_Base( iCat, infoJeux);
}

function Write_Category_Add( iCat) {
  Init_Cat_Add();
  switch (iCat) {
    case 2:
      document.writeln( "<hr>\n" );
      break;
    case 7:
      document.writeln( "<br>\n" );
      document.writeln( '<script type="text/javascript" src="http://pub.motion-twin.com/friends.js"></script>');
      document.writeln( '<script type="text/javascript">mtshow(2583,18);</script>');
	break;
  }
  Write_Category_Base( iCat, infoJeuxAdd);
  switch (iCat) {
    case 8:
      //document.writeln( '<br><a target="_blank" style="color:#FFFFFF; font-weight: bold;" href="http://www.interjeux.net/php/go_pub.php3?idx=1098">Casino Partouche : <b>20 &euro;</b> offerts !</a>\n');
      document.writeln( '<br><a target="_blank" style="color:#FFFFFF; font-weight: bold;" href="http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=585479807&friend_id=12975814">Casino Partouche : <b>20 &euro;</b> offerts !</a>\n');
      document.writeln( '<img src=http://www.cibleclick.com/cibles/banniere/symp0.cfm?site_id=585479807&friend_id=12975814&banniere_id=0 border=0 alt=>\n');
      document.writeln( '<br>');
      break;
  }
}
//-->
