// JavaScript Document
<!--
bnrWid=0;
bnrHit=0;
bnrLft=0;
bnrTop=0;
styleObj=(td_IE4)?".style":"";

function getPH(phname){
   pHA="";
   for(i=0;i<document.anchors.length;i++){
      theA=document.anchors[i];
      if(theA.name==phname){pHA=theA;break}
   }
   return pHA //placeholding A
}

function getReal(xy){
   if((td_IE4)||(td_isDOM)){
      Pos=(xy=="x")?this.offsetLeft:this.offsetTop;
      tmpEl=this.offsetParent;
      while(tmpEl!=null){
         Pos+=(xy=="x")?tmpEl.offsetLeft:tmpEl.offsetTop;
         tmpEl=tmpEl.offsetParent;
      }
   }else{
      Pos=eval("this."+xy);
   }
   return Pos;
}

function getObj(i){
   if((td_NS4)||(td_IE4)) {
      obj=eval("msg"+i+styleObj);
   }else{
      obj=document.getElementById("msg"+i).style;
   }
   return obj
};

function showMsg(n,show){
   var theEl=getObj(n);
   theEl.visibility=(show)?"visible":"hidden";
}

function nextMsg(){
   var fm=current;
   current=(fm==ar.length-1)?0:fm+1;
   if(current==1)loopCount++;
   if(finite&&(loopCount>=maxLoops))return;
   scrollBnr(fm,current);
}

function moveUp(){
   if((td_NS4)||(td_isDOM)){
      fmEl.top=(td_NS4)?fmEl.top-increment:(parseInt(fmEl.top)-increment) + "px";
      if(parseInt(toEl.top)-increment<=toElTarget){
         toEl.top=(td_NS4)?toElTarget:toElTarget+"px";
         clearInterval(intervalID);
         fmEl.visibility="hidden";
         timeoutID=setTimeout("nextMsg()",pause);
      }else{
         toEl.top=(td_NS4)?toEl.top-increment:(parseInt(toEl.top)-increment) + "px";
      }
   }else if (td_IE4){
      fmEl.pixelTop-=increment;
      if(toEl.pixelTop-increment<=toElTarget){
         toEl.pixelTop=toElTarget;
         clearInterval(intervalID);
         fmEl.visibility="hidden";
         timeoutID=setTimeout("nextMsg()",pause);
      }else{
         toEl.pixelTop-=increment;
      }
   }
}

function scrollBnr(fm,to){
   fmEl=getObj(fm);
   toEl=getObj(to);
   if((td_NS4)||(td_isDOM)){
      toEl.top=(td_NS4)?fmEl.top+bnrHit:(parseInt(fmEl.top)+bnrHit)+"px";
      toElTarget=parseInt(fmEl.top);
   }else{
      toEl.pixelTop=fmEl.pixelTop+bnrHit;
      toElTarget=fmEl.pixelTop;
   }
   showMsg(to,true);
   intervalID=setInterval("moveUp()",interval);
}

function moveToIE(lPos,tPos){
   this.style.pixelLeft=lPos;
   this.style.pixelTop=tPos;
}

function moveToDOM(lPos,tPos){
   this.style.left=lPos + "px";
   this.style.top=tPos + "px";
}

function makeIE(){
   var text='<DIV ID="bnr" STYLE="position:absolute">';
   for(var i=ar.length-1;i>=0;i--){
      text+='<DIV ID="msg'+i+'" STYLE="text-align:left;position:absolute"><\/DIV>';
   }
   text+='<\/DIV>';
   document.getElementById('txtderoulant').insertAdjacentHTML("BeforeEnd",text);
   with(bnr.style){
      width=bnrWid;
      height=bnrHit;
      clip="rect(0 "+bnrWid+" "+bnrHit+" 0)";
      backgroundColor=bannerColor;
   }
   bnr.moveTo=moveToIE;
   bnr.moveTo(bnrLft,bnrTop)
   for(i=0;i<ar.length;i++){
      with(eval("msg"+i+".style")){
         visibility="hidden";
         width=bnrWid-leftPadding;
         backgroundColor=bannerColor;
      }
      eval("msg"+i+".moveTo=moveToIE");
      eval("msg"+i+".moveTo(leftPadding,topPadding)");
   }
}

function makeDOM(){
   var text='<DIV ID="bnr" STYLE="position:absolute;">';
   for(var i=ar.length-1;i>=0;i--){
      text+='<DIV ID="msg'+i+'" STYLE="text-align:left;position:absolute"><\/DIV>';
   }
   text+='<\/DIV>';
   var r = document.body.ownerDocument.createRange();
   r.setStartBefore(document.body);
   var df = r.createContextualFragment(text);
   document.body.appendChild(df);
  
   bnrEL=document.getElementById('bnr');
   with(bnrEL.style){
      width=bnrWid+"px";
      height=bnrHit+"px";
      clip="rect(0px "+bnrWid+"px "+bnrHit+"px 0px)";
      backgroundColor=bannerColor;
   }
   bnrEL.moveTo=moveToDOM;
   bnrEL.moveTo(bnrLft,bnrTop)
   for(i=0;i<ar.length;i++){
      msgEL=document.getElementById("msg"+i);
      with(msgEL.style){
         visibility="hidden";
         width=(bnrWid-leftPadding)+"px";
         backgroundColor=bannerColor;
      }
      msgEL.moveTo=moveToDOM;
      msgEL.moveTo(leftPadding,topPadding);
   }
}

function makeNS(){
   bnr=new Layer(bnrWid);
   with(bnr){
      clip.right=bnrWid;
      clip.bottom=bnrHit;
      bgColor=bannerColor;
      moveTo(bnrLft,bnrTop);
      visibility="show";
   }
   for(var i=0;i<ar.length;i++){
      eval("msg"+i+"="+"new Layer(bnrWid-leftPadding, bnr)");
      with(eval("msg"+i)) {
         moveTo(leftPadding,topPadding);
         bgColor=bannerColor;
      }
   }
}

function fillBnr(){
   var theEl;
   for(i=0;i<ar.length;i++){
      if((td_NS4)||(td_IE4)){
         theEl=eval("msg"+i);
      }else{
         theEl=document.getElementById("msg"+i);
      }
      newsStr="<A " +target+classid+
              " HREF="+ar[newsCount][0]+">"+ar[newsCount][1]+"<\/A>";
      if(td_NS4){
         with(theEl.document){
            write(newsStr);
            close();
         }
      }else{
         theEl.innerHTML=newsStr;
      }
      newsCount++;
      if(newsCount==ar.length)newsCount=0;
   }
}

function startBnr(){
   ar=new Array();
   if(!window.arURL)return;
   if(arURL.length==0)return;
   numheadlines=arURL.length; 
   for(i=0;i<numheadlines;i++){
      ar[i]=new Array(prefix+arURL[i],arTXT[i]);
   }
   newsCount=0;
   if(finite)loopCount=0;
   if (td_NS4){
      makeNS();
   }else if(td_IE4){
      makeIE();
   }else{makeDOM();}
   fillBnr();
   showMsg(0,true);
   current=0;
   window.onresize=reDo;
   timeoutID=setTimeout("nextMsg()",pause);
}

function reDo(){
	//window.location.reload();
}

function initScroller() {
   finite=(maxLoops>0);

   if(td_NS4) {
      pHT=getPH("ph1");
   }else if(td_IE4){
      pHT=document.all.ph1;
   }else{
      pHT=document.getElementById('ph1');
   }

   if(pHT){
      pHT.getReal=getReal;
      bnrLft=pHT.getReal("x")-1;
      bnrTop=pHT.getReal("y");

      if(td_NS4) {
         pHB=getPH("phb");
      }else if(td_IE4){
         pHB=document.all.phb;
      }else{
         pHB=document.getElementById('phb');
      }

      if(pHB){
         pHB.getReal=getReal;
         var bnrRit=pHB.getReal("x");
         var bnrBot=pHB.getReal("y");
         bnrWid=bnrRit-bnrLft;
         bnrHit=bnrBot-bnrTop;
         startBnr();
      } // if pHB
   }    // if pHT
}       // initScroller

if((!td_isOP)&&(td_NS4||(td_IE4&&!td_isMac)||td_isDOM&&!td_isMac)){
   window.onload=initScroller;
}
//-->

