n = (document.layers) ? 1:0 ie = (document.all) ? 1:0 function ExistLayer(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 (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.all[AncreName].innerHTML; else document.all[AncreName].innerHTML=''+document.all[AncreName].innerHTML;} if (!document.all) { calk=false; if (document.anchors && document.anchors[AncreName]) cheminAncre=document.anchors[AncreName]; else for (i=0; i-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(LyrNme, vitesse, direction, run){ if (LyrNme) { 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 Clip(LyrNme, param, valeur){ var ie=(document.all)?1:0; param=param.toLowerCase(); way=(ie)? document.all[LyrNme].style:'document.layers.'+LyrNme; if (ie) { carac=(navigator.appVersion.indexOf("MSIE 4.5")!=-1 && navigator.appVersion.indexOf("Mac")!=-1)? " ":"px" clipzone=eval('way.clip.substring(way.clip.indexOf("\u0028")+1,way.clip.lastIndexOf("\u0029")).replace(/'+carac+'/gi,"\u002c")');} clipzone=(ie)? eval('new Array('+clipzone+'0)'):new Array(eval(way+'.clip.top'),eval(way+'.clip.right'),eval(way+'.clip.bottom'),eval(way+'.clip.left')); if (param.indexOf("move")<0) { lequel=(param.indexOf("top")!=-1)? 0:(param.indexOf("right")!=-1)? 1:(param.indexOf("bottom")!=-1)? 2:3 if (valeur || valeur>-1 || valeur=="") { way=(ie)? 'document.all.' + LyrNme + '.style.clip':(!lequel)? way+'.clip.top':(lequel==1)? way+'.clip.right':(lequel==2)? way+'.clip.bottom' :way+'.clip.left'; if (ie) { clipzone[lequel]=valeur; valeur="rect("+clipzone[0]+"px "+clipzone[1]+"px "+clipzone[2]+"px "+clipzone[3]+"px)";} eval(way+'="'+valeur+'"'); return true;} else return clipzone[lequel];} else { Clip(LyrNme, (param.lastIndexOf("movel")!=-1)?"right":"top", (param.lastIndexOf("movel")!=-1)? clipzone[1]+parseInt(valeur):clipzone[0]+parseInt(valeur)); Clip(LyrNme, (param.lastIndexOf("movel")!=-1)?"left":"bottom", (param.lastIndexOf("movel")!=-1)? clipzone[3]+parseInt(valeur):clipzone[2]+parseInt(valeur)); } } var pathstart = "/img/nav/" var pathoff = "_off.gif" var pathon = "_on.gif" 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 recharge(){ self.location.reload(); } 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; i0 && 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= 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'); }