/*
Cross browser Marquee script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth=862
//Specify the marquee's height
var marqueeheight=24
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=3
//configure background color:
var marqueebgcolor="#EAEAEA"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById

var offset_x, actualwidth=0
var cross_marquee, ns_marquee

function populate(divname, text, htmltext)
{
  o = false;
  if (document.getElementById)
    { o = document.getElementById(divname); }
  else if (document.all)
    { o = document.all[divname]; }
  if (o)
    { o.innerHTML = htmltext; }
  else if (document.layers)
    {
    with (document.layers[divname].document)
    { 
      open();
      write(htmltext);
      close();
    }
  }
  else
    actualwidth=1

  if(!actualwidth)
  {
    offset_x = marqueewidth+8
    if (iedom)
    {
      cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
      cross_marquee.style.left = offset_x+'px'
      cross_marquee.innerHTML=text
      actualwidth=document.all? cross_marquee.offsetWidth : document.getElementById("temp").offsetWidth
    }
    else if (document.layers)
    {
      ns_marquee=document.ns_marquee.document.ns_marquee2
      ns_marquee.left=offset_x+'px'
      ns_marquee.document.write(text)
      ns_marquee.document.close()
      actualwidth=ns_marquee.document.width
    }
  
    lefttime=setInterval("scrollmarquee()",20)
  }
}

function scrollmarquee()
{
  if (parseInt(offset_x)>(actualwidth*(-1)+8))
    offset_x=parseInt(cross_marquee.style.left)-copyspeed
  else
    offset_x=marqueewidth+8
  if (iedom)
    cross_marquee.style.left = offset_x+'px'
  else if (document.layers)
    ns_marquee.left=offset_x+'px'
}

function init_ticker(divname, text, speed, width, height, bgcolor)
{
  var htmltext = ''
  
  if(width)
    marqueewidth=width
//Specify the marquee's height
  if(height)
    marqueeheight=height
//Specify the marquee's marquee speed (larger is faster 1-10)
  if(speed != 0)
    marqueespeed=speed
//configure background color:
  if(bgcolor != '')
    marqueebgcolor=bgcolor
    
  copyspeed=marqueespeed
  pausespeed=(pauseit==0)? copyspeed: 0
  
  text = '<nobr><font face="Arial">'+text+'</font></nobr>';

  if (iedom)
    htmltext+= '<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-1000">'+text+'</span>'
    
  if (iedom||document.layers)
  {
    with (document)
    {
      htmltext += '<table border="0" cellspacing="0" cellpadding="0" class="ticker"><td>'
      if (iedom)
      {
        htmltext += '<div style="position:relative;width:'+marqueewidth+'px;height:'+marqueeheight+'px;overflow:hidden">'
        htmltext += '<div style="position:absolute;width:'+marqueewidth+'px;height:'+marqueeheight+'px;background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'
        htmltext += '<div id="iemarquee" style="position:absolute;left:0;top:0px"></div>'
        htmltext += '</div></div>'
      }
      else if (document.layers)
      {
        htmltext+= '<ilayer width='+marqueewidth+'px height='+marqueeheight+'px name="ns_marquee" bgColor='+marqueebgcolor+'>'
        htmltext+= '<layer name="ns_marquee2" left=0px top=0px onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'
        htmltext+= '</ilayer>'
      }
      htmltext+= '</td></table>'
    }
  }
  window.onload=function(){populate(divname, text, htmltext);}
}