/*
Afficheur de messages au défilement vertical, avec une pause à chaque message-
*/

//configurez les cinq variables ci-dessous pour modifier le style de l'afficheur
//var scrollerwidth=800;
//var scrollerheight=20;
//var scrollerbgcolor='lightyellow';
//paramétrez l'énoncé ci-dessous à '' si vous ne souhaitez pas utiliser une image d'arrière-plan
//var scrollerbackground='scrollerback.gif';

//configurez la variable ci-dessous pour modifier le contenu de l'afficheur
//var messages=new Array();
//messages[0]="<font face='Arial'><a href='http://www.visic.com'>Cliquez ici pour revenir sur la page de Visicom Média</a></font>";
//messages[1]="<font face='Arial'><a href='http://fr.gograph.com'>Trouver vos graphiques rapidement avec WebGraphique.com</a></font>";
//messages[2]="<font face='Arial'><a href='http://www.geocities.com/ResearchTriangle/Facility/4490'>Voulez-vous apprendre le DHTML? Cliquez ici!</a></font>";
//messages[3]="<font face='Arial'><a href='http://www.freewarejava.com'>Cherchez-vous des applets Java? Visitez Freewarejava.com</a></font>";
//messages[4]="<font face='Arial'><a href='http://dynamicdrive.com'>Si vous trouvez sur script utile, venez visiter Dynamic Drive!</a></font>";

///////Ne rien modifier sous cette ligne///////////////////////

if(messages.length>1) i=2;
else i=0;

//////////// POUR NETSCAPE 4 + ///////////////////////////////

function moveNS4up1(whichlayer)
{
	tlayer=eval(whichlayer);
	if(tlayer.top>0&&tlayer.top<=5)
	{
		tlayer.top=0;
		setTimeout("moveNS4up1(tlayer)",3000);
		setTimeout("moveNS4up2(document.main.document.second)",3000);
		return;
	}//if(tlayer.top>0&&tlayer.top<=5)
	if(tlayer.top>=tlayer.document.height*-1)
	{
		tlayer.top-=5;
		setTimeout("moveNS4up1(tlayer)",100);
	}//if(tlayer.top>=tlayer.document.height*-1)
	else
	{
		tlayer.top=scrollerheight;
		tlayer.document.write(messages[i]);
		tlayer.document.close();
		if(i==messages.length-1) i=0;
		else i++;
	}//else if(tlayer.top>=tlayer.document.height*-1)
}//function moveNS4up1(whichlayer)

function moveNS4up2(whichlayer)
{
	tlayer2=eval(whichlayer);
	if(tlayer2.top>0&&tlayer2.top<=5)
	{
		tlayer2.top=0;
		setTimeout("moveNS4up2(tlayer2)",3000);
		setTimeout("moveNS4up1(document.main.document.first)",3000);
		return;
	}//if(tlayer2.top>0&&tlayer2.top<=5)
	if(tlayer2.top>=tlayer2.document.height*-1)
	{
		tlayer2.top-=5;
		setTimeout("moveNS4up2(tlayer2)",100);
	}//if(tlayer2.top>=tlayer2.document.height*-1)
	else
	{
		tlayer2.top=scrollerheight;
		tlayer2.document.write(messages[i]);
		tlayer2.document.close();
		if(i==messages.length-1) i=0;
		else i++;
	}//else if(tlayer2.top>=tlayer2.document.height*-1)
}//function moveNS4up2(whichlayer)

//////////// POUR IE 4 + ///////////////////////////////

function moveIE1(whichdiv)
{
	tdiv=eval(whichdiv);
	if(tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5)
	{
		tdiv.style.pixelTop=0;
		setTimeout("moveIE1(tdiv)",3000);
		setTimeout("moveIE2(second2)",3000);
		return;
	}//if(tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5)
	if(tdiv.style.pixelTop>=tdiv.offsetHeight*-1)
	{
		tdiv.style.pixelTop-=5;
		setTimeout("moveIE1(tdiv)",100);
	}//if(tdiv.style.pixelTop>=tdiv.offsetHeight*-1)
	else
	{
		tdiv.style.pixelTop=scrollerheight;
		tdiv.innerHTML=messages[i];
		if (i==messages.length-1) i=0;
		else i++;
	}//else if(tdiv.style.pixelTop>=tdiv.offsetHeight*-1)
}//function moveIE1(whichdiv)

function moveIE2(whichdiv)
{
	tdiv2=eval(whichdiv);
	if(tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5)
	{
		tdiv2.style.pixelTop=0;
		setTimeout("moveIE2(tdiv2)",3000);
		setTimeout("moveIE1(first2)",3000);
		return;
	}//if(tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5)
	if(tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1)
	{
		tdiv2.style.pixelTop-=5;
		setTimeout("moveIE2(second2)",100);
	}//if(tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1)
	else
	{
		tdiv2.style.pixelTop=scrollerheight;
		tdiv2.innerHTML=messages[i];
		if(i==messages.length-1) i=0;
		else i++;
	}//else if(tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1)
}//function moveIE2(whichdiv)

//////////// POUR NETSCAPE 6 + (et Mozilla) ///////////////////////////////

function moveNS6up1(whichdiv)
{
	tdiv=document.getElementById(whichdiv);
	if(parseInt(tdiv.style.top)>0 && parseInt(tdiv.style.top)<=5)
	{
		tdiv.style.top=0+'px';
		setTimeout("moveNS6up1('first2')",3000);
		setTimeout("moveNS6up2('second2')",3000);
		return;
	}//if(parseInt(tdiv.style.top)>0 && parseInt(tdiv.style.top)<=5)
	if(parseInt(tdiv.style.top)>=(tdiv.offsetHeight*-1))
	{
		tdiv.style.top=parseInt(tdiv.style.top)-5+'px';
		setTimeout("moveNS6up1('first2')",100);
	}//if(parseInt(tdiv.style.top)>=(tdiv.offsetHeight*-1))
	else
	{
		tdiv.style.top=scrollerheight;
		tdiv.innerHTML=messages[i];
		if (i==messages.length-1) i=0;
		else i++;
	}//else if(parseInt(tdiv.style.top)>=(tdiv.offsetHeight*-1))
}//function moveNS6up1(whichdiv)

function moveNS6up2(whichdiv)
{
	tdiv2=document.getElementById(whichdiv);
	if(parseInt(tdiv2.style.top)>0 && parseInt(tdiv2.style.top)<=5)
	{
		tdiv2.style.top=0+'px';
		setTimeout("moveNS6up2('second2')",3000);
		setTimeout("moveNS6up1('first2')",3000);
		return;
	}//if(parseInt(tdiv2.style.top)>0 && parseInt(tdiv2.style.top)<=5)
	if(parseInt(tdiv2.style.top)>=(tdiv2.offsetHeight*-1))
	{
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+'px';
		setTimeout("moveNS6up2('second2')",100);
	}//if(parseInt(tdiv2.style.top)>=(tdiv2.offsetHeight*-1))
	else
	{
		tdiv2.style.top=scrollerheight;
		tdiv2.innerHTML=messages[i];
		if(i==messages.length-1) i=0;
		else i++;
	}//else if(parseInt(tdiv2.style.top)>=(tdiv2.offsetHeight*-1))
}//function moveNS6up2(whichdiv)

//////////// LANCEMENT //////////////////

function startscroll()
{
	if(document.all)
	{ //pour IE 4+
		moveIE1(first2);
		second2.style.top=scrollerheight;
		second2.style.visibility='visible';
	}//if(document.all)
	else if(document.layers)
	{ //pour Netscape 4+
		document.main.visibility='show';
		moveNS4up1(document.main.document.first); // move1 et move2
		document.main.document.second.top=scrollerheight+5;
		document.main.document.second.visibility='show';
	}//else... if(document.layers)
	else if(document.getElementById)
	{ //pour Netscape 6+ et Mozilla
		moveNS6up1('first2');
		document.getElementById('second2').style.top=scrollerheight;
		document.getElementById('second2').style.visibility='visible';
	}//else... if(document.getElementById)
}//function startscroll()

/////////// DEMARRAGE

window.onload=startscroll;

if(document.layers)
{ // Pour Netscape 4+
	document.writeln('<ilayer id="main" width="&{scrollerwidth};" height="&{scrollerheight};" bgColor="&{scrollerbgcolor};" background="&{scrollerbackground};" visibility="hide">');
	document.writeln('<layer id="first" left="&{scrollerleft};" top="&{scrollertop};" width="&{scrollerwidth};">');
	document.writeln('<script language="JavaScript1.2">');
	document.write(messages[0]);
	document.writeln('		</script>');
	document.writeln('	</layer>');
	document.writeln('	<layer id="second" left="&{scrollerleft};" top="&{scrollertop};" width="&{scrollerwidth};" visibility="hide">');
	document.writeln('		<script language="JavaScript1.2">');
	document.write(messages[1]);
	document.writeln('		</script>');
	document.writeln('	</layer>');
	document.writeln('</ilayer>');
}//if(document.all)

if(document.all || document.getElementById)
{ // Pour IE 4+ et Netscape 6+ (et Mozilla)
	document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">');
	document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">');
	document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">');
	document.write(messages[0]);
	document.writeln('</div>');
	document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0;visibility:hidden">');
	document.write(messages[1]);
	document.writeln('</div>');
	document.writeln('</div>');
	document.writeln('</span>');
}//if(document.all)

