//----------------------------------------------------------------------------
// use: scroll(messageStr,millisecSpeed,verticalPos,colorIncrement,colorLimit)
//----------------------------------------------------------------------------

var o=[];//div
var p=[];//main inc
var s=[];//str
var t=[];//ref
var y=[];//start
var z=[];//speed

function scroll(str,speed,vt,inc,ref,hz)
{
var x=o.length;y[x]=0;s[x]=str;z[x]=speed;p[x]=inc;t[x]=ref;if(!hz)hz=310;
(o[x]=new NewDiv(window,'D'+x,b(s[x],x),0,vt,hz,30,1)).output();n(x);
}
function n(x){o[x].setBody(b(s[x],x));setTimeout('n('+x+');',z[x]);}

function b(str,x)
{
var u=Math.abs(p[x])*9;
y[x]+=p[x];if((y[x]>=u)||(y[x]<0))y[x]+=2*(p[x]=-p[x]);j=y[x];q=p[x];
var m='';
for(var k=str.length;--k>=0;)
  {
  j+=q;if((j>=u)||(j<0))j+=2*(q=-q);
  m='<FONT COLOR='+th(t[x]-j)+'>'+str.charAt(k)+'</FONT>'+m;
  }
return m;
}
var h=new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
function th( i )
{return h[Math.floor(i/0X100000)%16]+h[Math.floor(i/0X10000)%16]+h[Math.floor(i/0X1000)%16]+h[Math.floor(i/0X100)%16]+h[Math.floor(i/0X10)%16]+h[i%16];}

//----------------------------------------------------------------------------

isNS = navigator.appName.indexOf("Netscape")  != -1;
isIE = navigator.appName.indexOf("Microsoft") != -1;

function NewDiv(window, id, body, left, top, width, height, zIndex, absolute)
{
this.window=window;
this.id=id;
this.body=body;
var d=window.document;
d.writeln('<STYLE TYPE=text/css>#'+id+'{');
d.write(absolute?'position:absolute;':'position:relative;');
if(left)d.write('left:'+left+';');
if(top)d.write('top:'+top+';');
if(width)d.write('width:'+width+';');
if(height)d.write('height:'+height+';');
if(zIndex)d.write('z-index:'+zIndex+';');
d.writeln('}</STYLE>');
}
if (isNS)
{
NewDiv.prototype.output=function()
  {
  var d=this.window.document;
  d.writeln('<DIV ID="'+this.id+'">'+this.body+"</DIV>");
  this.layer=d[this.id];
  }
NewDiv.prototype.setBody=function()
  {
  var d=this.layer.document;
  for(var i=0;i<arguments.length;i++)d.writeln(arguments[i]);
  d.close();
  }
}
else if (isIE)
{
NewDiv.prototype.output=function()
  {
  var d=this.window.document;
  d.writeln('<DIV ID="'+this.id+'">'+this.body+"</DIV>");
  this.element=d.all[this.id];
  this.style=this.element.style;
  }
NewDiv.prototype.setBody=function()
  {
  var body="";
  for(var i=0;i<arguments.length;i++)body+=arguments[i]+"\n";
  this.element.innerHTML=body;
  }
}

function openSmall( page,xh,xw,xl,xt,status,toolbar,menubar,location,directories,scrollbars,resizable,center )
{
  if ( center && (center == 'true') )
    {
    if ( ( xl == '' ) || ( xt == '' ) || !xl || !xt )
      {
      if ( ( xh == '' ) || ( xw == '' ) || !xh || !xw )
        {
        xw = 620;
        xh = 300;
        }
      xl = ( screen.availWidth  - xw ) / 2;
      xt = ( screen.availHeight - xh ) / 2;
      }
    else
      {
      xw = screen.availWidth  - 2 * xl;
      xh = screen.availHeight - 2 * xt;
      }
    }
  else
    {
    if ( ( xl == '' ) || !xl ) xl = 120;
    if ( ( xt == '' ) || !xt ) xt = 40;
    if ( ( xw == '' ) || !xw ) xw = 620;
    if ( ( xh == '' ) || !xh ) xh = 300;
    }
 if ( status      != 'yes' ) status = 'no';
 if ( toolbar     != 'yes' ) toolbar = 'no';
 if ( menubar     != 'no'  ) menubar = 'yes';
 if ( location    != 'yes' ) location = 'no';
 if ( directories != 'yes' ) directories = 'no';
 if ( scrollbars  != 'no'  ) scrollbars = 'yes';
 if ( resizable   != 'no'  ) resizable = 'yes';

 open(page,"_blank","toolbar="+toolbar+",location="+location+",directories="+directories+",status="+status+",menubar="+menubar+",toolbar="+toolbar+",scrollbars="+scrollbars+",resizable="+resizable+",width="+xw+",height="+xh+",left="+xl+",top="+xt);
}

