//           -- JavaScript Marquee v2.3.1 --
//
//        JavaScript Copyright (c) Tarmle 2003
//            tarmle @ ruinsofmorning.net
//
//      Visit www.ruinsofmorning.net for full
//      instructions on installing and running
//      this script on your web pages!
//
// You can use this code on the condition that you
// leave this message intact - If you're going to
// benefit from my hard work at least allow me this.
//
// Cheers.
//
//  - Tarmle


// ----------- SETTINGS -----------


// This array contains your messages. There MUST be AT LEAST two messages.
// You can use HTML in your messages but NOT inline styles (use classes instead).
// ALL apostrophes (') MUST be escaped using a backslash (\').
// To prevent clipping, long lines of text MUST be manually broken using the <BR> tag.
var msgarray=new Array
(
  '<center><span class=editor>Editor: Flying Booger</span></center>'
 ,'<center><span class=publication>Intake Weekly</span></center>'
 ,'<center><span class=publication>Indianapolis Star</span></center>'
 ,'<center><span class=publication>Yes! Weekly</span></center>'
 ,'<center><span class=publication>Portsmouth Herald</span></center>'
 ,'<center><span class=publication>Lexington Herald-Leader</span></center>'
 ,'<center><span class=publication>Wilmington Star</span></center>'
 ,'<center><span class=publication>Charleston.net</span></center>'
 ,'<center><span class=publication>Buffalo Rising</span></center>'
 ,'<center><span class=publication>Rochester Democrat & Chronicle</span></center>'
 ,'<center><span class=publication>Colombia University News Service</span></center>'
 ,'<center><span class=publication>Daily Telegraph</span></center>'
 ,'<center><span class=publication>Rutland Herald</span></center>'
 ,'<center><span class=publication>Cayman NetNews</span></center>'
 ,'<center><span class=publication>CamanianCompass</span></center>'
 ,'<center><span class=publication>Sentinel</span></center>'
 ,'<center><span class=publication>Saipan Tribune</span></center>'
 ,'<center><span class=publication>The Advocate</span></center>'
 ,'<center><span class=publication>Pittsburgh Post-Gazette</span></center>'
 ,'<center><span class=publication>The Golden Mail</span></center>'
 ,'<center><span class=publication>The Moscow Times</span></center>'
 ,'<center><span class=publication>On Tap Magazine</span></center>'
 ,'<center><span class=publication>The News Record</span></center>'
 ,'<center><span class=publication>channelCincinnati.com</span></center>'
 ,'<center><span class=publication>thepilot.com</span></center>'
 ,'<center><span class=publication>The Yuma Sun</span></center>'
 ,'<center><span class=publication>The Charlotte Observer</span></center>'
 ,'<center><span class=publication>The Register-Guard</span></center>'
 ,'<center><span class=publication>Phoenix New Times</span></center>'
 ,'<center><span class=publication>Pittsburgh Live</span></center>'
 ,'<center><span class=publication>The Patriot Ledger</span></center>'
 ,'<center><span class=publication>Arizona Daily Star</span></center>'
 ,'<center><span class=publication>BruneiDirect.com</span></center>'
 ,'<center><span class=publication>BBC Inside Out</span></center>'
 ,'<center><span class=publication>Waterloo-Cedar Falls Courier</span></center>'
 ,'<center><span class=publication>North Devon Gazette</span></center>'
 ,'<center><span class=publication>Cleveland Scene</span></center>'
 ,'<center><span class=publication>Cincinnati Enquirer</span></center>'
 ,'<center><span class=publication>Skiing Magazine</span></center>'
 ,'<center><span class=publication>South Milwaukee Voice Graphic</span></center>'
 ,'<center><span class=publication>This is Cornwall</span></center>'
 ,'<center><span class=publication>Spokesman Review</span></center>'
 ,'<center><span class=publication>Detroit Free Press</span></center>'
 ,'<center><span class=publication>The News Journal</span></center>'
 ,'<center><span class=publication>North County Times</span></center>'
 ,'<center><span class=publication>Denver Westword</span></center>'
 ,'<center><span class=publication>Daily Nation</span></center>'
 ,'<center><span class=publication>KCBI News</span></center>'
 ,'<center><span class=publication>Philadelphia Inquirer</span></center>'
 ,'<center><span class=publication>Baku Sun</span></center>'
 ,'<center><span class=publication>Albany Times Union</span></center>'
 ,'<center><span class=publication>Whistler Question</span></center>'
 ,'<center><span class=publication>allAfrica.com</span></center>'
 ,'<center><span class=publication>Philly.com</span></center>'
 ,'<center><span class=publication>Reston Connection</span></center>'
 ,'<center><span class=publication>sfweekly.com</span></center>'
 ,'<center><span class=publication>CentreDaily.com</span></center>'
 ,'<center><span class=publication>Daily Globe</span></center>'
 ,'<center><span class=publication>Ann Arbor News</span></center>'
 ,'<center><span class=publication>Grand Rapids Press</span></center>'
 ,'<center><span class=publication>Idaho 2 News</span></center>'
 ,'<center><span class=publication>The Times</span></center>'
 ,'<center><span class=publication>Sadao HHH News</span></center>'
);

// Speed Settings
var pausetime = 1500;    // Length of time in milliseconds that the marquee will pause on each message.
var interval = 50;       // Time interval in milliseconds between each increment in movement (less is faster & smoother but 0 will crash).
var msginc = 10;      // The number of increments for each transition. This is a fraction of the marquee's width/height (lower = faster). 

// Movement Settings
var direction = 'rand';  // The direction the marquee should move, valid directions are 'up', 'down', 'left', 'right', 'althoz', 'altver', 'rand', 'pattern' (see below).
var direc = 'up';        // For direction settings 'althoz' and 'altver' only - sets first direction.
var transition = 'rand'; // Transition method. Valid selections are 'contig', 'cover', 'uncover', 'alt' (cover/uncover), 'rand', 'pattern' (see below).
var trans = 'cover';   // For transition settings 'alt' only - sets first transition.

// For direction setting 'pattern' only. The following array lists the pattern of movement i.e. ('left','left','right','right').
var dpat = new Array('up','right','down','left');

// For transition setting 'pattern' only. The following array lists the pattern of transition i.e. ('contig','cover','uncover','cover').
var tpat = new Array('cover','uncover','contig');

// Tie patterns to messages. Set this to true if you want the defined pattern linked to it's relative message (1st message with first direction, etc).
tiepat = false;

// Color Settings
var bgcolor = 'white';   // This is the background color of the marquee and messages and can use any CSS color value including hex-RGB (#0099FF) - 'transparent' only renders correctly with transition set to 'contig';

// Position Adjustment (if you set CSS margins you should set these two variables to match in order to correct the marquee's position in Opera7 - this will not effect other browsers). 
var dispv = 45;  // Top margin in pixels.
var disph = 45;  // Left margin in pixels.


//----------- DO NOT EDIT BELOW THIS LINE! -----------//


mc=0; mcp=1; msgn=msgarray.length;
dpatc=0; tpatc=0; dpatm=0; tpatm=0;
d=document;
opsevbg = '';

if (tiepat)
{
 dar=dpat; tar=tpat; c=0;
 while(dpat.length < msgn) {dpat.push(dar[c]); c++; if (c >= dar.length) {c=0;}}
 c = 0;
 while(tpat.length < msgn) {tpat.push(tar[c]); c++; if (c >= tar.length) {c=0;}}
}

trans = (trans=='cover') ? trans : 'uncover';
if (direction=='althoz') {direc = (direc=='left') ? direc : 'right';}
else if (direction=='altver') {direc = (direc=='up') ? direc : 'down';}

mrqh=null; mrqw=null; mrqt=null; mrql=null;
mh=null; mw=null; mt=null; ml=null;
vt=0; vl=0; 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;
var op = (navigator.userAgent.indexOf('Opera 6.') >= 0) ? true : false;
var opsev = (navigator.userAgent.indexOf('Opera 7.') >= 0) ? true : false;

if (!opsev) {dispv = 0; disph = 0;}


function beginmrq()
{
 if (op) {return;}
 if (ie||ns||nsix||opsev)
 {
  setupmrq();
  laymrq();
  laymsg();
  clearInterval(IID);
  pause();
 }
}


function insertdivs()
{
 if (op) {return;}
 if (ie||ns||nsix||opsev)
 {
  setupmrq();
  d.write('<div id="marquee" name="marquee" onMouseOver="javascript:clientpause(true);" onMouseOut="javascript:clientpause(false);" 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"' + opsevbg + '>';
   d.write(startmsg+msgarray[i]+'</td></tr><tr><td align="center"><img src="spacer.gif" width="'+mrqw+'" height="1"></td></tr></table></div>');
  }
  d.write('</div>');
 }
 beginmrq();
}

function setupmrq()
{
 if (ie||nsix||opsev)
 {
  mspace=d.mrqspacer;
  mrqt=mspace.offsetTop+dispv; mrql=mspace.offsetLeft+disph;
  mrqw=mspace.width; mrqh=mspace.height;
 } else {
  mspace=d.images.mrqspacer;
  mrqt=mspace.y+dispv; mrql=mspace.x+disph;
  mrqw=mspace.width; mrqh=mspace.height;
 }
 mw=mrqw; mh=mrqh; mt=mrqh;
}

function laymrq()
{
 if (ie||nsix||opsev)
 {
  with (d.getElementById('marquee').style)
  {
   top=mrqt; left=mrql; width=mrqw; height=mrqh;
   clip="rect(0px "+mrqw+"px "+mrqh+"px 0px)";
   visibility="visible";
  };
 } else {
  with (d.layers.marquee)
  {
   top=mrqt; left=mrql; width=mrqw; height=mrqh;
   clip.width=mrqw; clip.height=mrqh;
   visibility="show";
  };
 }
}

function laymsg()
{
 for (mc=0; mc < msgn; mc++)
 {
  if (ie||nsix||opsev)
  {
   with (d.getElementById("message"+mc).style)
   {
    width=mw; height=mh;
    if (mc) {top=-1000; left=-1000;} else {top=0; left=0;}
    vt=0;
    clip="rect(0px "+mrqw+"px "+mrqh+"px 0px)";
    visibility="visible";
   }
  } else {
   with (d.layers.marquee.document["message"+mc])
   {
    if (mc) {top=-1000; left=-1000;} else {top=0; left=0;}
    vt=0;
    clip.width=mw; clip.height=mh;
    visibility="show";
   }
  }
 }
 mc=0;
}


function timing()
{
 clearInterval(IID);
 IID=setInterval("movemsg()",interval);
}

function pause()
{
 clearInterval(IID);
 TID=setTimeout("clearTimeout(TID);timing()",pausetime);

 laymrq();

 if (direction == 'rand')
 {
  rn=Math.random()*3;
  rn=Math.round(rn);
  dar = new Array('up','down','left','right');
  direc = dar[rn];
 }

 if (direction == 'pattern')
 {
  if (tiepat)
  {
   direc = dpat[mc];
  } else {
   direc = dpat[dpatc];
   dpatc++;
   if (dpatc >= dpat.length) {dpatc = 0;}
  }
 }
 if (direction == 'althoz') {direc = (direc == 'left') ? 'right' : 'left';}
 if (direction == 'altver') {direc = (direc == 'up') ? 'down' : 'up';}
 if (direction != 'rand' && direction != 'altver' && direction != 'althoz' && direction != 'pattern')  {direc = direction;}

 if (transition == 'rand')
 {
  rn=Math.random()*2;
  rn=Math.round(rn);
  tar = new Array('contig','cover','uncover');
  trans = tar[rn];
 }
 if (transition == 'pattern')
 {
  if (tiepat)
  {
   trans = tpat[mc];
  } else {
   trans = tpat[tpatc];
   tpatc+=1;
   if (tpatc >= tpat.length) {tpatc = 0;}
  }
 }
 if (transition == 'alt') {trans = (trans == 'cover') ? 'uncover' : 'cover';}
 if (transition != 'rand' && transition != 'alt' && transition != 'pattern')  {trans = transition;}
}

function repos()
{
 clearInterval(IID);
 clearTimeout(TID);
 if (ie||nsix||opsev)
 {
  TID=setTimeout("clearTimeout(TID);clearInterval(IID);setupmrq();laymrq();timing()",1500);
 } else {
  window.location.reload();
 }
}


function st(mn,pos)
{
 if (ie||nsix||opsev) {d.getElementById("message"+mn).style.top=pos;} else {d.layers.marquee.document["message"+mn].top=pos;}
}

function sl(mn,pos)
{
 if (ie||nsix||opsev) {d.getElementById("message"+mn).style.left=pos;} else {d.layers.marquee.document["message"+mn].left=pos;}
}

function sz(mn,zin)
{
 if (ie||nsix||opsev) {d.getElementById("message"+mn).style.zIndex=zin;} else {d.layers.marquee.document['message'+mn].zIndex=zin;}
}

function sv(mn,tf)
{
 if (ie||nsix||opsev) {d.getElementById("message"+mn).style.visibility = (tf) ? 'visible' : 'hidden';} else {d.layers.marquee.document['message'+mn].visibility = (tf) ? 'show' : 'hide';}
}


function movemsg()
{
 if (direc == 'up') {vt -= (mh/msginc);}
 if (direc == 'down') {vt += (mh/msginc);}
 if (direc == 'left') {vl -= (mw/msginc);}
 if (direc == 'right') {vl += (mw/msginc);}

 sv(mc,true);

 if (trans == 'contig' || trans == 'uncover')
 {
  if (direc == 'up') {st(mc,vt);}
  if (direc == 'left') {sl(mc,vl);}
  if (direc == 'down') {st(mc,vt);}
  if (direc == 'right') {sl(mc,vl);}
 } else {
  sl(mc,0); st(mc,0);
 }

 if (trans == 'uncover') {sz(mc,2);} else {sz(mc,0);}

 mcp=mc+1;
 if (mcp >= msgn) {mcp=0;}

 sv(mcp,true);

 if (trans == 'contig' || trans == 'cover')
 {
  if (direc == 'up') {st(mcp,vt+mh); sl(mcp,vl);}
  if (direc == 'left') {sl(mcp,vl+mw); st(mcp,vt);}
  if (direc == 'down') {st(mcp,vt-mh); sl(mcp,vl);}
  if (direc == 'right') {sl(mcp,vl-mw); st(mcp,vt);}
 } else {
  sl(mcp,0); st(mcp,0);
 }

 if (trans == 'uncover') {sz(mcp,0);} else {sz(mcp,2);}

 stepflag = false;

 if (direc == 'up' && vt <= 0-mh) {st(mc,-1000); stepflag = true;}
 if (direc == 'down' && vt >= mh) {st(mc,-1000); stepflag = true;}
 if (direc == 'left' && vl <= 0-mw) {sl(mc,-1000); stepflag = true;}
 if (direc == 'right' && vl >= mw) {sl(mc,-1000); stepflag = true;}

 if (stepflag)
 {
  sv(mc,false);
  vl = 0; vt = 0;
  mc++;
  if (mc >= msgn) {mc=0;}
  mcp=mc+1;
  if (mcp >= msgn) {mcp=0;}
  sl(mc,vl); st(mc,vt);
  pause();
 }
}


function clientpause(tf)
{
 if (op) {return;}
 if (tf)
 {
  clearInterval(IID); clearTimeout(TID);
 } else {
  pause(); return;
 }
 vl = 0; vt = 0;
 sl(mc,vl); st(mc,vt); sz(mc,2);
 sl(mcp,-1000); st(mcp,-1000); sz(mcp,0);
}


function clientstep(stepd)
{
 if (op) {return;}
 if (stepd == 'back') {mc-=1;} else {mc+=1;} if (mc >= msgn) {mc=0;} if (mc < 0) {mc=msgn-1;}
 mcp=mc+1; if (mcp >= msgn) {mcp=0;} if (mcp < 0) {mcp=msgn-1;}
 for (cz=0; cz < msgn; cz++) {sl(cz,-1000); st(cz,-1000); sz(cz,0); sv(mc,false)};
 vl = 0; vt = 0;
 sl(mc,vl); st(mc,vt); sz(mc,2); sv(mc,true);
}

document.write('<style><!-- .marquee,.message {visibility: hidden; position: absolute; z-index: 1; background-color: ' + bgcolor + '; layer-background-color: ' + bgcolor + ';} --></style>');






