//JS Page d'accueil
//ANIMATIONS DES CADRES PAGE D'ACCUEIL
function scaleDiv(height, current, id) {
var divID = "i_prj"+id;
var bgID = "prj"+id;
var pID = "p_prj"+id;
document.getElementById(divID).style.display = "block";
document.getElementById("prj1").style.opacity='0.7';
document.getElementById("prj1").style.filter='alpha(opacity=70)';
document.getElementById("prj2").style.opacity='0.7';
document.getElementById("prj2").style.filter='alpha(opacity=70)';
document.getElementById("prj3").style.opacity='0.7';
document.getElementById("prj3").style.filter='alpha(opacity=70)';
document.getElementById("prj4").style.opacity='0.7';
document.getElementById("prj4").style.filter='alpha(opacity=70)';
document.getElementById("prj5").style.opacity='0.7';
document.getElementById("prj5").style.filter='alpha(opacity=70)';
document.getElementById("prj6").style.opacity='0.7';
document.getElementById("prj6").style.filter='alpha(opacity=70)';
document.getElementById(bgID).style.opacity='1';
document.getElementById(bgID).style.filter='alpha(opacity=100)';
doScale(height, current, id);
}

function doScale(height, current, id) {
var divID = "i_prj"+id;
var bgID = "prj"+id;
var pID = "p_prj"+id;
if (current <= height) { 
i = current + 1; 
document.getElementById(divID).style.height = i+"px";
if(i==height){ document.getElementById(pID).style.display="block";}
}
if (i < height) { 
var t = window.setTimeout("doScale("+height+", "+i+", "+id+")", 5); 
}
else { document.getElementById(divID).style.height = height+"px"; }
}

function unscaleDiv(height, current, id) {
var divID = "i_prj"+id;
var pID = "p_prj"+id;
document.getElementById(pID).style.display="none";
document.getElementById(divID).style.display = "block";
document.getElementById("prj1").style.opacity='1';
document.getElementById("prj1").style.filter='alpha(opacity=100)';
document.getElementById("prj2").style.opacity='1';
document.getElementById("prj2").style.filter='alpha(opacity=100)';
document.getElementById("prj3").style.opacity='1';
document.getElementById("prj3").style.filter='alpha(opacity=100)';
document.getElementById("prj4").style.opacity='1';
document.getElementById("prj4").style.filter='alpha(opacity=100)';
document.getElementById("prj5").style.opacity='1';
document.getElementById("prj5").style.filter='alpha(opacity=100)';
document.getElementById("prj6").style.opacity='1';
document.getElementById("prj6").style.filter='alpha(opacity=100)';
undoScale(height, current, id);
}

function undoScale(height, current, id) {
var divID = "i_prj"+id;
var bgID = "prj"+id;
var pID = "p_prj"+id;
document.getElementById(pID).style.display="none";
if (current != height) { 
i = current - 1; 
document.getElementById(divID).style.height = i+"px";
}
if (i > height) { 
var t = window.setTimeout("undoScale("+height+", "+i+", "+id+")", 5); 
} else { document.getElementById(divID).style.height = height+"px";
}
}
