/*
* ScrollingBanner.jsb 1.0 97/08/28
*
* Copyright (c) 1997 Netscape Communications Corporation
*
* Netscape grants you a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Netscape.
*
* This software is provided "AS IS," without a warranty of any kind.
* See the CDK License Agreement for additional terms and conditions.
*/
/**
* n_s_w_ stands for netscape/samples/simple...
* allows icon to sit in root of jar while
* providing reasonable namespace collision-prevention
*/
/**
* Determines the message to be displayed in the status bar
* @see speed
* @see position
*/
/**
* Determines the speed of scrolling
*/
/**
* Determines the position of the banner
* upon initial startup. This is an advanced
* feature which is not exposed by the Customizer.
*/
/**
* Main functional portion of the scroller
* Starts animating a message across the status bar
*/
function netscape_samples_widgets_ScrollingBanner_start() {
if (this.currentPos == null)
this.currentPos = this.pos;
for (i = 0; i < this.currentPos; i++)
this.out += " ";
if (this.currentPos >= 0)
this.out += this.msg;
else
this.out = this.msg.substring(-this.currentPos, this.msg.length);
window.status = this.out;
this.out = " ";
this.currentPos--;
if (this.currentPos < -(this.msg.length))
this.reset();
execStr = this.id + ".start()";
this.bannerID = setTimeout (execStr, this.speed);
}
/**
* Stops the scroller
*/
function netscape_samples_widgets_ScrollingBanner_stop() {
clearTimeout(this.bannerID);
}
/**
* Resets the scroller
*/
function netscape_samples_widgets_ScrollingBanner_reset() {
this.currentPos = this.pos
}
/**
* Main constructor for the
* Scrolling Banner
*/
function netscape_samples_widgets_ScrollingBanner(params) {
this.msg = params.msg
this.speed = params.speed
if (this.speed==0) this.speed = 0
this.pos = params.position
this.out = " "
this.id = params.id
this.start = netscape_samples_widgets_ScrollingBanner_start;
this.stop = netscape_samples_widgets_ScrollingBanner_stop;
this.reset = netscape_samples_widgets_ScrollingBanner_reset;
}