1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| function affCache(num) {
//* pour recuperer tous les elements dont l'id est 0 ou 0*
//A voir si cela ne devrait pas être 0.+
var expReg ="^"+num+"*";
table = document.getElementsByReg('tr','id',expReg);
var temp ="";
var temp2 = "";
if((table[0].style.display == '') || !(table[0].style.display)){
for(i = 0; i < table.length; i++)
{
table[i].style.display = 'none';
temp2 = table[i].id;
temp2 = temp2 + "";
temp2 = temp2.substr(0, table[i].id.length-1);
temp = "cat" + temp2;
var tabImg = window.document.getElementsByTagName('img');
alert(tabImg.length);
for(j=0; j<tabImg.length;j++)
{
alert(tabImg[j].id);
if( tabImg[j].id == temp)
{
tabImg[j].src = "media/kitplus.gif";
}
}
}
else {
}
} |