function LH()
{
	buildNM();
	setRBS(0,'C','L','N',41,30,164,5000,0,656,'Y');
	//rowLite('prodtbl','rowLite');
}

function LoadHandler(a)
{

	if(a==1||a==3)
	{
		window.onload=LH;
	}
	if(a>1)
	{
		window.onresize=RH;
	}

}

LoadHandler(1);

function setNM2()
{
	var i,d='',h="<sty"+"le type=\"text/css\">";
	var tA=navigator.userAgent.toLowerCase();
	if(window.opera)
	{
		if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1)
		{
			return;
		}
	}
	if(document.getElementById)
	{
		for(i=1;
		i<10;
		i++)
		{
			d+='ul ';
			h+="\n.sub ul "+d+"\n{\n	display:none;\n}";
		}
		document.write(h+"\n<"+"/sty"+"le>");
	}
}
setNM2();
function buildNM()
{
	var i,x,g,theDiv,bb,theS,tA,theU,pp,lvl,tS,opn;
	tA=navigator.userAgent.toLowerCase();
	if(window.opera)
	{
		if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1)
		{
			return;
		}
	}
	document.tControl=new Array;
	opn='';
	if(document.NMopener&&document.NMopener.length>5)
	{
		opn=document.NMopener.split(",");
	}
	if(document.getElementById)
	{
		for(x=1;
		x<10;
		x++)
		{
			theDiv=document.getElementById('menu_gauche_'+x);
			if(theDiv)
			{
				var theC="sub snm_0_1_2_1_100%_0%_1_3";
				if(theC&&theC.indexOf("snm")>-1)
				{
					theS=theC.split('_');
					if(theS.length&&theS.length>2)
					{
						theDiv.NMprop=theS.slice(1);
					}
					else
					{
						continue;
					}
				}
				else
				{
					continue;
				}
				theU=theDiv.getElementsByTagName("UL");
				for(i=0;
				i<theU.length;
				i++)
				{
					theU[i].nmdiv=theDiv.id;
					theU[i].tctrl=document.tControl.length;
					document.tControl[document.tControl.length]=theU[i];
					if(i==0)
					{
					}
					pp=theU[i].parentNode;
					lvl=0;
					while(pp)
					{
						if(pp.nodeName&&pp.nodeName=="UL")
						{
							lvl++;
						}
						if(pp.nodeName&&pp.nodeName=="DIV")
						{
							break;
						}
						pp=pp.parentNode;
					}
					theU[i].nmlvl=lvl;
				}
				var theA=theDiv.getElementsByTagName("A");
				for(i=0;
				i<theA.length;
				i++)
				{
					theA[i].nmdiv=theDiv.id;
					bb=getSub(theA[i]);
					theA[i].ulref=(bb!=null)?bb.tctrl:-1;
					theA[i].aref=document.tControl.length;
					document.tControl[document.tControl.length]=theA[i];
					if(theDiv.NMprop[2]==2)
					{
						theA[i].onmouseover=function()
						{
							timeNM2(this);
						}
						;
						theA[i].onfocus=function()
						{
							timeNM2(this);
						}
						;
					}
				else
					{
						if(theA[i].ulref<0)
						{
							theA[i].onclick=function()
							{
								toggleNM2(this);
							}
							;
						}
					else
						{
							theA[i].onclick=function()
							{
								clickNM2(this);
							}
							;
						}
					}
				}
				if(theDiv.NMprop[1]==1)
				{
					tS="'"+theDiv.id+"'";
					for(i=0;
					i<opn.length;
					i+=3)
					{
						if(opn[i]==theDiv.id)
						{
							tS=tS+","+opn[i+1]+",'"+opn[i+2]+"'";
						}
						break;
					}
					eval("openNM2("+tS+")");
				}
			}
		}
		document.body.onmouseover=mainClose;
	}
}

function getSub(a)
{
	var i,theU=null;
	var g=a.parentNode.getElementsByTagName("UL");
	if(g&&g.length)
	{
		theU=g[0];
	}
	return theU;
}

function showNM2(ob,bp)
{
	var i,s,hh,thePc,mk;
	var g=document.getElementById(ob.nmdiv);
	if(!bp&&g.NMprop[3]==1)
	{
		toggleNM2(ob);
	}
	if(ob&&ob.parentNode)
	{
		thePc=ob.parentNode.childNodes;
		for(i=0; i<thePc.length; i++)
		{
			if(thePc[i].nodeName == "UL")
			{
				if(thePc[i].style.display!="block")
				{
					thePc[i].style.display="block";
					ob.parentNode.style.position="relative";
					if(g.NMprop[0]==0||thePc[i].nmlvl<(g.NMprop[7]))
					{
						thePc[i].style.position="absolute";
						thePc[i].style.left=g.NMprop[4];
						thePc[i].style.top=g.NMprop[5];
					}
					thePc[i].style.visibility="visible";
					mk=(ob.className.indexOf("curr")>-1)?"minusmarkcurr":"minusmark";
					ob.className=mk;
					if(g.NMprop[6]==1)
					{
						animSub(thePc[i].tctrl,40);
					}
				}
			}
		}
	}
}

function toggleNM2(a,b)
{
	var i,g,pp,theU,theA;
	if(a&&a.parentNode)
	{
		pp=a.parentNode;
		while(pp)
		{
			if(pp.nodeName&&pp.nodeName=="UL")
			{
				break;
			}
			pp=pp.parentNode;
		}
		if(pp)
		{
			theU=pp.getElementsByTagName("UL");
			g=document.getElementById(pp.nmdiv);
			if(g.NMprop[0]==1&&b==1)
			{
				return;
			}
			for(i=0;
			i<theU.length;
			i++)
			{
				theA=theU[i].parentNode.firstChild;
				if(b!=1&&theA==a)
				{
					continue;
				}
			else
				{
					if(theU[i].style.display=="block")
					{
						hideNM2(theA);
					}
				}
			}
		}
	}
}

function hideNM2(ob)
{
	var i,s,hh,thePc,theIm,tt;
	var g=document.getElementById(ob.nmdiv);
	if(ob&&ob.parentNode)
	{
		thePc=ob.parentNode.childNodes;
		for(i=0;
		i<thePc.length;
		i++)
		{
			if(thePc[i].nodeName=="UL")
			{
				thePc[i].style.display="none";
				if(g.NMprop[0]==0||thePc[i].nmlvl<(g.NMprop[7]))
				{
					thePc[i].style.position="static";
					thePc[i].style.left=0;
					thePc[i].style.top=0;
				}
				thePc[i].style.visibility="hidden";
				var mk=(ob.className.indexOf("curr")>-1)?"plusmarkcurr":"plusmark";
				ob.className=mk;
				tt='setTimeout("dodo('+thePc[i].tctrl+')",1)';
				eval(tt);
			}
		}
	}
}

function dodo(ct)
{
	var g=document.tControl[ct];
	g.parentNode.style.position="static";
}

function animSub(ct,st)
{
	var g=document.tControl[ct];
	var sp=30;
	var inc=20;
	st=(st>=100)?100:st;
	g.style.fontSize=st+"%";
	if(st<100)
	{
		st+=inc;
		setTimeout("animSub("+ct+","+st+")",sp);
	}
}

function clickNM2(a)
{
	document.nmactive=1;
	document.nmadiv=a.nmdiv;
	var i,s,thePc;
	if(a&&a.parentNode)
	{
		thePc=a.parentNode.childNodes;
		for(i=0;
		i<thePc.length;
		i++)
		{
			if(thePc[i].nodeName=="UL")
			{
				s=thePc[i].style.display;
				if(s=="block")
				{
					hideNM2(a);
				}
			else
				{
					showNM2(a);
				}
			}
		}
	}
}

function timeNM2(a)
{
	if(document.nmcc)
	{
		clearTimeout(document.nmcc);
	}
	document.nmactive=1;
	document.nmadiv=a.nmdiv;
	var tg='document.nmcc=setTimeout("mouseNM2('+a.aref+')",220)';
	eval(tg);
}

function mouseNM2(ct)
{
	var g=document.tControl[ct];
	if(ct>=0)
	{
		showNM2(g);
	}
else
	{
		toggleNM2(g);
	}
}

function mainClose(evt)
{
	evt=(evt)?evt:((event)?event:null);
	var nn,pp,m=true;
	var st=document.nmactive;
	if(st!=-999)
	{
		if(evt)
		{
			var theSrc=(evt.target)?evt.target:evt.srcElement;
			pp=theSrc.parentNode;
			while(pp)
			{
				nn=pp.nodeName;
				if(nn=="DIV"&&pp.NMprop)
				{
					m=false;
					document.nmactive=1;
					document.nmadiv=pp.id;
					pp.nmstate=1;
					break;
				}
				pp=pp.parentNode;
			}
			if(m)
			{
				document.nmactive=0;
				document.nmadiv='none';
			}
			if(document.nmc)
			{
				clearTimeout(document.nmc);
			}
			document.nmc=setTimeout("closeNM2()",300);
		}
	}
}

function closeNM2()
{
	var theA,i,divName,theDiv;
	if(document.nmadiv=='none')
	{
		document.nmactive=-1;
	}
	for(i=1;
	i<11;
	i++)
	{
		divName='menu_gauche_'+i;
		theDiv=document.getElementById(divName);
		if(theDiv)
		{
			if(document.nmadiv!=theDiv.id)
			{
				theDiv.nmstate=0;
				theA=theDiv.getElementsByTagName("A");
				if(theA)
				{
					toggleNM2(theA[0],1);
				}
			}
		}
	}
}

function openNM2(navDiv,tp,vu)
{
	var i,d,ha,pp,m=false;
	if(document.getElementById)
	{
		d=document.getElementById(navDiv);
		if(d)
		{
			ha=d.getElementsByTagName("A");
			if(tp==null||tp==0)
			{
				vu=window.location.href;
				tp=0;
			}
			for(i=0;
			i<ha.length;
			i++)
			{
				if(ha[i].href)
				{
					if(tp<=0)
					{
						if(ha[i].href.indexOf(vu)>-1)
						{
							m=true;
							break;
						}
					}
					if(tp==1)
					{
						if(ha[i].href.indexOf(vu)>-1)
						{
							m=true;
							break;
						}
					}
					if(tp==2)
					{
						if(ha[i].firstChild)
						{
							if(ha[i].firstChild.nodeValue==vu)
							{
								m=true;
								break;
							}
						}
					}
				}
			}
			if(m)
			{
				pp=ha[i].parentNode;
				if(ha[i].ulref<0)
				{
					ha[i].className="currentmark";
					pp=pp.parentNode;
				}
				while(pp)
				{
					if(pp.nodeName=="LI")
					{
						if(pp.firstChild.nodeName=="A")
						{
							pp.firstChild.className="plusmarkcurr";
							if(d.NMprop[0]==1)
							{
								showNM2(pp.firstChild,9);
							}
						}
					}
					pp=pp.parentNode;
				}
			}
		}
	}
}


function setRBS()
{
	var theBox="thumbnails";
	var theShim="thumbs";
	var theDiv="bgsc1inks";
	var i,tB,tS,tD,tL,tA,j,np;
	if(document.getElementById)
	{
		tB=document.getElementById(theBox);
		if(tB)
		{
			tD=document.getElementById(theDiv);
			if(tD)
			{
				tB.RBS=arguments;
				if(document.RBSdn)
				{
					tB.RBS[0]=document.RBSdn;
				}
				tL=tD.getElementsByTagName("LI");
				if(tL)
				{
					j=tL.length;
					if(tB.RBS[0]==0)
					{
						i=Math.floor(Math.random()*j);
					}
				else
					{
						i=(tB.RBS[0]>j)?0:tB.RBS[0]-1;
						i=(i<0)?0:i;
					}
					tA=tL[i].getElementsByTagName("A");
					if(tA&&tA.length>1)
					{
						tB.style.backgroundImage="url("+tA[1].href+")";
						tS=document.getElementById(theShim);
						if(tS)
						{
							tS.setAttribute("alt",tA[0].firstChild.nodeValue);
							tS.parentNode.setAttribute("href",tA[0].href);
						}
						runRBS(tB.id,'Reset');
					}
				}
			}
		}
	}
}

function scrollRBS(ob,tT,np)
{
	if(document.getElementById)
	{
		var theBox=document.getElementById(ob);
		var tt,nu,tF,lp=0,hp=0,inc=0,dl=theBox.RBS[5],m=true;
		;
		var tm="theBox.BGtm=setTimeout(\"scrollRBS('";
		if(theBox)
		{
			if(tT=='H'||tT=='D')
			{
				lp=np;
			}
			if(tT=='V'||tT=='D')
			{
				hp=np;
			}
			theBox.style.backgroundPosition=lp+'px '+hp+'px';
			tF=theBox.RBS[4];
			theBox.RBSac+=tF;
			nu=theBox.RBSac+tF;
			if(theBox.RBS[1]=='C')
			{
				if(nu>theBox.RBS[6]&&theBox.RBSac!=theBox.RBS[6])
				{
					tF=theBox.RBS[6]-theBox.RBSac;
					theBox.RBSac=theBox.RBS[6]-theBox.RBS[4];
				}
				if(theBox.RBSac>=theBox.RBS[6])
				{
					dl=theBox.RBS[7];
					theBox.RBSac=0;
					theBox.RBSc+=1;
					if(theBox.RBSc>theBox.RBScc)
					{
						theBox.RBSc=1;
					}
				}
			}
			theBox.RBSae+=tF;
			inc=(np>=0)?tF:tF*-1;
			np=np+inc;
			if(theBox.RBSae+tF>theBox.RBS[9])
			{
				np=(np>=0)?theBox.RBS[9]:theBox.RBS[9]*-1;
			}
			tm+=ob+"','"+tT+"',"+np+")\","+dl+")";
			theBox.RBSres=tm;
			if(theBox.RBS[3]=="N"&&theBox.RBSae>theBox.RBS[9])
			{
				m=false;
				theBox.RBScm=0;
				if(theBox.BGtm)
				{
					clearTimeout(theBox.BGtm);
				}
			}
			if(m)
			{
				if(theBox.RBScm==1)
				{
					eval(tm);
				}
			}
		}
	}
}

function runRBS(ob,cm,op)
{
	var lp=0,hp=0,tT,tm,dl;
	var tm="theBox.BGtm=setTimeout(\"scrollRBS('";
	if(document.getElementById)
	{
		var theBox=document.getElementById(ob);
		if(theBox)
		{
			if(cm=='Stop')
			{
				theBox.RBScm=0;
				if(theBox.BGtm)
				{
					clearTimeout(theBox.BGtm);
				}
			}
			if(cm=='Resume')
			{
				theBox.RBScm=1;
				if(theBox.RBSres)
				{
					eval(theBox.RBSres);
				}
			}
			if(cm=='Reset')
			{
				theBox.RBScm=0;
				if(theBox.BGtm)
				{
					clearTimeout(theBox.BGtm);
				}
				theBox.RBSres='';
				np=theBox.RBS[8];
				theBox.RBSac=0;
				theBox.RBSae=0;
				var tT="H";
				if(theBox.RBS[2]=='U'||theBox.RBS[2]=='D')
				{
					tT="V";
				}
				if(tT=='H'||tT=='D')
				{
					lp=np;
				}
				if(tT=='V'||tT=='D')
				{
					hp=np;
				}
				theBox.style.backgroundPosition=lp+'px '+hp+'px';
				np+=theBox.RBS[4];
				if(theBox.RBS[2]=="L"||theBox.BGs[2]=="U")
				{
					np=np*-1;
				}
				theBox.RBSc=1;
				theBox.RBScc=parseInt(theBox.RBS[9]/theBox.RBS[6]);
				theBox.RBScm=1;
				dl=(op)?op:theBox.RBS[7];
				tm+=ob+"','"+tT+"',"+np+")\","+dl+")";
				theBox.RBSres=tm;
				if(theBox.RBS[10]=="Y")
				{
					eval(tm);
				}
			}
		}
	}
}

