/* # ticker.js Version 0.3 # Copyright (c) 2002 Luca Borrione write@tiscali-no.spam.it # Created 31 October 2002 Last Modified 07 November 2002 # _________________ # COPYRIGHT NOTICE: # Copyright (c) 2002 Luca Borrione All Rights Reserved. # Permission granted to use and modify free of charge this script so long as this # copyright notice above is maintained, modifications are documented, # and credit is given for any use of the script. # By using this code you agree to indemnify Luca Borrione from any liability that # might arise from its use. # Selling the code contained in this script without prior written consent is # expressly forbidden. # Obtain permission before redistributing this script over the Internet or # in any other medium. # In all cases copyright and header must remain intact. # # ____________ # SCRIPT CODE: */ var d = document; debugging = (document.domain.match (/192.168.2.199/)); function ticker (Id) { var d = document; if (!d.ticker || !d.ticker[Id]) {init_ticker (Id);} if (d.ticker[Id]) {return d.ticker[Id];} else return null; } window.ticker = ticker; function init_ticker (Id) { // alert ("init "+Id); if (!d.ticker) d.ticker = []; d.ticker[Id] = new Ticker (Id); /* if (!d.ticker[Id].object) { if (debugging) alert ("DYNAMIC LAYER Error:\n"+ "Impossibile risalire al layer "+ Id +"."); delete d.layer[Id]; } */ } function Ticker (Id) { this.id = Id; this.x = 0; this.y = 0; this.width = 100; this.height = 100; this.items = []; this.bgColor = null; this.visibility = true; this.inc = 2; this.fromX = 0; this.fromY = this.height; this.speed = 30; this.pause = 2000; this._dx = 0; this._dy = 0; this._timer = null; this._scrollCount = 0; this.addItem = addItem; this.build = build; this.activate = activate; this.start = start; this.slide = slide; this.show = ticker_show; this.stop = ticker_stop; this.hslide = false; this.sliding = true; this._css = ''; this._div = ''; this.addCSS = ticker_addCSS; this.addDIV = ticker_addDIV; this.started = false; function ticker_addCSS( D ) { var doc = (D) ? D : document; doc.write (this._css); } function ticker_addDIV( D ) { var doc = (D) ? D : document; doc.write (this._div); } function addItem (Text) { var i = this.items.length; this.items[i] = new Object(); this.items[i].text = Text; } function build (Document) { // overflow:hidden is used for clipping in Opera var visibility = (this.visibility) ? 'inherit' : 'hidden'; var bgcolor = (this.bgColor) ? 'background-color:'+this.bgColor+'; layer-background-color:'+this.bgColor+';' : ''; this._css = ''+ ''; this._div = '
'; for (var i=0; i'+this.items[i].text+'
' } this._div += ''; } function activate () { this.fromX = (this.hslide) ? this.width : 0; this.fromY = (this.hslide) ? 0 : this.height; for (var i=0; i