// fonction defilement texte -------------------------------------------------------
var divstop = '';
var tbscroll=new Array();

function scroller(divname,largeur,hauteur,tbtext,sens,speed) {
 this.divname=divname;
 this.largeur=largeur;
 this.hauteur=hauteur;
 this.tbtext=tbtext;
 this.idx=1;
 this.sens = sens;
 this.speed = speed;
}

function addscroller(scroll) { tbscroll[tbscroll.length] = scroll }

function stop(div){ divstop = div }

function restart(){
 divstop = ''
}

function start(){
if (tbscroll.length > 0) {
 for(i=0; i < tbscroll.length; i++){
  if (tbscroll[i].tbtext.length > 0) {
   if(document.getElementById){
    ns6div = document.getElementById(tbscroll[i].divname)
    if (tbscroll[i].sens == 'left')
    	ns6div.style.left = tbscroll[i].largeur;
    else
    	ns6div.style.top = tbscroll[i].hauteur;
    ns6div.innerHTML=tbscroll[i].tbtext[0];
   }
  }
 }
 ns6scroll();
 }
}

function ns6scroll(){
 for(i=0; i < tbscroll.length; i++){
  if (divstop != tbscroll[i].divname) {
   if (tbscroll[i].tbtext.length > 0){
    ns6div=document.getElementById(tbscroll[i].divname);
    if (tbscroll[i].sens == 'left') {
     sizeup=ns6div.offsetWidth;
     if(parseInt(ns6div.style.left)>0&&parseInt(ns6div.style.left)<= tbscroll[i].speed)
      ns6div.style.left=0;
     if (parseInt(ns6div.style.left)>=sizeup*-1)
      ns6div.style.left=parseInt(ns6div.style.left)-tbscroll[i].speed;
     else{
      ns6div.style.left=tbscroll[i].largeur;
      if(tbscroll[i].idx >= tbscroll[i].tbtext.length-1)
       tbscroll[i].idx=0;
      else 
       tbscroll[i].idx++;
      ns6div.innerHTML=tbscroll[i].tbtext[tbscroll[i].idx]; 
     }
    }
  else {
     sizeup=ns6div.offsetHeight;
     if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=tbscroll[i].speed)
      ns6div.style.top=0;
     if (parseInt(ns6div.style.top)>=sizeup*-1)
      ns6div.style.top=parseInt(ns6div.style.top)-tbscroll[i].speed;
     else{
      ns6div.style.top=tbscroll[i].hauteur;
      if(tbscroll[i].idx >= tbscroll[i].tbtext.length-1)
       tbscroll[i].idx=0;
      else 
       tbscroll[i].idx++;
      ns6div.innerHTML=tbscroll[i].tbtext[tbscroll[i].idx]; 
     }
    }
   }
  }
 }
 setTimeout("ns6scroll()",100);
}
// fin fonction defilment texte ------------------------------------------------------

// fonction ajout aux favoris et marque-page  
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

// popup centre
function popupcentre(page,largeur,hauteur,scrol) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+",menubar=no,toolbar=no,resizable=yes,scrollbars="+ scrol);
}

// changement de couleur au survol des lignes
function change_color_ligne(id,defaut,txt){
	document.getElementById(id).style.backgroundColor=defaut;
	// si on mouseover col=#FF8000 sinon col=#000000
	var col = (txt) ? "#000000" : "#494949";	
	// on change la couleur de la police pr les 5 <td>
	document.getElementById(id+'1').style.color=col;
	document.getElementById(id+'2').style.color=col;
	document.getElementById(id+'3').style.color=col;
	document.getElementById(id+'4').style.color=col;
	document.getElementById(id+'5').style.color=col;
}
