var chang;
var coeff=3;//Coefficient de reduction
var larg=200;//largeur maxi de l'image
var haut=194;//hauteur maxi de l'image
function install(src) {
switch(src){
case 0 : //image 1
document.image1.width = Math.round(larg/coeff);
document.image1.height = Math.round(haut/coeff);
break;
case 1 : //image 1
document.image2.width = Math.round(larg/coeff);
document.image2.height = Math.round(haut/coeff);
break;
case 2: //image 1
document.image3.width = Math.round(larg/coeff);
document.image3.height = Math.round(haut/coeff);
break;
case 3 : //image 1
document.image4.width = Math.round(larg/coeff);
document.image4.height = Math.round(haut/coeff);
break;
}
}
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 3
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; 
//images suivantes ...
}
if (document.image4.width >= larg) window.clearTimeout(chang);
} 
function initial(sel) {
switch(sel){
case 1 : //image 1
if (document.image1.width > larg/4) {
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);',60);//vitesse de l'effet
}
break;
case 2 : //image 2
if (document.image2.width > larg/4) {
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/4) {
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 3
if (document.image4.width > larg/4) {
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;
//images suivantes ...
}
if (document.image1.width < larg/4) window.clearTimeout(initi);
}
