var slideMenu=function()
{
	var sp,st,t,m,sa,l,w,sw,ot;
	return{
			build:function(sm,sw,mt,s,sl)
			{
				sp=s; st=sw; t=mt;
				m=document.getElementById(sm);
				sa=m.getElementsByTagName('div');
				l=sa.length;
				w=m.offsetWidth; sw=w/l;
				ot=Math.floor((w-st)/(l-1));
				var i=0;
				for(i;i<l;i++)
				{
					s=sa[i]; s.style.width=sw+'px'; this.timer(s)
				}
				if(sl!=null)
				{
					m.timer=setInterval(function()
					{
						slideMenu.slide(sa[sl-1])
					}
					,t)
				}
			},
			timer:function(s)
			{
				s.onmouseover=function()
				{
					clearInterval(m.timer);m.timer=setInterval(function()
					{
						slideMenu.slide(s)
					}
					,t)
				}
			},
			slide:function(s)
			{
				var cw=parseInt(s.style.width,'10');
				if(cw<st)
				{
					var owt=0; var i=0;
					for(i;i<l;i++)
					{
						if(sa[i]!=s)
						{
							var o,ow; var oi=0; o=sa[i]; ow=parseInt(o.style.width,'10');
							if(ow>ot)
							{
								oi=Math.floor((ow-ot)/sp); oi=(oi>0)?oi:1; o.style.width=(ow-oi)+'px'
							}
							owt=owt+(ow-oi)
						}
					}
					s.style.width=(w-owt)+'px';
				}
				else
				{
					clearInterval(m.timer)
				}
			}
		};
}();

function fondu(idobjet)
{
	opaciter=opaciter+0.1;
	var cible;
	cible = document.getElementById(idobjet) ;
	cible.style.opacity = opaciter;
	if (opaciter >= 1)
		setTimeout("clearTimeout(fonduaff);", 0);
} 

function aff(idobjet)
{
	var cible;
	cible = document.getElementById(idobjet) ;
	if (cible.style.display == 'none')
	{
		cible.style.opacity= 0;
		cible.style.display = '';
		opaciter = 0;
		fonduaff = setInterval("fondu('"+idobjet+"');",30);
	} 
	else 
		cible.style.display = 'none';
}

function changeclass(idobjet)
{
	if (document.getElementById(idobjet).className == 'menutitrereplier')
		document.getElementById(idobjet).className='menutitredeplier';
	else
		document.getElementById(idobjet).className='menutitrereplier';
}

function cache(idobjet, idobjet2)
{
	if (document.getElementById(idobjet))
		document.getElementById(idobjet).style.display= 'none';
	if (document.getElementById(idobjet2))
		document.getElementById(idobjet2).className='menutitrereplier';
}
