// zoom.js

var coeff=1.2;//Coefficient de reduction
var larg=130;//largeur maxi de l'image
var haut=75;//hauteur maxi de l'image
var coeffinit=coeff;

function changer(sel) {
switch(sel){
case 1 : //image 1
if (document.image1.width < larg) {
coeff = coeff-0.2;
document.image1.width = Math.round(larg/coeff);
document.image1.height = Math.round(haut/coeff);
chang=window.setTimeout('changer(1);',60);//vitesse de l'effet
}
break;
case 2 : //image 2
if (document.image2.width < larg) {
coeff = coeff-0.2;
document.image2.width = Math.round(larg/coeff);
document.image2.height = Math.round(haut/coeff);
chang=window.setTimeout('changer(2);',60);//vitesse de l'effet
}
break;
case 3 : //image 3
if (document.image3.width < larg) {
coeff = coeff-0.2;
document.image3.width = Math.round(larg/coeff);
document.image3.height = Math.round(haut/coeff);
chang=window.setTimeout('changer(3);',60);//vitesse de l'effet
}
break;
case 4 : //image 4
if (document.image4.width < larg) {
coeff = coeff-0.2;
document.image4.width = Math.round(larg/coeff);
document.image4.height = Math.round(haut/coeff);
chang=window.setTimeout('changer(4);',60);//vitesse de l'effet
}
break;
case 5 : //image 5
if (document.image5.width < larg) {
coeff = coeff-0.2;
document.image5.width = Math.round(larg/coeff);
document.image5.height = Math.round(haut/coeff);
chang=window.setTimeout('changer(5);',60);//vitesse de l'effet
}
break;
//images suivantes ...
}
if (document.image2.width >= larg) window.clearTimeout(chang);
}




function initial(sel) {
switch(sel){
case 1 : //image 1
if (document.image1.width > larg/coeffinit) {
window.clearTimeout(chang);
coeff = coeff+0.2;
document.image1.width = Math.round(larg/coeff);
document.image1.height = Math.round(haut/coeff);
initi=window.setTimeout('initial(1);',6000);//vitesse de l'effet
}
break;
case 2 : //image 2
if (document.image2.width > larg/coeffinit) {
window.clearTimeout(chang);
coeff = coeff+0.2;
document.image2.width = Math.round(larg/coeff);
document.image2.height = Math.round(haut/coeff);
initi=window.setTimeout('initial(2);',60);//vitesse de l'effet
}
break;
case 3 : //image 3
if (document.image3.width > larg/coeffinit) {
window.clearTimeout(chang);
coeff = coeff+0.2;
document.image3.width = Math.round(larg/coeff);
document.image3.height = Math.round(haut/coeff);
initi=window.setTimeout('initial(3);',60);//vitesse de l'effet
}
break;
case 4 : //image 4
if (document.image4.width > larg/coeffinit) {
window.clearTimeout(chang);
coeff = coeff+0.2;
document.image4.width = Math.round(larg/coeff);
document.image4.height = Math.round(haut/coeff);
initi=window.setTimeout('initial(4);',60);//vitesse de l'effet
}
break;
case 5 : //image 5
if (document.image5.width > larg/coeffinit) {
window.clearTimeout(chang);
coeff = coeff+0.2;
document.image5.width = Math.round(larg/coeff);
document.image5.height = Math.round(haut/coeff);
initi=window.setTimeout('initial(5);',60);//vitesse de l'effet
}
break;
//images suivantes ...
}
if (document.image1.width < larg/4) window.clearTimeout(initi);
}

