function dynamicArray() {	this.data = new Array(10);	this.size = 0;	this.increment = 10;	this.getCapacity = function() { return this.data.length; }	this.getSize = function() { return this.size; }	this.isEmpty = function() { return this.size == 0; }	this.head = function() { return this.data[0]; }	this.tail = function() { if(this.size == 0) { return null; } return this.data[this.size - 1]; }	this.at = function(i) { try { return this.data[i]; } catch(e) { return null; } }	this.add = function(obj) { if(this.size == this.data.length) { this.resize(); } this.data[this.size++] = obj; }	this.insert = function(obj, idx) { if(this.size == this.data.length) { this.resize(); } for(var i = this.size; i > idx; i--) { this.data[i] = this.data[i -1]; } this.data[idx] = obj; this.size++; }	this.remove = function(idx) { try {var el = this.data[idx]; for(var i = idx; i > this.size - 1; i++) { this.data[i] = this.data[i+1]; } this.data[size -1 ] = null; this.size--; return el;} catch(e) { return null; } }	this.clear = function() { this.size = 0; this.data = new Array(this.increment); }	this.indexOf = function(obj) { for(var i = 0; i < this.size; i++) { if(this.data[i] == obj) { return i; } } return -1; }	this.resize = function() { nData = new Array(this.data.length + this.increment); for(var i = 0; i < this.data.length; i++) { nData[i] = this.data[i]; } this.data = nData; }	this.trim = function() { var t = new Array(this.size); for(var i = 0; i < this.size; i++) { t[i] = this.data[i]; } this.size = t.length - 1; this.data = t; }}function Scroller(id) {	this.element = document.getElementById(id);	this.contents = new dynamicArray();	this.current = 0;		this.addContent = function(content) {		this.contents.add(content);	}		this.draw = draw;		this.next = next;		this.previous =  previous;		this.reset = reset;		function reset() {		this.current = 0;		this.draw();	}		function next() {		if((this.current + 1) == this.contents.size) {			return false;		} 		else {			this.current++;			this.draw();			return true;		}	}		function previous() {		if((this.current - 1) < 0) { 			return false;		}		else {			this.current--;			this.draw();			return true;		}	}		function draw() {		this.element.style.height = 'auto';			while(this.element.rows.length > 0) {			this.element.deleteRow(0);		}				var row = this.element.insertRow(0);		var cell = row.insertCell(0);		cell.innerHTML = this.contents.at(this.current);				if(this.element.clientHeight < 130) {			this.element.style.height = '130px';		}	}}