// Liste des albums
// (c) Cpt Harddock 2004-2008
// http://www.thorgal-bd.fr/

var place=new Array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var morceau=new Array (8,8,8,8,8,8,8,8,8,8,8);

function ouvrir_fermer(quoi,combien){
if (window.monte)clearInterval(monte);

if(document.all){
for(i=1;i<=combien;i++){document.all("choix"+i).style.border="2px dotted #fffebb";}
document.all("choix"+quoi).style.border="2px solid black";
var i= morceau[0];
if (i!=quoi&&morceau[i]>9){
morceau[i]-=10;
document.all("cache"+i).style.height=morceau[i];
} else {
morceau[0]=quoi;
if (morceau[quoi]<298){
morceau[quoi]+=10;
document.all("cache"+quoi).style.height=morceau[quoi];}}
}

if(!document.all){
for(i=1;i<=combien;i++){document.getElementById("choix"+i).style.border="2px dotted #fffebb";}
document.getElementById("choix"+quoi).style.border="2px solid black";
var i= morceau[0];
if (i!=quoi&&morceau[i]>9){
morceau[i]-=10;
document.getElementById("cache"+i).style.height=morceau[i];
} else {
morceau[0]=quoi;
if (morceau[quoi]<298){
morceau[quoi]+=10;
document.getElementById("cache"+quoi).style.height=morceau[quoi];}}
}
monte=setInterval("ouvrir_fermer("+quoi+")",20);
}

function defiler(qui,sens,combien){
if (sens==0){
if (window.haut)clearInterval(haut);
if (window.bas)clearInterval(bas);
return;}

if (sens==1&&place[qui]>=-combien){
if (window.haut)clearInterval(haut);
if (window.bas)clearInterval(bas);
place[qui]-=8;
if(document.all)document.all("partie"+qui).style.pixelTop=place[qui];
if(!document.all)document.getElementById("partie"+qui).style.top=place[qui];
haut=setInterval("defiler("+qui+",1,"+combien+")",25);
}
if (sens==2&&place[qui]<0){
if (window.haut)clearInterval(haut);
if (window.bas)clearInterval(bas);
place[qui]+=8;
if(document.all)document.all("partie"+qui).style.pixelTop=place[qui];
if(!document.all)document.getElementById("partie"+qui).style.top=place[qui];
bas=setInterval("defiler("+qui+",2)",25);
}}

function titre(alb){
if(document.all){
if (alb==0){
document.all("ombre").innerHTML="";
document.all("nombre").innerHTML="";
document.all("couv").innerHTML="";
return;}
document.all("ombre").innerHTML="<b><i><font size='5' face='Arial' color='#F0990C'>"+alb+"</font></i></b>";
document.all("nombre").innerHTML="<b><i><font size='5' face='Arial' color='black'>"+alb+"</font></i></b>";
document.all("couv").innerHTML="<img border='1' src='images/couverture/mini"+alb+".jpg' width='50' height='68'>";
}
if(!document.all){
if (alb==0){
document.getElementById("ombre").innerHTML="";
document.getElementById("nombre").innerHTML="";
document.getElementById("couv").innerHTML="";
return;}
document.getElementById("ombre").innerHTML="<b><i><font size='5' face='Arial' color='#F0990C'>"+alb+"</font></i></b>";
document.getElementById("nombre").innerHTML="<b><i><font size='5' face='Arial' color='black'>"+alb+"</font></i></b>";
document.getElementById("couv").innerHTML="<img border='1' src='images/couverture/mini"+alb+".jpg' width='50' height='68'>";
}
}

function souris(e){
if(document.all){
document.all("ombre").style.pixelTop=150+document.body.scrollTop;
document.all("nombre").style.pixelTop=152+document.body.scrollTop;
document.all("couv").style.pixelTop=80+document.body.scrollTop;
}
if(!document.all){
document.getElementById("ombre").style.top=150+document.body.scrollTop;
document.getElementById("nombre").style.top=152+document.body.scrollTop;
document.getElementById("couv").style.top=80+document.body.scrollTop;
}
}

function au_milieu(i,w){
if (document.all){
document.all("cache"+i).style.pixelLeft=(document.body.clientWidth-(w+40))/2;
var ou=(document.body.clientHeight-240)/2;
if (ou<180)ou=180;
if (i==0)ou=ou-80;
document.all("cache"+i).style.pixelTop=ou;
}
if (!document.all){
document.getElementById("cache"+i).style.left=(window.innerWidth-(w+40))/2;
var ou=(window.innerHeight-240)/2;
if (ou<180)ou=180;
if (i==0)ou=ou-80;
document.getElementById("cache"+i).style.top=ou;
}}

function depart(nomb){
if (document.all)for (i=1;i<=nomb;i++){document.all("cache"+i).style.height=8;}
if (!document.all)for (i=1;i<=nomb;i++){document.getElementById("cache"+i).style.height=8;}
for(i=0;i<=nomb;i++)au_milieu(i,558);
ouvrir_fermer(1);
}