<!--
n = (document.layers) ? 1:0
ie = (document.all) ? 1:0

	

function ExistLayer_old(LyrName){
	RetObj=0;
	if(document.all && document.all[LyrName]) RetObj=1;
	else if(!document.all && document.layers[LyrName]) RetObj=1;
	return RetObj;}

// recupere la position d'une ancre ds 1 layer
function readLayerAnchorY(LyrName,AnchorName){
 if (n) topCale=eval('document.layers.'+LyrName+'.document.anchors.'+ AnchorName +'.y');
 if (ie) { var findbody="";
			 		  var chemin='document.all.'+AnchorName+'.';
			 		  var topCale=0;
			  		  while (findbody!="DIV")
			 		  {	findbody=eval(chemin+'tagName');
					  	topCale+=(findbody=="TR" || findbody=="DIV")? 0: parseInt(eval(chemin+'offsetTop'));		 
			 			chemin+='parentElement.'; }}
 return topCale; 
}

//deplace le layer en fct l'ancre
var PosClipTopLyr=0;

function deplaceLyr(AnNme){
	if (AnNme=="haut") 	DefilText('text1', Clip('text1','top'));
	DefilText('text1', -readLayerAnchorY('text1',AnNme)+PosClipTopLyr);
}

function deplaceLyrDeux(AnNme,LyrNme){
	if (AnNme=="haut2") DefilText(LyrNme, Clip(LyrNme,'top'));
	scrollPos=(document.all)? parseInt((readLayerAnchorY(LyrNme,AnNme)+PosClipTopLyr)/2):readLayerAnchorY(LyrNme,AnNme);
	DefilText(LyrNme, -scrollPos);			
}

// fixe la position du layer sur l'ancre 
function AnchorFix_old (LyrNme, AnchorNme, AjustLT ){
			if(!AjustLT) { AjustLT=AnchorNme; AnchorNme=LyrNme; LyrNme=false;}			
			AjustLT.toLowerCase(); ie=(document.all)? 1:0; Achleft=0; Achtop=0;
			if (AjustLT!="") { eval("var Ach"+AjustLT.replace(/\u002C/gi,"\u003Bvar Ach"));
								Achleft=(Achleft)? Achleft:0; Achtop=(Achtop)? Achtop:0;
								if (AjustLT.indexOf("left")!=-1 && AjustLT.indexOf("top")!=-1) AnchorFix (LyrNme, AnchorNme, "top="+Achtop);}
			lequel=(AjustLT.indexOf("left")!=-1)? (ie)?"Left":"left":(ie)?"Top":"top";
			if (ie) { var chemin='document.all.'+AnchorNme+'.'; valeur=0;
			 		  while (eval(chemin+'tagName')!="BODY")
			 		  {	valeur+=(lequel=="Top" && eval(chemin+'tagName')=="TR" || eval(chemin+'tagName')=="CENTER")? 0: parseInt(eval(chemin+'offset'+lequel));		 
			 			if (arguments.length==4) { alert(eval(chemin+'tagName')+" "+valeur);}
			 			chemin+='parentElement.'; }}
			else {	chemin=document.layers; AnchorNme='document.anchors.'+AnchorNme
					if (eval(AnchorNme)) valeur=(lequel=="left")? parseInt(eval(AnchorNme+'.x')): parseInt(eval(AnchorNme+'.y'));
					else { for (i=0; i<document.layers.length; i++)
								if (chemin[i].document.anchors && eval('chemin[i].'+AnchorNme)) valeur=(lequel=="left")? eval('chemin[i].'+AnchorNme+'.x')+ chemin[i].left:eval('chemin[i].'+AnchorNme+'.y')+ chemin[i].top;}}
			valeur+=(lequel=="left" || lequel=="Left")? Achleft:Achtop;
			way=(ie)? ('document.all.'+LyrNme+'.style.pixel'+lequel):('document.layers.'+LyrNme+'.'+lequel);
			if (LyrNme) eval(way+'='+valeur);
			if (arguments.length>2) LayerFunc(LyrNme, 'visibility', 'visible');
			return valeur;		
}
 
function AnchorFixN(LyrName, AncreName, PosLeftTop)
{
	Achleft=0; Achtop=0; eval("var Ach"+PosLeftTop.replace(/\u002C/gi,"\u003Bvar Ach")); Achleft=(Achleft)? Achleft:0; Achtop=(Achtop)? Achtop:0; 
	if (document.all && !document.all[AncreName+"InAnchorPos"]) {
			IeMac=(navigator.appVersion.indexOf("MSIE")!=-1 && navigator.appVersion.indexOf("Mac")!=-1)?1:0;
			document.all[AncreName].correctLeft=(IeMac && document.all[AncreName].offsetParent.align=="center")? parseInt(document.all[AncreName].offsetWidth/2):0;
			if (IeMac) document.all[AncreName].innerHTML='<table cellpadding=0 cellspacing=0 border=0><tr><td><div id="'+AncreName+'InAnchorPos" style="position:absolute; visibility:visible"></div></td></tr></table>'+document.all[AncreName].innerHTML;	
			else document.all[AncreName].innerHTML='<div id="'+AncreName+'InAnchorPos" style="position:absolute; visibility:hidden"></div>'+document.all[AncreName].innerHTML;}		
	if (!document.all) { calk=false;
		if (document.anchors && document.anchors[AncreName]) cheminAncre=document.anchors[AncreName]; 
		else for (i=0; i<document.layers.length; i++) if (document.layers[i].document.anchors[AncreName]) { cheminAncre=document.layers[i].document.anchors[AncreName]; calk=document.layers[i].name;}
		if (PosLeftTop.indexOf("left")!=-1) document.layers[LyrName].left=cheminAncre.x-2+Achleft+((calk)? document.layers[calk].left:0);
		if (PosLeftTop.indexOf("top")!=-1) document.layers[LyrName].top=cheminAncre.y-2+Achtop+((calk)? document.layers[calk].top:0);}
	else { correctDiv=(document.all[AncreName+"InAnchorPos"].offsetParent.tagName=="DIV")? document.all[AncreName+"InAnchorPos"].offsetParent.style:false;
		   Achleft+=(correctDiv)? correctDiv.pixelLeft:0; Achtop+=(correctDiv)? correctDiv.pixelTop:0;
		if (PosLeftTop.indexOf("left")!=-1) setTimeout(LyrName+".style.pixelLeft="+AncreName+"InAnchorPos.offsetLeft+"+(Achleft-document.all[AncreName].correctLeft),1);
		if (PosLeftTop.indexOf("top")!=-1)	setTimeout(LyrName+".style.pixelTop="+AncreName+"InAnchorPos.offsetTop+"+Achtop,1); 
		}
	 Layer(LyrName, "visibility", "visible");			
}

// affiche le layer
function Layer(LyrNme, param, valeur){
	var ie=(document.all)?1:0; 
	param=param.toLowerCase();lecture=(valeur || valeur>-1 || valeur=="")? false:true;
	if (param.indexOf('move')!=-1) { lequel=(param.indexOf('left')!=-1)? "left":"top";
									 Layer(LyrNme, lequel, Layer(LyrNme, lequel) + parseInt(valeur))}
	else {	
		if (param=="zindex") param="zIndex";
		if (ie) IeCase=param.substring(0,1).toUpperCase()+param.substring(1)
		way=(ie)? 'document.all.'+LyrNme:'document.layers.'+LyrNme;
		way+=(ie)? (lecture)? (param=="left" || param=="top")? '.style.pixel'+IeCase:'.offset'+IeCase:'.style.'+param:(param=="height" || param=="width")?'.document.'+param:'.'+param;
		Integer=(param=="zindex" || param=="height" || param=="width")? true:false;
		if (!lecture) eval(way+'="'+valeur+'"'); 
		return (Integer)? parseInt(eval(way)):eval(way);
	}
}

function LayerFunc(LyrNme, param, valeur){
	var ie=(document.all)?1:0; 
	param=param.toLowerCase();lecture=(valeur || valeur>-1 || valeur=="")? false:true;
	if (param.indexOf('move')!=-1) { lequel=(param.indexOf('left')!=-1)? "left":"top";
									 Layer(LyrNme, lequel, Layer(LyrNme, lequel) + parseInt(valeur))}
	else {	
		if (param=="zindex") param="zIndex";
		if (ie) IeCase=param.substring(0,1).toUpperCase()+param.substring(1)
		way=(ie)? 'document.all.'+LyrNme:'document.layers.'+LyrNme;
		way+=(ie)? (lecture)? (param=="left" || param=="top")? '.style.pixel'+IeCase:'.offset'+IeCase:'.style.'+param:(param=="height" || param=="width")?'.document.'+param:'.'+param;
		Integer=(param=="zindex" || param=="height" || param=="width")? true:false;
		if (!lecture) eval(way+'="'+valeur+'"'); 
		return (Integer)? parseInt(eval(way)):eval(way);
	}
}



// fait defiler le text 
function DefilText(LyrNme, speed){
		ie=(document.all)? 1:0;
		way=(ie)?document.all[LyrNme].style:document.layers;
		if (navigator.appVersion.indexOf("MSIE 4.5")!=-1 && navigator.appVersion.indexOf("Mac")!=-1){
			clipzone=way.clip.substring(way.clip.indexOf("\u0028")+1,way.clip.lastIndexOf("\u0029")).replace(/ /gi,"\u002c");
			clipzone=eval('new Array('+clipzone+')'); }
		else clipzone=(ie)? eval('new Array('+way.clip.substring(way.clip.indexOf("\u0028")+1, way.clip.length-3).replace(/px/gi,"\u002c")+'0)'):new Array(way[LyrNme].clip.top,way[LyrNme].clip.right,way[LyrNme].clip.bottom,way[LyrNme].clip.left);
		hauteur=(ie)? parseInt(eval('document.all["'+LyrNme+'"].offsetHeight')):way[LyrNme].document.height;
		if ((clipzone[2]-speed)>hauteur){
			diff=(clipzone[2]-speed)-hauteur;
			speed+=diff;			
		}		
		clipzone[0]-=speed; clipzone[2]-=speed; 
		if (clipzone[0]>=0 && clipzone[2]<=hauteur) {
				if (ie) { eval('way.clip="rect('+clipzone[0]+'px '+clipzone[1]+'px '+clipzone[2]+'px '+clipzone[3]+'px)"');
				 		  way.top=parseInt(way.top)+speed;}	
				else { way[LyrNme].clip.top=clipzone[0]; way[LyrNme].clip.bottom=clipzone[2]; way[LyrNme].top+=speed;}
		}
}


function Ascenceur_old(LyrNme, vitesse, direction, run){
        if (LyrNme) {
        //status=LyrNme+", "+vitesse+", "+direction+", "+run;
        
        obj=(document.all)? document.all[LyrNme]:document.layers[LyrNme]; ie=(document.all)?1:0; 
        IeMac4=(navigator.appVersion.indexOf("MSIE 4.5")!=-1 && navigator.appVersion.indexOf("Mac")!=-1)?1:0;
        if (ie) obj.clip=eval('new Array('+obj.style.clip.substring(obj.style.clip.indexOf("\u0028")+1, obj.style.clip.lastIndexOf("\u0029")).replace((IeMac4)?/ /gi:/px/gi,"\u002c")+'0)');
        haut=(ie)?0:"top"; droite=(ie)? 1:"right"; bas=(ie)? 2:"bottom"; gauche=(ie)? 3:"left"; posTop=(ie)? "pixelTop":"top"; posLeft=(ie)? "pixelLeft":"left"; objMove=(ie)?obj.style:obj;            
        largeur=(ie)?obj.offsetWidth:obj.document.width; hauteur=(ie)?obj.offsetHeight:obj.document.height;
        if (direction=="horiz" && obj.clip[gauche]>=(0+vitesse) && obj.clip[droite]<=(largeur+vitesse)) {
                                        obj.clip[gauche]-=vitesse; obj.clip[droite]-=vitesse; objMove[posLeft]+=vitesse;}
        if (direction=="vertic" && obj.clip[haut]>=(0+vitesse) && obj.clip[bas]<=(hauteur+vitesse)) {
                                        obj.clip[haut]-=vitesse; obj.clip[bas]-=vitesse; objMove[posTop]+=vitesse;}
        if (ie) obj.style.clip="rect("+obj.clip[haut]+"px "+obj.clip[droite]+"px "+obj.clip[bas]+"px "+obj.clip[gauche]+"px)";  
        if (arguments.length==4 && !document.run) document.run=run;}
        else document.run=false;
        if (document.run) setTimeout('Ascenceur("'+LyrNme+'", '+vitesse+', "'+direction+'")', 5);       
}

function grollover(nameimg){
	if(document.images){
		if ( document.images[nameimg].src.indexOf('_off.gif') >= 0 ) { 
        	document.images[nameimg].src = pathstart + nameimg + pathon ;
		}		
		else if ( document.images[nameimg].src.indexOf('_on.gif') >= 0 ) { 
            document.images[nameimg].src = pathstart + nameimg + pathoff ;
		}
	}
		
}	

function sesamus(url,nom,top,left,width,height){
	window.open(url,nom,"width="+width+",height="+height+",top="+top+",left="+left+",scrollbars=no");
}

function rollOver(LyrNme,ImgNme,ImgNme2){
	if (arguments.length==3) {  if (document.ImgOn1) document.ImgOn1.src=document.ImgOn1.src.replace(/_on/gi,"_off");
								if (document.ImgOn2) document.ImgOn2.src=document.ImgOn2.src.replace(/_on/gi,"_off");
								document.ImgOn1=(document.all)? document.images[ImgNme]:document.layers[LyrNme].document.images[ImgNme];
								document.ImgOn2=(document.all)? document.images[ImgNme2]:document.layers[LyrNme].document.images[ImgNme2]; 
							    rollOver(LyrNme,ImgNme2); }
								
	if(document.ssRubImgOn) document.ssRubImgOn.src=document.ssRubImgOn.src.replace(/_on/gi,"_off");
	if(document.ImgNme) document.ImgNme.src=document.ImgNme.src.replace(/_on/gi,"_off");
	obj=(document.all)? (arguments.length==1)? document.images[LyrNme]:document.images[ImgNme]:(arguments.length==1)? document.images[LyrNme]:document.layers[LyrNme].document.images[ImgNme];
	if (LyrNme.indexOf('ssrub')!=-1) document.ssRubImgOn=obj;
	if (LyrNme.indexOf('rub')!=-1) document.ssRubImgOn=obj;
	obj.src=(obj.src.lastIndexOf('_on')!=-1)? obj.src.replace(/_on/gi,"_off"):obj.src.replace(/_off/gi,"_on");
}


function changepage(formObject){
	url = formObject.options[formObject.options.selectedIndex].value;
	if(url != "empty"){
		if(top.frames.length==6){
			top.location.href=url;
		}else{
			self.location.href=url;
		}
			url = "";
			document.forms[0].navmenu.selectedIndex=5;		
		//window.open(url,'urla','toolbar=1,scrollbars=1,directories=1,menubar=1,status=1,resizable=1,location=1');
	}	
}

// Defilement Horizontal Produits

function Defil(vitesse, run)
{
	if (!document.noDefil) {
		PosLeft=(document.all)? "pixelLeft":"left";
		for (i=0; i<document.ProdElements.length; i++)
		{
			document.ProdElements[i][PosLeft]+=vitesse;
			
			if (vitesse>0 && document.ProdElements[i][PosLeft]>=document.limiteDefilDroite) {
				document.ProdElements[i][PosLeft]=-100
			}
			if (vitesse<0 && document.ProdElements[i][PosLeft]<=-100) {
				document.ProdElements[i][PosLeft]=document.limiteDefilDroite;		
			}	
		}
		if (run) MoveAnim=setTimeout('Defil('+vitesse+', '+run+')',40);
		if (!run && MoveAnim) clearTimeout(MoveAnim);
		if (arguments.length==1 && MoveAnim) clearTimeout(MoveAnim);	
	}	
}
MoveAnim=false;

function initDefile(){
	// variables de configuration
	var IdGeneriqueDesCalquesProduits="prod";
	var IdCalquesParent="cache";
	var EspaceEntreProduits=40;
	var Largeurzone=336;

	//creation du tablo d'elements
	document.ProdElements=new Array(); PosLeft=(document.all)? "pixelLeft":"left"; PosTop=(document.all)? "pixelTop":"top";
	DocElement=(document.all)? document.all:document.layers[IdCalquesParent].document.layers;
	nom=(document.all)? "id":"name";n=0 
	for (i=0; i<DocElement.length; i++) {
		if(DocElement[i][nom].indexOf(IdGeneriqueDesCalquesProduits)!=-1) {
				document.ProdElements[n]=DocElement[i];				
				if (document.all) {
						document.ProdElements[n].style.width=document.ProdElements[n].offsetWidth;
						document.ProdElements[n]=document.ProdElements[n].style;}
				else document.ProdElements[n].width=document.ProdElements[n].document.width;
				//positionnement des elements
				document.ProdElements[n][PosTop]=0;
				if (document.ProdElements.length >= 2) {					
					if (!n) document.ProdElements[n][PosLeft]=-100;					     
					else document.ProdElements[n][PosLeft]=document.ProdElements[n-1][PosLeft]+55+EspaceEntreProduits;				
				}
				else if (!n)
					{document.ProdElements[n][PosLeft]=10;}					
				document.limiteDefilDroite=document.ProdElements[n][PosLeft]+55+EspaceEntreProduits;				
				n++;
		}	
	}	
	if (document.limiteDefilDroite>Largeurzone-55) Defil(1, true);
	else document.noDefil=true;	
}

function placeRetour(){
	AnchorFix('retourhome','retour', 'left,top');
}

/* new script seb Ok */

function RollImg(ImgName, etat){
	ImgRO=(document.all || document.layers)? document.images[ImgName]:document.getElementsByTagName("IMG")[ImgName];
	etat=(arguments.length>1)? etat:(ImgRO.src.indexOf("_on")!=-1)? 0:1;
	ImgRO.src=(etat)? ImgRO.src.replace(/_off/gi,"_on"):ImgRO.src.replace(/_on/gi,"_off");
}

