var vitesse=5; 
var sens=1;
var scrollerwidth='120';
var scrollerheight='140';
var scrollerbgcolor='transparent';
var scrollerbackground='';

var begin_msg = '<table width="100%" height="'+scrollerheight+'" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td valign="middle">';
var end_msg = '</td></tr></table>';

/*if (messages.length>1)
  i=1;
else*/
  i=0;

function move1(whichlayer){
  tlayer=eval(whichlayer);
  if (sens==1)
    var test = (tlayer.top>0 && tlayer.top<=vitesse);
  else
    var test = (tlayer.top>=vitesse*-1 && tlayer.top<0);
  if (test){
    tlayer.top=0;
    setTimeout("move1(tlayer)",3000);
    setTimeout("move2(document.main.document.second)",3000);
    return;
  }
  if (sens==1)
    var test = (tlayer.top>=(tlayer.document.height*-1));
  else
    var test = (tlayer.top<=(tlayer.document.height));
  if (test){
    tlayer.top-=vitesse*sens;
    setTimeout("move1(tlayer)",100);
  }
  else{
    tlayer.top=scrollerheight*sens;
    tlayer.document.write(begin_msg);
    tlayer.document.write(messages[i]);
    tlayer.document.write(end_msg);
    tlayer.document.close();
    if (i==messages.length-1)
      i=0;
    else
      i++;
	//alert(i);
  }
}
function move2(whichlayer){
  tlayer2=eval(whichlayer);
  if (sens==1)
    var test = (tlayer2.top>0 && tlayer2.top<=vitesse);
  else
    var test = (tlayer2.top>=vitesse*-1 && tlayer2.top<0);
  if (test){
    tlayer2.top=0;
    setTimeout("move2(tlayer2)",3000);
    setTimeout("move1(document.main.document.first)",3000);
  }
  if (sens==1)
    var test = (tlayer2.top>=(tlayer2.document.height*-1));
  else
    var test = (tlayer2.top<=(tlayer2.document.height));
  if (test){
    tlayer2.top-=vitesse*sens;
    setTimeout("move2(tlayer2)",100);
  }else{
    tlayer2.top=scrollerheight*sens;
    tlayer2.document.write(begin_msg);
    tlayer2.document.write(messages[i]);
    tlayer2.document.write(end_msg);
    tlayer2.document.close();
    if (i==messages.length-1)
      i=0;
    else
      i++;
	//alert(i);
    }
}

function move3(whichdiv){
  tdiv=eval(whichdiv);
  if (sens==1)
    var test = (tdiv.style.pixelTop>0 && tdiv.style.pixelTop<=vitesse);
  else
    var test = (tdiv.style.pixelTop>=vitesse*-1 && tdiv.style.pixelTop<0);
  if (test){
    tdiv.style.pixelTop= 0;
    setTimeout("move3(tdiv)",3000);
    setTimeout("move4(second2)",3000);
    return;
  }
  if (sens==1)
    var test = (tdiv.style.pixelTop>=(tdiv.offsetHeight*-1));
  else
    var test = (tdiv.style.pixelTop<=(tdiv.offsetHeight));
  if (test){
    tdiv.style.pixelTop-=vitesse*sens;
    setTimeout("move3(tdiv)",100);
  }else{
    tdiv.style.pixelTop=scrollerheight*sens;
    tdiv.innerHTML=begin_msg + messages[i] + end_msg;
    if (i==messages.length-1)
      i=0;
    else
      i++;
	//alert(i);
  }
}
function move4(whichdiv){
  tdiv2=eval(whichdiv);
  if (sens==1)
    var test = (tdiv2.style.pixelTop>0 && tdiv2.style.pixelTop<=vitesse);
  else
    var test = (tdiv2.style.pixelTop>=vitesse*-1 && tdiv2.style.pixelTop<0);
  if (test){
    tdiv2.style.pixelTop= 0;
    setTimeout("move3(first2)",3000);
    setTimeout("move4(tdiv2)",3000);
    return
  }
  if (sens==1)
    test = tdiv2.style.pixelTop>=(tdiv2.offsetHeight*-1);
  else
    test = tdiv2.style.pixelTop<=(tdiv2.offsetHeight);
  if (test){
    tdiv2.style.pixelTop-=vitesse*sens;
    setTimeout("move4(second2)",100);
  }else{
    tdiv2.style.pixelTop=scrollerheight*sens;
    tdiv2.innerHTML=begin_msg + messages[i] + end_msg;
    if (i==messages.length-1)
      i=0;
    else
      i++;
	//alert(i);
  }
}
function startscroll(){
  if (document.all){
    first2.style.top=sens;
    move3(first2);
    second2.style.top=scrollerheight*sens;
    second2.style.visibility='visible';
  }
  else if (document.layers){
    document.main.visibility='show';
    document.main.document.first.top=sens;
    move1(document.main.document.first);
    document.main.document.second.top=(scrollerheight+vitesse)*sens;
    document.main.document.second.visibility='show';
  }
}
function fenetre(desktopURL)
{
  var desktop = window.open( desktopURL, "popup", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=410,height=350");
  desktop.moveTo(160,120);
}
