//           -- JavaScript Marquee v1.4 --
//        JavaScript Copyright (c) Tarmle 2002
//            tarmle @ ruinsofmorning.net

var msgarray=new Array
(
 '<FONT COLOR="#FFFF00"><B>What\'s New at DriveArchive ?</B></FONT>',
 '<FONT COLOR="#CCFFFF"><B>New questions in the Survey</B></FONT>',
 '<FONT COLOR="#FFFFFF"><B>New vehicles in the Identify quiz</B></FONT>',
 '<FONT COLOR="#CCFFFF"><B>Improved searching</B></FONT>'
);

var pausetime=1000;			// Length of time in miliseconds that the marquee will pause on each message.
var interval=100;			// Time inteval in miliseconds between each increment in movement (less is faster but 0 will crash big-time).
var msginc=1;				// The move increment in pixels. Non-integers may cause some jerkyness in movement.
var bgcolor='transparent';  // This is the background color of the marquee and can use any CSS color value including hex-RGB (#0099FF);

var msgc=0;
var msgcp=1;
var msgn=msgarray.length;
var d=document;

var mrqh=null; var mrqw=null; var mrqt=null; var mrql=null;
var msgh=null; var msgw=null; var msgt=null; var msgpad=0;

var IID=0;

var appN = navigator.appName; var appV = navigator.appVersion.substring(0,1);
var ie=((appN=="Microsoft Internet Explorer" && appV >= 4) ? true : false);
var ns=((appN=="Netscape" && (appV >= 4 && appV < 5)) ? true : false);
var nsix=((appN=="Netscape" && appV >= 5) ? true : false);


function beginmrq()
{
 if (ie||ns||nsix)
 {
  setupmrq();
  laymrq();
  laymsg();
  clearInterval(IID);
  pause();
 }
}


function insertdivs()
{
 if (ie||ns||nsix)
 {
  setupmrq();
  d.write('<div id="marquee" name="marquee" class="marquee">')
  for (i=0; i<msgarray.length; i++)
  {
   startmsg='<div id="message'+i+'" name="message'+i+'" class="message"><table width="'+mrqw+'" height="'+mrqh+'" border="0" cellspacing="0" cellpadding="0"><tr><td height="'+mrqh+'" width="'+mrqw+'" align="left" valign="center"><nobr>';
   d.write(startmsg+msgarray[i]+'</nobr></td></tr><tr><td align="center"><img src="spacer.gif" width="'+mrqw+'" height="1"></td></tr></table></div>');
  }
  d.write('</div>');
 }
}


function setupmrq()
{
 if (ie||nsix)
 {
  var mspace=d.mrqspacer;
  mrqt=mspace.offsetTop; mrql=mspace.offsetLeft;
  mrqw=mspace.width; mrqh=mspace.height;
 } else {
  var mspace=d.images.mrqspacer;
  mrqt=mspace.y; mrql=mspace.x;
  mrqw=mspace.width; mrqh=mspace.height;
 }
 msgw=mrqw-(msgpad*2); msgh=mrqh; msgt=msgh*2;
}


function laymrq()
{
 if (ie||nsix)
 {
  with (document.getElementById('marquee').style)
  {
   top=mrqt-msgh; left=mrql; width=mrqw; height=(mrqh*2);
   clip="rect("+mrqh+"px "+mrqw+"px "+(mrqh*2)+"px 0px)";
   visibility="visible";
  };
 } else {
  with (d.layers.marquee)
  {
   top=mrqt-msgh; left=mrql;
   clip.width=mrqw; clip.top=msgh; clip.height=mrqh;
   visibility="show";
  };
 }
}


function laymsg()
{
 for (msgc=0; msgc < msgn; msgc++)
 {
  if (ie||nsix)
  {
   with (d.getElementById("message"+msgc).style)
   {
    width=msgw; height=msgh;
    if (msgc) {top=msgh*2} else {top=msgh};
    left=msgpad;
    visibility="visible";
   }
  } else {
   with (d.layers.marquee.document["message"+msgc])
   {
    clip.width=msgw; clip.height=msgh;
    if (msgc) {top=msgh*2} else {top=msgh};
    left=msgpad;
    visibility="show";
   }
  }
 }
 msgc=0;
}


function timing()
{
 clearInterval(IID);
 IID=setInterval("movemsg()",interval);
}


function pause()
{
 clearInterval(IID);
 TID=setTimeout("clearTimeout(TID);timing()",pausetime);  
}


function repos()
{
 clearInterval(IID);
 clearTimeout(TID);
 TID=setTimeout("clearTimeout(TID);clearInterval(IID);setupmrq();laymrq();timing()",1500);
}


function movemsg()
{
 if (ie||nsix) {msgt=parseInt(d.getElementById("message"+msgc).style.top)+msgh}
  else {msgt=d.layers.marquee.document["message"+msgc].top+msgh};
 msgt-=msginc;
 if (ie||nsix) {d.getElementById("message"+msgc).style.top=msgt-msgh}
  else {d.layers.marquee.document["message"+msgc].top=msgt-msgh};
 msgcp=msgc+1;
 if (msgcp >= msgn) {msgcp=0;}
 if (ie||nsix) {d.getElementById("message"+msgcp).style.top=msgt}
  else {d.layers.marquee.document["message"+msgcp].top=msgt};
 if (msgt <= msgh)
 {
  if (ie||nsix) {d.getElementById("message"+msgc).style.top = msgh*2}
   else {d.layers.marquee.document["message"+msgc].top = msgh*2};
  msgc++;
  if (msgc >= msgn) {msgc=0;}
  pause();
 }
}

document.write('<style><!-- .marquee,.message {visibility: hidden; position: absolute; z-index: 1; background-color: ' + bgcolor + '; layer-background-color: ' + bgcolor + ';} --></style>');
