/********************************************************
 * Marquee Script - places a relatively positioned      *
 * div at the point where this script is included       *
 * with a vertically scrolling marquee contained within *
 ********************************************************/

var direction=0; /* 1 is vertical, 0 is horizontal */
var marqueeheight=25; /* Maximum height for text in scroller and height of container */
var marqueewidth=528; /* Total width of text in scroller */
var containerwidth=140; /* Width of Container + 20 */ 

var marqueespeed=1; /* Roughly equivalent to lines per second
                     * 1-5 are about all that is useful */
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1);
/*slow speed down by 1 for old versions of Netscape */

var pauseit=1;
var copyspeed=marqueespeed;
var pausespeed=(pauseit==0)? copyspeed: 0;
var iedom=document.all||document.getElementById;

var actualheight='';
var actualwidth='';
var cross_marquee, ns_marquee;

function scrollmarquee()
{
  if (direction)
  {
    if (iedom)
    {
      if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
        cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed;
      else
        cross_marquee.style.top=marqueeheight+8;
    }
    else if (document.layers)
    {
      if (ns_marquee.top>(actualheight*(-1)+8))
        ns_marquee.top-=copyspeed;
      else
        ns_marquee.top=marqueeheight+8;
    }
  }
  else
  {
    if (iedom)
    {
      if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)))
        cross_marquee.style.left=""+parseInt(parseInt(cross_marquee.style.left)-copyspeed)+"px";
      else
        cross_marquee.style.left=""+parseInt(containerwidth+20)+"px";
    }
    else if (document.layers)
    {
      if (ns_marquee.left>(actualwidth*(-1)))
        ns_marquee.left-=copyspeed;
      else
        ns_marquee.left=containerwidth+20;
    }
  }
}					
								
//FUNCTION POPULATE
function populate()
{
  if (direction)
  {
    if (iedom)
    {
      cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee;
      cross_marquee.style.top=marqueeheight+8;
      cross_marquee.innerHTML=marqueecontent;
      actualheight=cross_marquee.offsetHeight;
    }
    else if (document.layers)
    {
      ns_marquee=document.ns_marquee.document.ns_marquee2;
      ns_marquee.top=marqueeheight+8;
      ns_marquee.document.write(marqueecontent);
      ns_marquee.document.close();
      actualheight=ns_marquee.document.height;
    }
  }
  else
  {
    if (iedom)
    {
      cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee;
      cross_marquee.style.left=""+parseInt(containerwidth+20)+"px";
      cross_marquee.innerHTML=marqueecontent;
      actualwidth=cross_marquee.offsetWidth;
    }
    else if (document.layers)
    {
      ns_marquee=document.ns_marquee.document.ns_marquee2;
      ns_marquee.left=containerwidth+20;
      ns_marquee.document.write(marqueecontent);
      ns_marquee.document.close();
      actualwidth=ns_marquee.document.width;
    }
  }
  lefttime=setInterval("scrollmarquee()",30);
}

window.onload=populate;

//FUNCTION SCROLLMARQUEE
										
if (iedom||document.layers)
{
  with (document)
  {
    if (iedom)
    {
      write('<div id="jstickerbox" style="position:relative;width:'+containerwidth+'px'+';height:'+marqueeheight+'px;overflow:hidden">');
      write('<div id="iemarquee" style="position:absolute;left:20px;top:5px;width:'+marqueewidth+'px;">');
      write('</div></div>');
    }
    else if (document.layers)
    {
      write('<ilayer width='+containerwidth+' height='+marqueeheight+' name="ns_marquee">');
      write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left="0" top="0"></layer>');
      write('</ilayer>');
    }
  }
}
