// -----------------------------------------------------------------
// Function    : Banner Code, 
//		 Formula driver code - allows for a list of formulas to be applied to different modules.
// Language    : JavaScript
// Description : Checks if given email address is of valid syntax
// Copyright   : (c) 1999 Aydin Akcasu
// http://www.A-V-I.com, AVision@A-V-I.com
// -----------------------------------------------------------------
// Ver    Date    Description of modification
// --- ---------- --------------------------------------------------
// 1.0 10/10/1999 Original write, formulas list
// 1.1            Add number validation, parameters list
//			Handle multiple length formulas, 
// -----------------------------------------------------------------
// -----------------------------------------------------------------
function banneritem(id,name) {
	this.id = id;
	this.name = name;
}

function _bannerlist_increment() {
	this.index = this.index+1;
	if (this.index == this.length) this.index = 0;
}

var id,pause=0,position=0,revol=0;

// Speed was set to 400, changing it has not effect that I can see

var speed=400;
var rposition=100;
var repeats = 1;

function _bannerlist_show(textbox) {
	var t= this[this.index].name;
	var blank = "                                                                               ";
	var msg= blank+t+blank;  
  	if (textbox)  this.textbox = textbox;	
	this.textbox.value = 
		msg.substring(position,position+rposition);
	if(position++==msg.length)   {
		if (++revol >= repeats) {
			this.increment();
      			revol = 0;
      			}
		position=0;
	}
// The smaller the denominator the slower the script speed
	id=setTimeout("banners.show()",5.0*speed/1000);
}

function bannerlist(){
	var argc = bannerlist.arguments.length-1;
	var argv = bannerlist.arguments;
	var ml = banneritem.length;
	this.length = argc/ml;
	this.index = 0;
	this.textbox = null;
	this.show = _bannerlist_show
	this.increment = _bannerlist_increment;
	for (var i=0; i < argc; i+=ml)
		this[i/ml] = new banneritem(argv[i],argv[i+1]);
}


