/* CHECK HOME DIRECTORY */

var pdchome='http://parodiesdechansons.over-blog.com';
var mp3page=pdchome+'/article-94940-6.html';
var url = document.URL;
var imagehome='http://fdata.over-blog.com/0/01/48/46/thumbs/';

function checkHome()
{
  var getVars = new Array();
  var qString = unescape(top.location.search.substring(1));
  var pairs = qString.split(/\&/);
  var pdchomedir = pdchome +"/";
  if ( ( url == pdchomedir ) && (pairs == '' ) )
  {
    window.location = mp3page;
  }
}
/*obsolete checkHome()*/

function writeBlocSplit(id,titl)
{
   document.write('</div>');
   document.write('<div class="box-footer"><h2><span>&nbsp;</span></h2></div>');
   document.write('</div>');
   document.write('<div class="box text">');
   document.write('<div class="box-titre"><h2><span>',titl,'</span></h2></div>');
   document.write('<div class="box-content">');
}

/* SHOW COMENTS */

var search_term ='/article';
var extension ='.html';
var added ="-6";

function showComments()
{
  var url_check_term = url.indexOf( search_term );
  var url_check_changed = url.indexOf( added+extension );
  if ( ( url_check_term != '-1' ) && ( url_check_changed == '-1' ) )
  {
    var pos_index = url.indexOf( extension );
    var newurl = url.substring(0,pos_index)+added+extension;
    window.location = newurl;
  }
}
/*showComments();*/

/* JUKEBOX */
function showJukebox()
{
  window.open('http://data.over-blog.com/lib/6/4/14846/files/tools/jukebox.html','Jukebox','menubar=0,resizable=0,width=200,height=475');
}

function insertFlash(identifier,file,fwidth,fheight)
{
  document.write("<object id='",identifier,"' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='",fwidth,"' height='",fheight,"' align='middle'>");
  document.write("<param name='allowScriptAccess' value='sameDomain' />");
  document.write("<param name='movie' value='http://parodiesdechansons.free.fr/player/ben-player.swf");
  if ( file != undefined )
  {
    document.write("?s=",file,"");
  }
  document.write("' />");
  document.write("<param name='loop' value='false' />");
  document.write("<param name='menu' value='false' />");
  document.write("<param name='quality' value='high' />");
  document.write("<param name='bgcolor' value='#ffffff' />");
  document.write("<embed src='http://parodiesdechansons.free.fr/player/ben-player.swf");
  if ( file != undefined )
  {
    document.write("?s=",file,"");
  }
  document.write("' loop='false' menu='false' quality='high' bgcolor='#ffffff' width='",fwidth,"' height='",fheight,"' name='",identifier,"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
  document.write("</object>");
}

function addproduct(title,fileName,article)
{
  if (fileName != "")
  {
      document.write("<a href=",pdchome,"/",article," title='","Ecouter le mp3","'> <img height='16' src='http://idata.over-blog.com/0/01/48/46/admin/listenb.gif'></a>");
  }
  else
  {
    document.write("<img height='16' src='http://idata.over-blog.com/0/01/48/46/admin/nolistenb.gif'>");
  }
  if ( article != "")
  {
    document.write("<a href=",pdchome,"/",article," title='","Lire l&rsquo;article","'> ",title,"</a><br/>");
  }
  else
  {
    document.write("<B>",title,"<br/>(en cours, bientot dispo)</B><br/>");
  }
}

function playmp3(title,fileName,article,pwidth,pheight)
{
  document.write("<B>",title," : </B>");
  if (fileName == "")
  {
    document.write("<BLINK><span style='color: rgb(255, 0, 0);'>bientôt disponible</span></BLINK>");
  }
  else
  {
    insertFlash("singleplayer",fileName,pwidth,pheight);
  }
  document.write("<br/>");
}

function loadSong(str,playerId)
{
  var dp = document.getElementById(playerId);
  var address=mp3home+str+mp3ext;
  dp.setVariable("son",address);
  dp.rewind();
}

/* AUDIO JUKEBOX */
var jukeboxId='jukebox';

function CreeTableau()
{
  this.length = CreeTableau.arguments.length
  for (var i = 0; i < this.length; i++)
    this[i+1] = CreeTableau.arguments[i]
}

function setSong(form,playerId)
{
  i = form.SelectMenu.selectedIndex;
  if (i == 0) return;
  loadSong(CibleSong[i],playerId);
}

function changeURL(form)
{
  i = form.SelectMenu.selectedIndex;
  if (i == 0) return;
  if ( CibleURLArticle[i] != "")
    window.location = pdchome +"/"+CibleURLArticle[i];
}

function writeSelect(playerId)
{
  document.write("<SELECT NAME='SelectMenu' onChange='setSong(this.form,jukeboxId)'>");
  Nombre = LibelleOption.length;
  document.write("<OPTION> **CHOIX CHANSON**");
  for (var i = 1; i <= Nombre; i++)
  {
    if ( CibleSong[i] != "" )
    {
      document.write("<OPTION>" +LibelleOption[i]);
    }
  }
  document.write('</SELECT>');
}

function insertJukeboxCombo()
{
  document.write("<FORM id='formul'>");
  document.write("<table border='5'><tr >")
  document.write("<td>");
  writeSelect();
  document.write("<td>(experimental)");
  document.write("</td></tr ><tr >");
  document.write("<td>");
  insertFlash(jukeboxId,CibleSong[1],'170','25');
  document.write("</td><td><button id='formButton' onClick='changeURL(formul)'>lire l'article</button>");
  document.write("</td></tr></table></FORM><br/>");
}

function insertJukeboxLongFormat()
{
  Nombre = LibelleOption.length;
  for (var j = 1; j <= Nombre; j++)
  {
    var i = CibleURLOrder[j];
    addproduct(LibelleOption[i],CibleSong[i],CibleURLArticle[i]);
  }
}

function playmp3id(i)
{
  playmp3(LibelleOption[i],CibleSong[i],CibleURLArticle[i],'170','25');
}

function insertJukebox()
{
  var name = navigator.appName;
  if (name == 'Microsoft Internet Explorer')
    insertJukeboxCombo();
  else
    insertJukeboxLongFormat();
}

function testInsertJukeboxCombo()
{
  var name = navigator.appName;
  if (name == 'Microsoft Internet Explorer')
    insertJukeboxCombo();
}

function insertNomao()
{
  nomao_w_width =520;
  nomao_w_height =442;
  nomao_w_tpl_type = "1";
  nomao_w_title = "La carte des parodies (bientôt en version mondiale!)";
  nomao_w_tpl_color =19
  nomao_w_center_x = "47.15984001304432";
  nomao_w_center_y = "3.251953125";
  nomao_w_zoom = 5;
  nomao_w_show_zoom = "2";
  nomao_w_show_type = "0";
  nomao_w_type = "HYBRID_MAP";
  nomao_w_show_overview = "0";
  nomao_w_color_border = "";
  nomao_w_color_bg = "DDDDDD";
  nomao_w_color_link = "f4f4f4";
  nomao_w_color_text = "f4f4f4";
  nomao_w_bee = "1";
  document.write('<' + 'script');
  document.write(' language="javascript"');
  document.write(' type="text/javascript"');
  document.write(' src="' + 'http://widget.nomao.com/w.js?l=104760&amp;w=1' + '">');
  document.write('</' + 'script' + '>');
  document.write("<div id='nomao_footer'>Piqu&#233; avec <a target='_blank' href='http://www.nomao.com'>nomao</a></div>");
}

function insertHomePage()
{
  var length = LibelleOption.length;

  
  //nouveauté
  {
    var i = newProduct;
    var imageURL = CibleURLImage[i];
    var titl = LibelleOption[i];
    var desc = CibleURLDesc[i];
    var article = CibleURLArticle[i];
    var pos_index = titl.indexOf( "(" );
    var titl1 = titl.substring(0,pos_index);
    var titl2 = titl.substring(pos_index,titl.length);

      document.write("<br/>");
      document.write("<div class=\"accueilCell\"><div class=\"leftAccueilCell\">");
      document.write("<table cellpadding=\"0\" cellspacing=\"0\"><tr><td>");
      document.write("<a target='_blank' href='",pdchome,"/",article,"' title='","Lire l&rsquo;article et &eacute;couter le mp3","'>");
      document.write("<img src=\"http://accel5.mettre-put-idata.over-blog.com/0/01/48/46/admin/nouveau.png\">");
      document.write("</a>");
      document.write("</td><td>");
      document.write("<a target='_blank' href='",pdchome,"/",article,"' title='","Lire l&rsquo;article et &eacute;couter le mp3","'>");
      document.write("<img src='",imagehome,"/",imageURL,"'/>");
      document.write("</a>");
      document.write("</td><td>");
      document.write("<div class=\"accueilTitre1\">",titl1,"</div>");
      document.write("<div class=\"accueilTitre2\">",titl2,"</div>");
      document.write("<div class=\"accueilDesc\">",desc,"</div>");
      document.write("</div></div></td></tr></table>");
      document.write("</div></div>");
      
  }
  
  insertNomao();
  document.write("<table cellpadding=\"0\" cellspacing=\"0\" id=\"AccueilTab\">");
  document.write("<tbody><tr>");
  document.write("<td><div class=\"leftAccueil\">");
  for (var j = 1; j <length; j=j+2)
  {
    var i = CibleURLOrder[j];
    var imageURL = CibleURLImage[i];
    var titl = LibelleOption[i];
    var desc = CibleURLDesc[i];
    var article = CibleURLArticle[i];
    if ((imageURL != undefined) && (imageURL != ""))
    {
      var pos_index = titl.indexOf( "(" );
      var titl1 = titl.substring(0,pos_index);
      var titl2 = titl.substring(pos_index,titl.length);
      
      document.write("<div class=\"accueilCell\"><div class=\"leftAccueilCell\">");
      document.write("<table cellpadding=\"0\" cellspacing=\"0\"><tr><td><div class=\"accueilText\"><div class=\"leftAccueilText\">");
      document.write("<div class=\"accueilTitre1\">",titl1,"</div>");
      document.write("<div class=\"accueilTitre2\">",titl2,"</div>");
      document.write("<div class=\"accueilDesc\">",desc,"</div>");
      document.write("</div></div></td><td>");
      document.write("<a target='_blank' href='",pdchome,"/",article,"' title='","Lire l&rsquo;article et &eacute;couter le mp3","'>");
      document.write("<img style='filter:alpha(opacity=20);-moz-opacity:0.6' onMouseover='makevisible(this,0)' onMouseout='makevisible(this,1)' src='",imagehome,"/",imageURL,"'/>");
      document.write("</a>");
      document.write("</td></tr></table>");
      document.write("</div></div>");
    }
  }
  document.write("</div></td>");
  document.write("<td><div class=\"rightAccueil\">");
  for (var j = 0; j <length; j=j+2)
  {
    var i = CibleURLOrder[j];
    var imageURL = CibleURLImage[i];
    var titl = LibelleOption[i];
    var desc = CibleURLDesc[i];
    var article = CibleURLArticle[i];
    if ((imageURL != undefined) && (imageURL != ""))
    {
      var pos_index = titl.indexOf( "(" );
      var titl1 = titl.substring(0,pos_index);
      var titl2 = titl.substring(pos_index,titl.length);
      
      document.write("<div class=\"accueilCell\"><div class=\"rightAccueilCell\">");
      document.write("<table cellpadding=\"0\" cellspacing=\"0\"><tr><td>");
      document.write("<a target='_blank' href='",pdchome,"/",article,"' title='","Lire l&rsquo;article et &eacute;couter le mp3","'>");
      document.write("<img style='filter:alpha(opacity=20);-moz-opacity:0.6' onMouseover='makevisible(this,0)' onMouseout='makevisible(this,1)' src='",imagehome,"/",imageURL,"'/>");
      document.write("</a>");
      document.write("</td><td><div class=\"accueilText\"><div class=\"rightAccueilText\">");
      document.write("<div class=\"accueilTitre1\">",titl1,"</div>");
      document.write("<div class=\"accueilTitre2\">",titl2,"</div>");
      document.write("<div class=\"accueilDesc\">",desc,"</div>");
      document.write("</div></div></td></tr></table>");
      document.write("</div></div>");
    }
  }
  document.write("</div></td>");
  document.write("</tr></tbody></table>");
}

function makevisible(cur,which)
{
  strength=(which==0)? 1 : 0.6
  if (cur.style.MozOpacity)
    cur.style.MozOpacity=strength
  else if (cur.filters)
    cur.filters.alpha.opacity=strength*100
}


/* FICHIERS DISPONIBLES */

var LibelleOption = new CreeTableau(
"Au pays de Candy (Gispsy)",
"Mr l'ordinateur (Sly)",
"Judoboy (Pavarotti)",
"Olive et Tom (Pascal Obispo)",
"Lolito (Roch Voisine)",
"Je serai (version mâle)",
"Bibifoc (Dick Rivers)",
"Le lapin (Carla Bruni)",
"Highway to Hell (les Choristes)",
"Les bisounours (Gainsbourg)",
"Tata yoyo (Etienne Daho)",
"Maman (Johnny Hallyday)",
"La valise (Sinclair)",
"La simca 1000 (Francis Cabrel)",
"Ulysse Rasta (Yannick Noah)",
"Demetan (Patrick Bruel)",
"Le zizi (Lara Fabian)",
"Tirelimpimpon(Voulzy)",
"Les snorkies (Raphael)",
"Mimi Cracra (Les Wampas)",
"Les Mondes engloutis (Eagles)",
"We will Rock you (Papy Band)",
"Noé (Passi-Clerc)",
"Laisse moi kiffer (Mike Brant)",
"Bouba (Trust)",
"La Boum  (Rammstein)",
"Regarde moi (Vincent Delerm)",
"Cobra (E. Mitchell)",
"Medley dessins animés (Goldman)",
"X-OR (Britney Spears)",
"Starsky et Hutch (Zazie)",
"Nuit de Folie (Lara Fabian)",
"Lady Marmelade (Red Hot)",
"La bonne du curée (Mylène Farmer)",
"De retour (Michel Jonasz)",
"Y'a d'l'a joie (Mylène Farmer)");

var CibleSong = new CreeTableau(
"les-gypsy-kings-candy",
"rock-voisine-dorothee-monsieur-l-ordinateur",
"luciano-pavarotti-judoboy",
"pascal-obispo-olive-et-tom",
"alizee-lolita-rock-voisin-lolito",
"lorie-je-serai",
"dick-rivers-les-forbans-bibifoc",
"carla-bruni-chantal-goya-lapin-chasseur",
"ac-dc-jean-baptiste-maunier-highway-to-hell",
"gainsbourg-les-bisounours-mon-legionnaire",
"anny-cordy-etienne-daho-tata-yoyo",
"johnny-hallyday-dorothee-maman-chanteur-abandonne-berger",
"sinclair-dorothee-valise-chaussetes-rouge-jaunes-petits-pois",
"cabrel-les-chevaliers-du-fiel-simca-1000",
"yannick-noah-ulysse-31-jamming",
"demetan-patrick-bruel-rendez-vous-dans-dix-ans",
"lara-fabian-pierre-perret-le-zizi",
"carlos-laurent-voulzy-le-tirelipimpon",
"raphael-les-snorkies-caravane",
"les-wampas-mimi-cracra",
"eagles-cosma-les-mondes-engloutis-hotel-california",
"papi-band-queen-we-will-rock-you-accordeon",
"passi-julien-clerc-noe",
"diams-mike-brant-laisse-moi-kiffer",
"bouba-petit-ourson-trust",
"rammstein-richard-sanderson-la-boom-sophie-marceau-reality",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"mylene-farmer-charles-trenet-ya-dla-joie");

var CibleURLArticle = new CreeTableau(
"article-85216-6.html",
"article-139371-6.html",
"article-84655-6.html",
"article-96424-6.html",
"article-80394-6.html",
"article-82960-6.html",
"article-75913-6.html",
"article-81740-6.html",
"article-163994-6.html",
"article-1005419-6.html",
"article-220049-6.html",
"article-598443-6.html",
"article-276660-6.html",
"article-312264-6.html",
"article-276443-6.html",
"article-631210-6.html",
"article-932366-6.html",
"article-1274379-6.html",
"article-13030929-6.html",
"article-1403608-6.html",
"article-4110194-6.html",
"article-1968173-6.html",
"article-1586988-6.html",
"article-3188950-6.html",
"article-5373797-6.html",
"article-19683547-6.html",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"article-14923653.html");

var CibleURLImage = new CreeTableau(
"gispy/gipsyking.jpg",
"dorothee-fanclub-lyon.jpg",
"judoboy/kara01.jpg",
"obispo/olive-et-tom-pascal-obispo.jpg",
"lolito/alizee-roch.jpeg",
"lorie/copie-1-lorie-rugby.jpg",
"bibifoc/bibifoc.jpg",
"carla/carla-album.jpg",
"maunier/maunier.jpg",
"blog-gainsbourg--under-arrest.jpg",
"daho/tata-yoyo-etienne-daho.jpg",
"blog-johhny-hallyday-femme.jpg",
"sinclair-valise.jpg",
"cabrel/cabrel-70.jpg",
"ulysse-31-yannick-noah-pochette.jpg",
"blog-demetan-renatan-parapluie.jpg",
"lara-fabian-intime.jpg",
"voulzy-exotique.jpg",
"raphael/raphael-caravane-snorkies-montage.jpg",
"mimi-cracra-chanson.jpg",
"don-henley-inside-job.jpg",
"blog-we-will-rock-you-kids.jpg",
"passi.jpg",
"mikebrant.jpg",
"bouba.jpg",
"blog-rammstein-feu-torche.jpg",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"myle-ya-dla-joie.jpg");

var CibleURLDesc = new CreeTableau(
"Les Gypsys Chez Candy !",
"Petite ballade pour les amoureuses de Roch",
"Jodoboy à L'Opera",
"Allez Olive et Tom !",
"Moi je m'appelle Lolito...",
"Je resterai... ton meilleur ami",
"C'mon bibi !",
"Fini les manteaux en peau de lapin !",
"JB on the Highway to Hell",
"Gainsbourg et son bisounours",
"Tata yoyo : Etienne et son chapeau",
"Johnny : un hymne pour toutes les mamans",
"Que de choses dans la valise de Sinclair !",
"Francis Cabrel en Simca 1000",
"Ulysse 31 Rastafari",
"Patriiiick chante l'histoire de Demetan",
"Lara vous dira tout ... sur le zizi",
"Tirelimpimpon en mer",
"Qui qui qui, mais qui ?",
"Mimi cracra la bière elle aime ça !",
"Reprise des mondes engloutis par les Eagles",
"We will roch you par des papi mami",
"Le premier rap écolo",
"Laisse moi kiffer avec ma meuf",
"Bouba antisocial !!",
"Da boom !",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Y'a d'la joie pour Mylène farmer");

//ordre d'affichage
var CibleURLOrder = new CreeTableau(
1,2,4,10,17,24,3,5,6,7,8,9,11,12,14,13,15,16,18,19,20,21,22,23,26,36,25,27,28,29,30,31,32,33,34,35);

//dernier produit
var newProduct = 36;
