<!--

var toScroll=new Array();
var ie=document.all;
var dom=document.getElementById;
var firstNews_obj;
var secondNews_obj;
var speed = 3;
var timeout = 50;

var count = 0;
var movingspeed = speed;

function newsScroll(name){
  var c=this; c.name=name; c.mc=0; c.i=2;
  return this;
}

newsScroll.prototype.addItem = function(text,link,font,fontSize,fontStyle){
  var c = this;
  if (link !=''){
    if (font != '')
      toScroll[c.mc]='<a class="' + fontStyle + '" href="'+link+'"><font face="'+font+'" size="'+fontSize+'">'+text+'</font></a>';
    else
      toScroll[c.mc]='<a class="' + fontStyle + '" href="'+link+'">'+text+'</a>';
  }
  else { 
    if (font != '')
      toScroll[c.mc]='<font face="'+font+'" size="'+fontSize+'" Class="'+fontStyle+'">'+text+'</font>';
    else
      toScroll[c.mc]='<font Class="'+fontStyle+'">'+text+'</font>';
  }
  c.mc++;
}

newsScroll.prototype.construct = function(){
  var c = this; theWidth = c.scrollerwidth; theHeight=c.scrollerheight; thebgColor = c.scrollerbgcolor; theBackground =c.scrollerbackground; theDelay=c.scrollerdelay;
  scroll_obj=eval(c.name);        
  if (ie||dom){
    document.writeln('<div id="main2" style="position:relative;width:'+theWidth+';height:'+theHeight+';overflow:hidden;background-color:'+thebgColor+' ;background-image:url('+theBackground+')" onMouseOver="movingspeed=0;" onMouseOut="movingspeed=speed;">')
    document.writeln('<div style="position:absolute;width:'+theWidth+';height:'+theHeight+';clip:rect(0 '+theWidth+' '+theHeight+' 0);left:0;top:0">')
    document.writeln('<div id="firstNews" style="position:absolute;width:'+theWidth+';left:1;top:7">')
    document.write(toScroll[0])
    document.writeln('</div>')
    document.writeln('<div id="secondNews" style="position:absolute;width:'+theWidth+';left:0;top:7;visibility:hidden">')
    document.write(toScroll[dyndetermine=(toScroll.length==1)? 0 : 1])
    document.writeln('</div>')
    document.writeln('</div>')
    document.writeln('</div>')
  }
}

newsScroll.prototype.move = function(whichdiv){
  var c = this; theDelay = c.scrollerdelay; theWidth = c.scrollerwidth; 
  scroll_obj=eval(c.name);
  tdiv=eval(whichdiv)
	
  if (parseInt(tdiv.style.left)>0&&parseInt(tdiv.style.left)<=5){
    tdiv.style.left=0+"px"
    setTimeout("scroll_obj.move(tdiv)",theDelay)
    setTimeout("scroll_obj.move2(secondNews_obj)",theDelay)
  return
  }
  if (parseInt(tdiv.style.left)>=tdiv.offsetWidth*-1){
    tdiv.style.left=parseInt(tdiv.style.left)-movingspeed+"px"
    setTimeout("scroll_obj.move(tdiv)",timeout)
  }
  else {
    tdiv.style.left=parseInt(theWidth)+"px"
    tdiv.innerHTML=toScroll[c.i]
    if (c.i==toScroll.length-1) {
      c.i=0
    } else {
      c.i++
	}
  }
}

newsScroll.prototype.move2 = function(whichdiv){
  var c = this; theDelay = c.scrollerdelay; theWidth = c.scrollerwidth;
  scroll_obj=eval(c.name);
  tdiv2=eval(whichdiv)

  if (parseInt(tdiv2.style.left)>0&&parseInt(tdiv2.style.left)<=5){
    tdiv2.style.left=0+"px"
    setTimeout("scroll_obj.move2(tdiv2)",theDelay)
    setTimeout("scroll_obj.move(firstNews_obj)",theDelay)
    return
  }
  if (parseInt(tdiv2.style.left)>=tdiv2.offsetWidth*-1){
    tdiv2.style.left=parseInt(tdiv2.style.left)-movingspeed+"px"
    setTimeout("scroll_obj.move2(secondNews_obj)",timeout)
  }
  else {
    tdiv2.style.left=parseInt(theWidth)+"px"
    tdiv2.innerHTML=toScroll[c.i]
    if (c.i==toScroll.length-1) {
      c.i=0
    } else {
      c.i++
	}
  }
}

newsScroll.prototype.startScroll = function(){
  var c = this;
  scroll_obj=eval(c.name);        
  
  if (toScroll.length >2)
    c.i = 2;
  else
    c.i = 0;
  
  firstNews_obj=ie? firstNews : document.getElementById("firstNews")
  secondNews_obj=ie? secondNews : document.getElementById("secondNews")
  setTimeout("scroll_obj.move(firstNews_obj)",c.scrollerDelay);
  secondNews_obj.style.left=c.scrollerwidth;
  secondNews_obj.style.visibility='visible'
}

-->
