var opaciteDIV = 0 //opacitй de la div organites
var opaciteINFOS = 0 //opacitй de la div informations
var INFOS _affiche = false //bool pour la fonction clicINFOS()
var t _div //pour les setinterval d'animation
var t _inf
var tempsAnim = 25 //durйe en milisecondes des animations de fondu
var t _aura //pour l'animation de l'aura au passage de la souris
var opaciteAura = 0 // idem que t_aura
var noyauSel = false //pour pouvoir accиder а l'ADN depuis le noyau
var loupe _on = false // permet d'accйder aux zooms de l'ADN et de l'ARN
var interactif _on = false // permet d'accйder aux parties interactives s'il y en a
var elt _a _zoomer = "" //pour savoir s'il faut afficher adn_zoom.jpg ou arn_zoom.jpg
var ZOOM _affiche = false //pour savoir si la div de zoom est affichйes ou pas
var opaciteZOOM = 0
var t _zoom
var loaded = true
var click _INFO = false ;
var click _ZOOM = false ;
var click _EXIT = true ;
var click _Cacher = true ;
function vesicule ( ) {
loupe _on = false
//console.log("vesicule");
afficherInfosOrganite ( txt _vesicule )
document . getElementById ( "img_organite" ) . src = "images/vesic_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function lysosome ( ) {
loupe _on = false
//console.log("lysosome");
afficherInfosOrganite ( txt _lysosome )
document . getElementById ( "img_organite" ) . src = "images/lys_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function mitoch ( ) {
loupe _on = false
//console.log("mitoch");
afficherInfosOrganite ( txt _mitoch )
document . getElementById ( "img_organite" ) . src = "images/mitoch_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function golgi ( ) {
loupe _on = false
//console.log("golgi");
afficherInfosOrganite ( txt _golgi )
document . getElementById ( "img_organite" ) . src = "images/golgi_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function rer ( ) {
loupe _on = false
//console.log("rer");
afficherInfosOrganite ( txt _rer )
document . getElementById ( "img_organite" ) . src = "images/rer_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function noy ( ) {
loupe _on = false
//console.log("noy");
afficherInfosOrganite ( txt _noy )
document . getElementById ( "img_organite" ) . src = "images/noy_in.jpg"
noyauSel = true
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function rel ( ) {
loupe _on = false
//console.log("rel");
afficherInfosOrganite ( txt _rel )
document . getElementById ( "img_organite" ) . src = "images/rel_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function adn ( ) {
//console.log("adn");
if ( noyauSel ) {
elt _a _zoomer = "ADN"
loupe _on = true
noyauSel = false
afficherInfosOrganite ( txt _adn )
document . getElementById ( "div_zoom" ) . innerHTML = '<img src="images/' + elt _a _zoomer + '_zoom.jpg" alt="" />'
/*Uniboard 4 ne supportant pas bien les gifs...*/
if ( window . sankore ) {
document . getElementById ( "img_ADN" ) . src = "images/adn.jpg"
} else {
document . getElementById ( "img_ADN" ) . src = "images/ADN.gif"
}
document . getElementById ( "img_organite" ) . src = "images/fond_ADN.png"
document . getElementById ( "div_organite" ) . style . zIndex = "3"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
document . getElementById ( "div_ADN" ) . style . zIndex = "2"
}
}
function rib ( ) {
interactif _on = "ARN"
loupe _on = false
//console.log("rib");
afficherInfosOrganite ( txt _rib )
document . getElementById ( "img_organite" ) . src = "images/rib_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function centriole ( ) {
loupe _on = false
//console.log("centriole");
afficherInfosOrganite ( txt _centr )
document . getElementById ( "img_organite" ) . src = "images/centriole_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
function arn ( ) {
elt _a _zoomer = "ARN"
loupe _on = true
//console.log("arn");
afficherInfosOrganite ( txt _arn )
document . getElementById ( "div_zoom" ) . innerHTML = '<img src="images/' + elt _a _zoomer + '_zoom.jpg" alt="" />'
document . getElementById ( "img_organite" ) . src = "images/ARN_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
}
function nucl ( ) {
loupe _on = false
//console.log(" nucl");
afficherInfosOrganite ( txt _nucl )
document . getElementById ( "img_organite" ) . src = "images/nucl_in.jpg"
document . getElementById ( "div_organite" ) . style . zIndex = "1"
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
t _div = setInterval ( afficherDIV , tempsAnim )
}
/*Fonctions relatives а la div d'infos*/
function infos ( ) {
//console.log(" infos");
if ( ! INFOS _affiche && ! click _INFO ) {
document . getElementById ( "div_infos" ) . style . zIndex = "4"
t _inf = setInterval ( afficherINFOS , 50 )
click _INFO = true ;
}
}
function afficherINFOS ( ) {
//console.log("afficherINFOS");
if ( opaciteINFOS < 1 ) {
opaciteINFOS = opaciteINFOS + 0.1
document . getElementById ( "div_infos" ) . style . opacity = opaciteINFOS
} else {
clearInterval ( t _inf ) ;
INFOS _affiche = true
}
}
function clicINFOS ( ) {
if ( INFOS _affiche && click _INFO ) {
//console.log("INFOS_affiche");
t _inf = setInterval ( cacherINFOS , 50 )
click _INFO = false ;
}
if ( ZOOM _affiche && click _ZOOM ) {
//console.log("ZOOM_affiche");
t _zoom = setInterval ( cacherZOOM , 50 )
click _ZOOM = false ;
}
}
function cacherINFOS ( ) {
//console.log("cacherINFOS");
if ( opaciteINFOS > 0 ) {
opaciteINFOS = opaciteINFOS - 0.1
document . getElementById ( "div_infos" ) . style . opacity = opaciteINFOS
} else {
document . getElementById ( "div_infos" ) . style . zIndex = "-1"
clearInterval ( t _inf )
INFOS _affiche = false
}
}
/*Animations pour la div de zoom*/
function loupe _interact ( ) {
//console.log("loupe_interact");
if ( loupe _on && ! ZOOM _affiche ) {
zoom ( )
}
if ( interactif _on ) {
}
if ( interactif _on == "ARN" ) {
arn ( )
}
}
function zoom ( ) {
//console.log("zoom");
document . getElementById ( "div_zoom" ) . style . zIndex = "4"
t _zoom = setInterval ( afficherZOOM , 50 ) ;
ZOOM _affiche = true ;
}
function afficherZOOM ( ) {
//console.log("afficherZOOM");
if ( opaciteZOOM < 1 ) {
opaciteZOOM = opaciteZOOM + 0.1
document . getElementById ( "div_zoom" ) . style . opacity = opaciteZOOM
} else {
clearInterval ( t _zoom )
ZOOM _affiche = true
click _ZOOM = true ;
}
}
function cacherZOOM ( ) {
//console.log("cacherZOOM");
if ( opaciteZOOM > 0 ) {
opaciteZOOM = opaciteZOOM - 0.1
document . getElementById ( "div_zoom" ) . style . opacity = opaciteZOOM
} else {
document . getElementById ( "div_zoom" ) . style . zIndex = "-2"
clearInterval ( t _zoom )
ZOOM _affiche = false
}
}
/*Animations relatives а la div organites*/
function afficherDIV ( ) {
if ( click _EXIT ) {
//console.log("afficherDIV");
if ( opaciteDIV < 1 ) {
opaciteDIV = opaciteDIV + 0.1
document . getElementById ( "div_organite" ) . style . opacity = opaciteDIV
} else {
clearInterval ( t _div )
click _EXIT = false ;
click _Cacher = true ;
}
}
}
function cacherDIV ( ) {
if ( ! click _EXIT ) {
//console.log("cacherDIV");
interactif _on = false
noyauSel = false
document . getElementById ( "div_ADN" ) . style . zIndex = "-2"
document . getElementById ( "img_ADN" ) . src = ""
if ( opaciteDIV > 0 ) {
opaciteDIV = opaciteDIV - 0.1
document . getElementById ( "div_organite" ) . style . opacity = opaciteDIV
} else {
document . getElementById ( "div_organite" ) . style . zIndex = "-1" ;
clearInterval ( t _div )
click _EXIT = true ;
}
}
}
function cacherDivFunction ( ) {
if ( ! click _EXIT && click _Cacher ) {
t _div = setInterval ( cacherDIV , 50 ) ;
click _Cacher = false ;
}
}
function afficherInfosOrganite ( nomOrg ) {
//console.log("afficherInfosOrganite");
document . getElementById ( "div_infos" ) . innerHTML = nomOrg
}
/ * A n i m a t i o n d ' i n t r o
function intro ( ) {
if ( opaciteDIV < 1 ) {
opaciteDIV = opaciteDIV + 0.1
document . getElementById ( "div_body" ) . style . opacity = opaciteDIV
} else {
opaciteDIV = 0
clearInterval ( t _div )
}
} * /
/*Affichage de l'aura au passage de la souris*/
function aura ( txt ) {
//console.log("aura");
document . getElementById ( "div_aura" ) . style . zIndex = "2"
document . getElementById ( "img_aura" ) . src = "images/" + txt + "_aura.png"
t _aura = setInterval ( animAura , tempsAnim )
}
function animAura ( ) {
//console.log("animAura");
if ( opaciteAura < 1 ) {
opaciteAura = opaciteAura + 0.1
document . getElementById ( "div_aura" ) . style . opacity = opaciteAura
} else {
opaciteAura = 0
clearInterval ( t _aura )
}
}
function auraOut ( ) {
//console.log("auraOut");
clearInterval ( t _aura )
document . getElementById ( "div_aura" ) . style . opacity = 0
document . getElementById ( "div_aura" ) . style . zIndex = "-1"
document . getElementById ( "img_aura" ) . src = ""
}