<!--
//
// declaration variables globales
var narray_obj=new Array();
var nvout;
var mavar;
var ploading=0;
var objphoto=0;

function mytestbutton(){
	monimage=eval("document.images."+this._name);
	if (this.roll!=2 && this.roll==1){
		monimage.src=this.nomoff.src;
		}else{
		monimage.src=this.nom.src;
	}
}
//
function mychangeroll(){
	if (this.roll!=2){
		this.roll=1;
	}
}
function myremiseazero(){
	if (this.roll!=2){
		this.roll=0;
		monimage=eval("document.images."+this._name);
		monimage.src=this.nom.src;
	}
}
function gestionphoto(){
	objphoto=new prechargephoto();
}
//
function prechargephoto(){
	this.preload=0;
	this.ind=0;
	this.anim=0;
	// prechargement de l'image vide
	var img=new Image();
	img.src="/images/p_vide.gif";
	//
	if (document.images){
		this.p_array=new Array();
		this.p_src=new Array(5);
		this.p_src[0]="/produit/images/visu_01.gif";
		this.p_src[1]="/produit/images/visu6.gif";
		this.p_src[2]="/produit/images/visu_gnocchis.gif";
		this.p_src[3]="/produit/images/visu_nouv4.gif";
		this.p_src[4]="/produit/images/p_quenelles.gif";
		for (var i=0;i<=5;i++){
			this.bt_obj=new Object();
			var img=new Image();
			img.src=this.p_src[i];
			this.bt_obj.res=img.src;
			this.p_array.push(this.bt_obj);
		}
		this.anim=setInterval("objphoto.diapos()",2000);
		this.preload=1;
		//this.diapos();
	}
}
//
prechargephoto.prototype.diapos=function(){
	document.images.bigfoto.src=this.p_array[this.ind].res;
	//alert ("toto");
	this.ind++;
	if (this.ind>5){
		this.ind=0;
	}
	return true;
}
//
//
function liste(a){
	mavar=a;
	winliste=window.open("/produit/liste_produit/frsmset_list.htm","liste_produit","resizable=no, menubar=no,height=500,width=700");
	winliste.mavar=a;
	//titi=window("liste_produit");
	winliste.focus();
}
//prechargephoto.prototype.myalert=function(){
//alert(this.ind);
//}
//
//

function rollovernew(img){
	if (ploading==1){
		var myindex=rechobj(img);
		if(myindex!=null){
			monimage=eval("document.images."+img);
			monimage.src=narray_obj[myindex].nomon.src;
			narray_obj[myindex].roll=2;
		}
		if ((document.images.bigfoto)&&(objphoto!=0)){
			objphoto.ind=myindex;
			objphoto.diapos();
			clearInterval(objphoto.anim);
		}
	}
}

//
function rolloutnew(img){
	if (ploading==1){
		if(nvout!=null){
			monimage=eval("document.images."+narray_obj[nvout]._name);
			monimage.src=narray_obj[nvout].nomoff.src;
			narray_obj[nvout].roll=1;
			remiseazero();
		}
		if ((document.images.bigfoto)&&(objphoto!=0)){
			// detruit le timer si la souris est entre sur l'image sans faire le rollover
			clearInterval(objphoto.anim);
			objphoto.anim=setInterval("objphoto.diapos()",2000);
		}
	}
}
//
function remiseazero(){
	if (ploading==1){
		for (i=0;i<=6;i++){
			if (narray_obj[i]._name!=noroll){
				narray_obj[i].remiseazero();
				}else{
				monimage=eval("document.images."+narray_obj[i]._name);
				monimage.src=narray_obj[i].nomon.src;
			}
		}
	}
}
//
function rechobj(img){
	a=null;
	for (i=0;i<=6;i++){
		narray_obj[i].changeroll();
		narray_obj[i].testbutton();
		if (narray_obj[i]._name==img){
			nvout=i;
			a=i;
		}
	}
	return a;
}
//
//-->