
var width='550px'
var height='300px'
var bgcolor='#FFFFFF'
var duration=3000 //SET DURATION BETWEEN SLIDES IN MILLISECONDS 
var speed=1 // NUMBER OF SECONDS TO COMPLETELY SCROLL UP. SPEED DEPENDS ON HEIGHT OF SCROLL AREA.
var ie4=document.all
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
var curpos=height*(1)
var degree=15
var clarityinc=0
var clarity=0
var framedelay=0
var curcanvas="canvas0"
var curindex=0
var nextindex=1 
var scrollingData=new Array()

function showScroller(dataArray, scrollboxHeight, scrollboxWidth, backgroundcolor, scrollspeed, showduration) {
  scrollingData=dataArray
  height=scrollboxHeight+"px"
  width=scrollboxWidth+"px"
  bgcolor=backgroundcolor
  speed=scrollspeed
  duration=showduration
  if (ie4||dom)
    document.write('<div style="position:relative;width:'+width+';height:'+height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+width+';height:'+height+';top:'+height+';filter:alpha(opacity=1);-moz-opacity:0.01;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+width+';height:'+height+';top:'+height+';filter:alpha(opacity=1);-moz-opacity:0.01;"></div></div>')
  else if (document.layers) {
    document.write('<ilayer id=tickernsmain visibility=hide width='+width+' height='+height+' bgColor='+bgcolor+'><layer id=tickernssub width='+width+' height='+height+' left=0 top=0>'+scrollingData[0]+'</layer></ilayer>')
  }
  startit()  
}


function startit(){
  // calculate fade-in increment
  clarityinc=5 //100/(parseInt(height)/degree);
  // calculate delay between frames when scrolling
  framedelay=50 //Math.max((speed*1000)/(parseInt(height)/degree),1)

  crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub
  if (ie4||dom){
    crossobj.innerHTML=scrollingData[curindex]
    rotateslide()
  } else{
    document.tickernsmain.visibility='show'
    curindex++
    setInterval("rotateslide()",duration)
  }
}


function rotateslide(){
  if (ie4||dom){
    resetit(curcanvas)
    crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
    crossobj.style.zIndex++
    if (crossobj.filters)
      document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=0
    else if (crossobj.style.MozOpacity)
      document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.0
    var temp='setInterval("moveslide()",framedelay)'
    dropslide=eval(temp)
    curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
  } else
    if (document.layers){
      crossobj.document.write(scrollingData[curindex])
      crossobj.document.close()
    }
  curindex=(curindex<scrollingData.length-1)? curindex+1 : 0
}


function resetit(what){
  curpos=parseInt(height)*(1)
  var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
  crossobj.style.top=curpos+"px"
  clarity=0
}


function moveslide(){
  if (curpos>0){
    curpos=Math.max(curpos-degree,0)
    clarity=Math.round(clarity+clarityinc)
    if (crossobj.filters)
			crossobj.filters.alpha.opacity=clarity
		else if (crossobj.style.MozOpacity)
			crossobj.style.MozOpacity=clarity/100
    tempobj.style.top=curpos+"px"
  } else {
clearInterval(dropslide)
if (crossobj.filters)
crossobj.filters.alpha.opacity=100
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=1
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj.innerHTML=scrollingData[curindex]
nextindex=(nextindex<scrollingData.length-1)? nextindex+1 : 0
setTimeout("rotateslide()",duration)
  }
}







