function AfficherCacher(nom)
{
	if(document.getElementById(nom).style.display == 'none')
	{
		document.getElementById(nom).style.display = 'block';
	}
	else
	{
		document.getElementById(nom).style.display = 'none';
	}
}

function voir(debut,fin,nom)
{
    table = document.getElementById(nom).getElementsByTagName('TR');
    
    for (l=debut;l<fin+1;l++)
    {
        try 
        { 
            if (table[l].style.display == '') 
            {
                table[l].style.display = 'none';
            }
            else table[l].style.display = ''
        }
        catch (err) 
        {
        }
    }
}


function photoOver(img, path)
{
//    document.getElementById(img).src=path;
//    document.getElementById(img).style.display='block';
//    if(document.getElementById(img).width>600)
//        document.getElementById(img).style.width=600;
//    else
//        document.getElementById(img).style.width='auto';
//    if(document.getElementById(img).height>600)
//        document.getElementById(img).style.height=600;
//    else
//        document.getElementById(img).style.height='auto';
    window.open(path,"popup","location=0,status=0,resizable=1,scrollbars=1,width=350,height=450"); 

}

function photoOut(img)
{
    document.getElementById(img).style.display='none';
}

var Timer;
var Pas = 3;

function moveLayer(Sens, Base) {
	Objet=document.getElementById("content");
    if(parseInt(Objet.style.top) + (Pas*Sens)>0)  {
		clearTimeout(Timer);
	}
	else if(parseInt(Objet.style.top) + (Pas*Sens)<-(Objet.offsetHeight-document.getElementById(Base).offsetHeight)) {
		clearTimeout(Timer);
	}
    else {
        Objet.style.top = (parseInt(Objet.style.top) + (Pas*Sens)) + "px";
	}
	Timer = setTimeout("moveLayer(" + Sens + ", '" + Base + "');", 30);
}

function RunFlash()
{
    content = '<noembed><object style="width:260px;height:260px">';
    content += '<param name="movie" value="../images/anim_euphor2.swf" />';
    content += '<param name="menu" value="false"/>';
    content += '<param name="play" value="true"/>';
    content += '<param name="loop" value="true"/>';
    content += '<param name="quality" value="high" />';
    content += '<param name="scale" value="exatfit"/></object></noembed>';
    content += '<embed width="260px" height="260px" src="../images/anim_euphor2.swf" quality="high" play="true" scale="exatfit" menu="false" loop="true" type="application/x-shockwave-flash" />';
    content += '';       
    texte = document.getElementById('flash');
    texte.innerHTML = content;
}

function code(texte)
{
    return encodeURIComponent(texte);
}

function decode(texte)
{
    return decodeURIComponent(texte)
}

function ouvre(fichier) 
{
    window.open(fichier,"popup","location=0,status=0,scrollbars=1,width=450,height=350"); 
}

function nouvelle(fichier) 
{
    window.open(fichier,"doc","location=1,status=1,resizable=1,menubar=1,scrollbars=1,width=450,height=350");
}

d_stop = false;
pause = 7000;

function stop()
{
    d_stop = true;
}

function reprise()
{
    d_stop = false;
}

function start()
{
	decal = 0;
	//recupération du nombre de news	
    combien = eval(document.getElementById("ctl00_nblignes").innerHTML);
	
    if(document.getElementById)	setTimeout("action(1)",7000);
}

function start2()
{
	decal = 200;
	pause = 7000;

    if(document.getElementById)	setTimeout("action(0)",0);
}

function action(j)
{
    if (d_stop==false) decal -= 1;
	
	//on remonte chaque news de 1px
    for (i=1;i<combien+1;i++)
    {
        document.getElementById("scroller_" + i).style.top = decal + "px";
	}

	taille = 0;	
    for (i=0;i<j;i++)
    {
        taille +=document.getElementById("scroller_" + (i+1)).scrollHeight;
	}

    
    if((decal + taille) > 0) setTimeout("action(" + j + ")",0);
    else if(j<combien) {
//        if (j % 2 == 0) { 
//            pause = 7000;
//        }
//        else {
//            pause = 0;
//        }
        setTimeout("action(" + (++j) + ")",pause);
        
    }
    else start2();
}

