function choisir_relief(valeur) {
  if (!document.choix_relief) return ;
  if (document.choix_relief.elements[0].checked) {
    parent.temoin.pokescope = 0 ;
  } else {
    parent.temoin.pokescope = 1 ;
  }
  parent.contenu.document.location.href=valeur ;
}

function maj_boutons() {
  if (!document.choix_relief) return ;
  document.choix_relief.elements[0].checked = (!parent.temoin.pokescope) ;
  document.choix_relief.elements[1].checked = parent.temoin.pokescope ;
}





// Texte affiché en haut de chaque page de photos en relief
function
avertir_relief() {

  if (parent.temoin.pokescope) {
    texte_pokescope="<img name=\"horizontal\" src=\"images/add/pokescope.jpg\" style=\"border: 2px solid ; width: 300px; height: 226px;\">" ;
    note_info_bulle("pokescope", 304, texte_pokescope) ;

    document.write("<p>Ces photos sont con&ccedil;ues pour &ecirc;tre admir&eacute;es avec le <a href=\"http://www.pokescope.com/\" class=\"externe\" title=\"Site de la société commercialisant le Pokescope\">Pokescope<"+"/"+"a> ") ;
    document.write("(un instrument difficile &agrave; se procurer et qui ") ;
    document.write("co&ucirc;te une petite somme, surtout quand on voit &agrave; quoi il ") ;
    document.write("<a class=\"note_info_bulle\" onmouseout=\"couic() ;\" onmouseover=\"bullepop('pokescope', event) ;\">ressemble<"+"/"+"a>). ") ;
    document.write("Une m&eacute;thode alternative serait de loucher pour faire co&iuml;ncider les deux photos ") ;
    document.write("(si vous y arrivez je vous paie &agrave; boire&thinsp;!). ") ;
  } else {
    texte_lunettes="<img name=\"horizontal\" src=\"images/add/lunettes.jpg\" style=\"border: 2px solid ; width: 300px; height: 226px;\">" ;
    note_info_bulle("lunettes", 304, texte_lunettes) ;

    document.write("<p>Ces photos doivent être visualisées à travers des ") ;
    document.write("<a class=\"note_info_bulle\" onmouseout=\"couic() ;\" onmouseover=\"bullepop('lunettes', event) ;\">lunettes rouges/cyan<"+"/a>. ") ;
  }
  document.write("Cliquez sur les photos pour une visualisation ") ;
  document.write("plein &eacute;cran. Le relief se per&ccedil;oit mieux en s'&eacute;loignant ") ;
  document.write("d'1&nbsp;m de l'&eacute;cran.</p> ") ;

}





// FONCTIONS ECRITES POUR L'AFFICHAGE DES IMAGES POKESCOPE DANS UNE FENÊTRE INDÉPENDANTE

//var anc_vertical = -1 ;

function vue_pokescope_(photo, titre, hauteur, largeur, hauteur_img, largeur_img) {
  nouvellefenetre=open("","fenetre","height="+hauteur+",width="+largeur+",resizeable=0") ;
//
  if (nouvellefenetre.window.document.images[0] && !nouvellefenetre.window.document.images[1]) {
    nouvellefenetre.close() ;
    nouvellefenetre=open("","fenetre","height="+hauteur+",width="+largeur+",resizeable=0") ;
  } 

//
  if (nouvellefenetre.window.document.images[1]) {
    nouvellefenetre.window.document.images[0].src='images/pokescope/'+photo+'_G.jpg' ;
    nouvellefenetre.window.document.images[1].src='images/pokescope/'+photo+'_D.jpg' ;
    nouvellefenetre.window.document.title = titre ;
    nouvellefenetre.window.document.images[0].title = titre ;
    nouvellefenetre.window.document.images[1].title = titre ;
    nouvellefenetre.focus() ;
    return ;
  }
  nouvellefenetre.window.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html dir="ltr" lang="fr-fr"><head>') ;
  nouvellefenetre.window.document.writeln('  <title>'+titre+'</title>') ;
  nouvellefenetre.window.document.writeln('  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">') ;
  nouvellefenetre.window.document.writeln('  <meta http-equiv="Content-Language" content="fr">') ;
  nouvellefenetre.window.document.writeln('  <meta name="author" content="MORICE Olivier">') ;
  nouvellefenetre.window.document.writeln('  <link rel="stylesheet" href="couleurs.css" type="text/css">') ;
  nouvellefenetre.window.document.writeln('  </head><body><center><img alt="'+titre+'" title="'+titre+'" src="images/pokescope/'+photo+'_G.jpg" style="border: 5px solid ; width: '+largeur_img+'px; height: '+hauteur_img+'px;">') ;
  nouvellefenetre.window.document.writeln('<img alt="'+titre+'" title="'+titre+'" src="images/pokescope/'+photo+'_D.jpg" style="border: 5px solid ; width: '+largeur_img+'px; height: '+hauteur_img+'px;"><br>') ;
  nouvellefenetre.window.document.writeln('<br><a href="#" class="bouton" onclick="self.close() ;">FERMER</a></center>') ;
  nouvellefenetre.window.document.writeln('</body></html>') ;
} ;


function vue_pokescope(photo, titre) {
  var hauteur = 410 ;
  var largeur = 1090 ;
  var hauteur_img = 332 ;
  var largeur_img = 500 ;

// Ceci ne marche pas
//alert (anc_vertical) ;
//alert(anc_vertical == 1 && parent.temoin.fenetreverti.window.document.images[0]) ;
//if (anc_vertical == 1 && fenetreverti.window.document.images[0]) {
//  alert("fermeture") ;
//  parent.temoin.fenetreverti.window.close() ;
//}

  vue_pokescope_(photo, titre, hauteur, largeur, hauteur_img, largeur_img) ;

}

function vue_pokescope_v(photo, titre) {
  var hauteur = 610 ;
  var largeur = 890 ;
  var hauteur_img = 500 ;
  var largeur_img = 332 ;

  vue_pokescope_(photo, titre, hauteur, largeur, hauteur_img, largeur_img) ;
}



//// FONCTION D'AFFICHAGE D'UNE PHOTO ANAGLYPHE EN PLEIN ÉCRAN

function vue_anaglyphe(photo, titre) {
  var hauteur = 775 ;
  var largeur = 1040 ;
  var hauteur_img = 709 ;
  var largeur_img = 1000 ;

  neuesfenster=open("","fenetre","height="+hauteur+",width="+largeur+",resizeable=0") ;
//

  if (neuesfenster.window.document.images[1]) {
    neuesfenster.close() ;
    neuesfenster=open("","fenetre","height="+hauteur+",width="+largeur+",resizeable=0") ;
  }

  if (neuesfenster.window.document.images[0]) {
    neuesfenster.window.document.images[0].src='images/anaglyphes/'+photo+'.jpg' ;
    neuesfenster.window.document.title = titre ;
    neuesfenster.window.document.images[0].title = titre ;
    neuesfenster.focus() ;
    return ;
  }
  neuesfenster.window.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html dir="ltr" lang="fr-fr"><head>') ;
  neuesfenster.window.document.writeln('  <title>'+titre+'</title>') ;
  neuesfenster.window.document.writeln('  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">') ;
  neuesfenster.window.document.writeln('  <meta http-equiv="Content-Language" content="fr">') ;
  neuesfenster.window.document.writeln('  <meta name="author" content="MORICE Olivier">') ;
  neuesfenster.window.document.writeln('  <link rel="stylesheet" href="couleurs.css" type="text/css">') ;
  neuesfenster.window.document.writeln('  </head><body><center><img alt="'+titre+'" title="'+titre+'" src="images/anaglyphes/'+photo+'.jpg" style="border: 5px solid ; width: '+largeur_img+'px; height: '+hauteur_img+'px;"><br>') ;
  neuesfenster.window.document.writeln('<br><a href="#" class="bouton" onclick="self.close() ;">FERMER</a></center>') ;
  neuesfenster.window.document.writeln('</body></html>') ;
} ;




//// FONCTION GÉNÉRALE D'AFFICHAGE D'UNE IMAGE EN RELIEF

// Attention, pas d'apostrophe dans le titre, éventuellement la commande &rsquo;

function image_relief(photo, titre) {
  document.write("<div align=\"center\">") ;
  titre_=remplacer_guillemets(titre) ;
  if (parent.temoin.pokescope) {
    document.write("<a nohref onclick=\"vue_pokescope('"+photo+"', '"+titre_+"') ; return false;\" style=\"text-decoration: none; cursor: pointer;\">") ;
    document.write("<img src=\"images/pokescope/"+photo+"_G.jpg\" alt=\""+titre_+"\" title=\""+titre_+"\" style=\"border: 5px solid rgb(102, 51, 0) ; width: 350px; height: 232px;\">&nbsp;") ;
    document.write("<img src=\"images/pokescope/"+photo+"_D.jpg\" alt=\""+titre_+"\" title=\""+titre_+"\" style=\"border: 5px solid rgb(102, 51, 0) ; width: 350px; height: 232px;\">") ;
    document.write("</a>") ;
  } else {
    document.write("<a nohref onclick=\"vue_anaglyphe('"+photo+"', '"+titre_+"') ; return false;\" style=\"text-decoration: none; cursor: pointer;\">") ;
    document.write("<img src=\"images/anaglyphes/"+photo+".jpg\" alt=\""+titre_+"\" title=\""+titre_+"\" style=\"border: 5px solid rgb(102, 51, 0) ; width: 500px; height: 332px;\">") ;
    document.write("</a>") ;
  }
  document.write("</div>") ;
}


// Image verticale : exceptionnel (il n'y en a qu'une a priori)
// pas d'agrandissement possible en pokescope
function image_relief_verticale(photo, titre) {
  titre_=remplacer_guillemets(titre) ;
  document.write("<div align=\"center\">") ;
  if (parent.temoin.pokescope) {
    document.write("<img src=\"images/pokescope/"+photo+"_G.jpg\" alt=\""+titre_+"\" title=\""+titre_+"\" style=\"border: 5px solid rgb(102, 51, 0) ; width: 332px; height: 500px;\">&nbsp;") ;
    document.write("<img src=\"images/pokescope/"+photo+"_D.jpg\" alt=\""+titre_+"\" title=\""+titre_+"\" style=\"border: 5px solid rgb(102, 51, 0) ; width: 332px; height: 500px;\">") ;
  } else {
////    document.write("<a href=\"images/anaglyphes/"+photo+".jpg\" target=\"_blank\" style=\"text-decoration: none;\">") ;
    document.write("<img src=\"images/anaglyphes/"+photo+".jpg\" alt=\""+titre_+"\" title=\""+titre_+"\" style=\"border: 5px solid rgb(102, 51, 0) ; width: 332px; height: 500px;\">") ;
////    document.write("</a>") ;
  }
  document.write("</div>") ;
}

function
bouton_changement() {
//  document.write("<a class=\"bouton\" href=\"#\" onclick=\"parent.temoin.pokescope = (!parent.temoin.pokescope) ; parent.menu.maj_boutons() ; location.reload() ;\">") ;
  document.write("<a class=\"bouton\" href=\"JavaScript:parent.temoin.pokescope = (!parent.temoin.pokescope) ; parent.menu.maj_boutons() ; location.reload() ;\">") ;
  if (parent.temoin.pokescope) 
    document.write("Anaglyphes") ;
  else
    document.write("Vues c&ocirc;te &agrave; c&ocirc;te") ;
  document.write("</a>&nbsp;") ;
}

