
var imgnum;

function preload_img_produit(nomproduit,total){
	var myimages=new Array();
	var total;
	if (execute == 1) {
		for (i=0; i<total; i++) {
			myimages[i]=new Image();
			myimages[i].src='/img/' + nomproduit + (i+1) + '.gif';
		}
		interval=setInterval("anim('" + nomproduit + "' , " + total + " )",1000);
	}
	execute = 0;
}

function anim( nomproduit , total ) {
	if (imgnum <= total ) {
		document.img_produit.src= '/img/' + nomproduit + imgnum + '.gif';
		imgnum++;
	}
	else {
		imgnum = 1;
		//clearInterval(interval);
	}
}

function fixecouleur(nomproduit,numcouleur) {
	if (interval) {
		clearInterval(interval);
	}
	document.img_produit.src='img/' + nomproduit + numcouleur + '.gif';
}
